Serial Communication (Node-Red ~ TPS)
Serial Tibbit #02
Connector Tibbit #19
Power Tibbit #09 and #18
Router for Network LAN
TPP2-G2 TiOS firmware (3.80.18)
TDST (Tibbo Device Server Toolkit)
TIDE (Tibbo Integrated Development Environment)
Virtual Machine Node-Red installed (Virtual Box)
Additional modules in Node-Red “serialport”
- Install Node-Red in VM and add additional modules like “serialport”
- Upload the TiOS firmware in TPP2G2 board
- Download the basic project from CODY
- Add logic to your project using TIDE
- Create the flow in Node-Red
Install Node-Red in VM and add additional modules like “Dashboard”
To install Node-Red on a Linux machine you need to have node.js support
sudo npm install -g --unsafe-perm node-red
npm i node-red-node-serialport
More information on the web links below:
Upload the TiOS firmware in TPP2G2 board
You can download the TDST and TPP2G2 firmware from the Tibbo website, weblink is shared below
Install the TDST on your PC and access Device Explorer to get the visibility of the Tibbo devices in your LAN.
Add the Tibbits to the TPP2G2 board on the respective sockets.
Connect the TPP2G2 board to LAN and power the board.
To upload the firmware, click on “Upload” and use the LAN network to transfer the file.
Download the basic project file from CODY
Use CODY to build the configuration and download the project to your PC.
Enable DHCP or keep the Static IP addressing as per your requirements on the Ethernet connection.
Set the Serial COM port parameters, for demonstration purposes I use Tibbit#02 and RS232.
Parameters are 115200-8N1(RTS/CTS)
Add logic to your project using TIDE
Add the logic on the serial side of communication.
ser_data_arrival function is used when Node-Red sends the data to TPS, print the data on TPS console output to verify.
Add the logic when you send the data from TPS to Node-Red, for demonstration purposes I used the on_button_pressed function.
Create the flow in Node-Red
Access the Node-Red in Chrome using the VM IP (http://VM-IP:1880) and port 1880.
You will need the nodes like “Inject”, “serial in”, “serial out” and “debug”.
“debug” node is used to display the serial data coming from TPS.
“inject” node is used to send data to TPS.
But to achieve the data flow, you need to create the serial COM port in Node-Red.
“Inject” node properties:
I just inserted the data in “string” format for demonstration purposes.
Data will send an interval of every 5 seconds to TPS.
“debug” node properties:
Serial COM Port properties:
I enabled the flow control, make the changes accordingly to RTS and CTS lines in Node-Red COM port, connect the USB-to-Serial cable to the PC (Node-Red) using USB-Serial connector cable (drivers installed).
Node-Red will recognize the COM port as you connect the serial, the only thing you need to do is to set the parameters Baudrate, Data bits, Parity and Stop bits to match with what you did in TPS for uninterrupted data flow.
Results of the Project: