ServerlessNabaztag

ServerlessNabaztag is a firmware allowing control of the Nabaztag/tag directly via the web, without an external server (a web server is needed only for downloading the firmware and resources).

With this firmware, you can connect at http://<YOURNABAZTAGIP>/ and completely control your rabbit with a very simple web interface, as shown in the following screenshot:

The OpenAPI specification is available at http://<YOURNABAZTAGIP>/openapi.json and the Swagger UI at http://andreax79.github.io/ServerlessNabaztag/vl/api/

All the commands can be called with a single HTTP request from an external program/script, example:

$ curl http://nabaztag/wakeup

In examples/check_mail.py, there is a script that turns on the nose when you have unread email.

Configure the rabbit

Install on your web server (HTTP only)

Firmware features

Forth Interpreter

The firmware includes a built-in Forth interpreter that allows you to interactively control and program your Nabaztag. The interpreter provides a powerful scripting environment with access to all rabbit functions.

Accessing the Interpreter

You can access the Forth interpreter in two ways:

Available Words

The complete list of available Forth words is documented in vl/words.txt. The interpreter supports standard Forth operations plus Nabaztag-specific commands for controlling ears, playing sounds, and more.

Simple Examples

Here are some basic commands to get you started:

\ Move the left ear forward to position 10
left-ear forward 10 move-ear

\ Move the right ear backward to position 5
right-ear backward 5 move-ear

\ Play a MIDI note (middle C)
60 play-midi

\ Display current ear positions
ears . .

\ Wake up the rabbit
wake-up

\ Put the rabbit to sleep
sleep

\ Display current time
daytime

\ Say something (text-to-speech)
"Hello World" say

\ Override the left LED to red color
"#ff0000" led-left !

Configuration

You can configure the telnet login credentials and other settings by editing the vl/config.forth file. This file contains configuration variables for the username and password.

Most of the Nabaztag’s functionality can be customized by editing the Forth files in the vl folder:

Development

Please install the following dependencies:

$ sudo apt-get install gcc-multilib g++-multilib

Build the compiler and the simulator:

$ make compiler

Build the firmware

$ make firmware

Start a local web server on port 80 (you need root for this):

$ sudo python3 -m http.server 80

or start local web server on port 8000 and redirect port 80 to 8000 (you need root for the iptables command):

$ sudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000
$ python3 -m http.server