FAQ for Developers

How is Node-RED embedded?

NodeRED used following the “Embedding into an existing app” as described in the Node-RED documentation http://nodered.org/docs/embedding.html.

How do I SSH ?

Try to use the hostname to connect. You may have to use the IP Address instead. You can find it in the menu Settings / Parameters.

Default credentials are root/raspberry

Userdir can be found in cd /root/userdir/ Newly installed nodes are in cd /root/userdir/node_modules

Where do I find a non-userdir node ?

docker exec -it thethingbox bash
cd thethingbox/node_modules/node-red/node_modules/ttbd-node-sound

Using Samba (after connecting in SSH to the host):

mkdir -p /root/modules/
docker cp thethingbox:/root/thethingbox/node_modules/node-red/node_modules/ttbd-node-sound /root/modules/

Access the files:

\\<network name of the device here>\TheThingBox\root\modules\ttbd-node-sound

After modifying the files:

docker cp /root/modules/ttbd-node-sound thethingbox:/root/thethingbox/node_modules/node-red/node_modules/
docker restart thethingbox

Where do I find the NodeRED settings ?

  • On the non docker version

on the ThingBox, Node-RED is installed in /root/thethingbox/node_modules/node-red/

You can update the file /root/thethingbox/node_modules/node-red/settings.js

You can also update the javascript object settings_nodered_ext into the file /root/thethingbox/thethingbox.js that expand the settings.js of Node-RED

In the file root\thethingbox\thethingbox.js

The settings are there:

