How is Node-RED embedded?

We follow the documentation here:

Where do I find the NodeRED settings ?

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: userDirc
		,settingslib: require('/root/thethingbox/settingsttb.js')
		,wpi: require('node-red/node_modules/wiring-pi') //
		,CryptoJS: require('node-red/node_modules/crypto-js') //
		,HID: require('node-red/node_modules/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 ( But those settings are overwritten by thethingbox :

  • uiPort
  • flowFile
  • flowFilePretty
  • userDir
  • httpAdminRoot
  • httpNodeRoot
  • httpNodeCors
  • functionGlobalContext
  • paletteCategories

How can I find its ip address ?

Connect via SSH on your thethingbox. Enter : ifconfig and the ip will be written like that :

inet addr:

How to launch NodeRED manually from the console?

From SSH:

systemctl stop thethingbox.service
cd thethingbox
node thethingbox.js

The Thingbox expands the SDCard at first boot

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

how to ‘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.

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.

How Node-RED is integrated

NodeRED is run following the “Embedding into an existing app” as described in the Node-RED documentation here.

Where is the flow stored?

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

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.


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:


How to use the 1880 port?

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

How to add login/password?

Have a look to alexander blog: “Login for Node-Red on 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).

  • From Windows: Open a file browser and use


Windows 10 asks you for credentials? Follow the following tutorial to fix your network:

and you should see the files.

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

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

Back to top