Communicating directly with the Arduino in the Ninja Block


  • ssh tools (to access Ninja Block)
  • internet access on Ninja Block (for installing 'screen' only)

Access NinjaBlock

First you must ssh into your Ninja Block.

  ssh ubuntu@ninjablock.local

(default password is "temppwd")

Install 'screen'

By default, 'screen' is not installed on the ubuntu image currently released. You can check with:

ubuntu@ninjablock:~$ screen -v
-bash: screen: command not found

Ensure you are connected to the internet for this step and install it with:

ubuntu@ninjablock:~$ sudo apt-get install screen

ninjablock service

The client code which runs as the 'ninjablock' service, uses the serial device to talk to the arduino. We need to stop it so that we may connect to the serial device.

ubuntu@ninjablock:~$ sudo stop ninjablock

After testing you can restart it with:

ubuntu@ninjablock:~$ sudo start ninjablock

Connect to the arduino

Now you can use 'screen' to connect to the serial device (on the Raspberry Pi this is /dev/ttyAMA0).

ubuntu@ninjablock:~$ screen /dev/ttyO1 9600

Note: to exit the screen session, press [ctrl] + [a], then [k].

Listening to the arduino

Now you will be able to see directly the json that is sent from the arduino.

For example, every 30 seconds, LED device data (Nina's Eyes Device ID 1007, Status LED DID 999) is sent from the arduino:


Humidity (DID 30) and Temperature (DID 31):


RF devices (DID 11):


Talking to the arduino

The 'screen' connection is bi-directional, so you can send commands to the arduino. For example, sending a carriage return (hit [Enter] in 'screen') will result in an error response from the arduino:


If you copy the command to set Nina's Eye's, you can modify it in a text field, then paste it directly to 'screen'. For example, this will turn the eyes blue:


Pasting a received RF command (such as a socket remote control), will have the arduino transmit that command via rf. For example:



Happy Hacking!

James Zaki
James Zaki