var userDir="/root/userdir/";
var flowDir=userDir;
var settings_nodered_ext = {
	httpNodeRoot: "/",
	httpNodeCors: {
		origin: "*",
		methods: "GET,PUT,POST,DELETE"
	userDir: userDir,
	flowDir: flowDir,
	flowFile: flowDir + "flows.json",
	secondFlowDir: "/root/thethingbox/node_modules/node-red/flow/",
	verbose: true,
	flowFilePretty: true,
	otherPropToSave: ['origin', 'extra'],
	paletteCategories:['basic', 'subflows', 'input', 'output', 'function', 'social', 'storage', 'analysis', 'advanced'],
	hiddenWorkspaces: ['system'],
	functionGlobalContext: {
		settings: settings_ttb
		,userDir: userDir
		,settingslib: require('/root/thethingbox/settingsttb.js')
		,wpi: require('node-red/node_modules/wiring-pi') // https://www.npmjs.com/package/wiring-pi
		,CryptoJS: require('node-red/node_modules/crypto-js') // https://www.npmjs.com/package/cryptojs
		,HID: require('node-red/node_modules/node-hid') // https://www.npmjs.com/package/node-hid
> Note: the code above is the settings use for the version 2.1.0

The Node-RED settings are loaded too (since version 2.1.0) This file is located in root\thethingbox\node_modules\node-red\settings.js (http://nodered.org/docs/configuration.html) But those settings are overwritten by thethingbox :

  • uiPort
  • flowFile
  • flowFilePretty
  • userDir
  • httpAdminRoot
  • httpNodeRoot
  • httpNodeCors
  • functionGlobalContext
  • paletteCategories
  • On the docker version

> see the non docker section The files /root/thethingbox/thethingbox.js and /root/thethingbox/node_modules/node-red/settings.js are not accessible from the host, you have to get an SSH access as root and run :

docker exec -it thethingbox bash

then you can edit these files using nano or vim :

nano /root/thethingbox/thethingbox.js

after you make your changes, exit the container and restart Node-RED :

docker restart thethingbox

How to get a unique ID?

Each thingBox or TimeSquAir has a unique ID.

It is an auto-generated UUID Or a serial number for commercially released devices.

Create a function node with:

msg.payload = global.get('settings').id;
return msg;

and display the payload.

This is useful to build a device dedicated MQTT topic.

You can also use the hostname as a unique ID.

How to get the hostname?

  • On the non docker version

Just read the dedicated file:

A good idea is toLowerCase is a function node (and may be trip line returns):

if (typeof msg.payload === 'string') {
    msg.hostname = msg.payload.toLowerCase();
return msg;
  • On the docker version

    You can find it in the menu Settings / Parameters.

How can I find its IP address ?

  1. You can find it in the menu Settings / Parameters.

  2. You can also do a Avahi scan (see later)

  3. Third solution: Connect via SSH on your device. Enter : ifconfig and the ip will be written like that :

    eth0 inet addr:

How to do a avahi scan for devices on the local network?

If your device has the network name home1, use the following address in a browser: http://home1.local/avahi/scan

Find your devices in the list:

    "Freebox-Player.local": {
        address: "",
        port: "24322"
    "Freebox-Server.local": {
        address: "",
        port: "445"
    "SEC001599D37A46.local": {
        address: "",
        port: "80"
    "8b92cbf4-66a6-b585-7d95-42dfe20f3b1f.local": {
        address: "",
        port: "8009",
        txt: {
            rs: "YouTube",
            nf: "1",
            bs: "FA8FCA68D963",
            st: "1",
            ca: "4101",
            fn: "Chromecast TV",
            ic: "/setup/icon.png",
            md: "Chromecast",
            ve: "05",
            rm: "9FC52B50D8684F1C",
            cd: "495E077770B2FE6FA3B7928C07402729",
            id: "8b92cbf466a6b5857d9542dfe20f3b1f"
    "home1.local": {
        address: "",
        port: "9"
    "Musique.local": {
        address: "fe80::2062:2f04:b9c1:a26b",
        port: "2020",
        txt: {
            UUID: "a30e8496-5fae-4cb2-a925-b0adc7d5b803",
            Token: "cacYIvbGk4MCffZk",
            DyngateID: "673678089"
    "tsabed.local": {
        address: "",
        port: "9"
    "musicttb.local": {
        address: "",
        port: "9"
    "MacBook-Pro-de-Alice.local": {
        address: "",
        port: "54145",
        txt: {
            rpHA: "1a2fe580b87d",
            rpVr: "120.48",
            rpHN: "90634785a3b4",
            rpHI: "959ffa6d8822",
            rpFl: "0x0",
            rpBA: "2B:07:64:5F:FF:D0"
    "iPhone-de-Coline.local": {
        address: "",
        port: "32498"

Where I can find the Node-RED logs ?

  • On the non docker version From samba:

  • On the docker version From samba:


How to launch NodeRED manually from the console?

  • On the non docker version From SSH as root:

    service thethingbox restart
  • On the docker version From SSH as root:

    docker restart thethingbox

The Thingbox expands the SDCard at first boot

At first boot, a Thingbox expands to the whole SDCard with resize2fs - On the non docker version Script is in root\thethingbox\.auto-expand-scripts (deleted at first boot) - On the docker version Script is in root\.auto-expand-scripts (deleted at first boot)

How to manually ‘npm install’ new nodes

Many nodes can be install with the “import / node” UI.

But you can add by yourself, preferably in /root/userdir to avoid erasing them with the updater.

  • On the non docker version

    cd /root/userdir
    npm install --unsafe-perm --legacy-bundling --no-package-lock xxxx
  • On the docker version

    In version 3.0.0, TheThingBox works in a docker container, NodeJS and npm work in this container and are not available on the device level.

    To use npm, you should get the container cli with the command :

    docker exec -it thethingbox bash
    cd /root/userdir
    npm install --unsafe-perm --legacy-bundling --no-package-lock xxxx

Where are my datas?

Flows and settings are stored outside in /root/userdir Be aware that if you install additional nodes yourself, they may store their data elsewhere.

Where is the flow stored?

  • On the non docker version Starting with the version 1.8.0, the used flow is the dynamic merge of

    • The user flow in \root\userdir\flows.json
    • The Thingbox flows in \root\thethingbox\node_modules\node-red\flow\
    • flows in nodes
  • On the docker version the used flow is the dynamic merge of

    • The user flow in \root\userdir\flows.json
    • The Thingbox flows stored into the docker container thethingbox
    • flows in nodes

Where are the sound files?

  • On the non docker version

    Some sound files are stored into /root/thethingbox/data/sounds/ and you can reach them with samba on \\yourDeviceName\TheThingBox\root\thethingbox\data\sounds\

  • On the docker version

    Some sound files are stored into /root/sounds/ and you can reach them with samba on \\yourDeviceName\TheThingBox\root\sounds\

How does the menu “import / Node” work?

See here.

The log is sent to the console.

The console log is sent to console.txt in the public folder so it can be read by the client browser. There is a menu item in the NodeRED right menu that opens it.

  • On the non docker version


  • On the docker version


At boot, before starting a new console, a backup is done in a file named “previousConsole.txt”. That allows to get an error when the device freezes.

Access it using Samba from your PC:

  • On the non docker version


  • On the docker version


How to use the 1880 port?

  • On the non docker version

    Edit the PORT var in \root\thethingbox\thethingbox.js then run

    service thethingbox restart
  • On the docker version

    Edit the description of thethingbox into the file docker-compose.yml change :

      - 80:80

    to :

      - 1880:80

    then run :

    cd /root
    docker-compose up -d

How to add login/password?

Have a look to alexander blog: “Login for Node-Red on TheThingBox” http://www.vdsar.net/login-for-thethingbox/

I want to use HTTPS to access the Thingbox

Refer to “Use HTTPs”.

How can I access the files in the Thingbox?

The easiest way to access the files is to use your own computer: files are published on the network (using a protocol named Samba).

If this popups:

enter root and raspberry (if you didn’t change them, of course).

  • From Windows: Open a file browser and use


Windows 10 asks you for credentials? Follow the following tutorial to fix your network: https://tinkertry.com/how-to-change-windows-10-network-type-from-public-to-private

and you should see the files.

  • From Macintosh: In the Finder, choose “all” and you should see the device.

How to create a web server beside TheThingBox

See here.

Access the userdir

Access the userdir (non Docker version)


Access the userdir (Docker version)


How to write Node-RED nodes for the Thingbox?

Look here: How to write a Node-RED node for the Thingbox

And here: How to make NPM Packages for The Thingbox

Set your WiFi manually

To set your WiFi manually on TheThingBox, it must be plugged into ethernet. At boot, TheThingBox display its ethernet IP address. In a web browser, enter this address to have the web interface of your TheThingBox.

Via the menu on the top right, click on the ‘settings’ button, then click on the ‘TheThingBox’ tab. On the panel ‘Static IP’, select the interface to ‘WiFi’ and click on the ‘OK’ button. On the panel ‘WiFi’, select the Wi-Fi’s network you want to use and fill its password, then click on the ‘OK’ button.

On the next boot, your TheThingBox should be connected to your WiFi’s network.


As a developement tool for end users, there is no activated security.

Here are the points to be closed if a end user product is built on top.

  • Samba allows access to files from the network
  • SSH is open with root/raspberry credentials
  • NodeRED UI is not protected with credentials
  • [To Be Investigated] The MQTT command tool (should be ok since it uses a double private/public key encryption)
  • The Linux OS login available with root/raspberry credentials
  • The SDCard can be mounted and acceded as a disk in a virtual machine.