First steps with my Nucleo-F401RE

Hi folks,

today I wanna share my first experiences with my new gadget, a STM32 Nucleo-F401RE ( I got mine when I visited Embedded World exhibition in Nürnberg this year, but you can order one online for about 10€, e.g. from

In this post I share how I got started and how to get a first “Hello World” program running.

Nucleo-F401RE with mbed online IDE

Nucleo-F401RE with mbed online IDE

Continue reading

how to connect a python client to java server with TCP sockets

Hello folks,

this time I would like to share my knowledge about connecting a java server program with a python client program using TCP socket communication. Yesterday I spent quite a lot time to get this running, by reading several tutorials on socket programming but I only got java-java or python-python communication running smoothly.

Ok, my key problem was that java expects the end-of-line sign (EOL) in some way, that the python examples didn’t supply. It all depends on the combination of what kind of functions are used to read and write from and to the sockets. Continue reading

run SL4A python script from within Android app

Hello folks,
in this post I wanna give you a short introduction how you can launch scripts (specifically python scripts) from your android application.

To follow this tutorial you have to have SL4A installed on your device / emulator.
In case you don’t know SL4A, you can check my previous post on that: and I also found another quite good tutorial on how to install SL4A here:

Continue reading

call python script from Java app

Hello readers,

in this post I wanna give you a brief description how you can call python code from with a java program. For that purpose we will use two very simple “Hello World” programs, one in python, one for java.

First the python script. Create a new file “~/python/” with the following content:

import os
from stat import *

print "Hello World from python"

Now fire up your eclipse and create a default java application. Create a new java class named “PythonCaller”. The content of this new file will look like this:

package org.norbert;


public class PythonCaller {

* @param args
* @throws IOException
public static void main(String[] args) throws IOException {
// set up the command and parameter
String pythonScriptPath = "/home/norbert/python/";
String[] cmd = new String[2];
cmd[0] = "python"; // check version of installed python: python -V
cmd[1] = pythonScriptPath;

// create runtime to execute external command
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec(cmd);

// retrieve output from python script
BufferedReader bfr = new BufferedReader(new InputStreamReader(pr.getInputStream()));
String line = "";
while((line = bfr.readLine()) != null) {
// display each output line form python script

So what is this doing? Basically we execute the python script by envoking python2.6 and provide the path to the script as parameter, as you would normally do it if you exec the script in a terminal/bash.
The output generated by the script is then read line by line with a BufferedReader and displayed in the terminal where we execute the java application.

You can execute the java program in eclipse by click on the green run button or compile and exec it in a terminal with:

cd workspace/JavaPythonCall/src/org/norbert
cd ../..
java org.norbert.PythonCaller


Hello World from python

Sweet ^_^ yeah 😉 This was a quick one, but I hope this helps.