Yesterday I received a new Seeed Studio EdgeBox RPI 200 that looks perfect to build an industrial IoT edge gateway connecting Modbus Serial sensors using RS485 and RS232 and more.
First of all, I clicked Deploy on balenaHub for the N3uron app and clicked Add a new device. In my case I downloaded the balenaOS image on my laptop.
As it brings a CM4 with eMMC, i just opened it with a screwdriver to get the Raspberry Pi CM4 to flash balenaOS as the main operating system of the SeeedStudio EdgeBox RPI200.
Next step will be to power up the device following the instructions from the User Manual and check if the device works well with the balenaOS CM4 device type OS version.
To access to the Seeed Studio EdgeBox RPI 200 Phoenix Connector GPIO it is needed to update the Device Tree parameters of the default balenaOS image. Luckily, it looks like the Edgebox RPI200 works as a Raspberry Pi with a CM4 with any changes.
The device tree is defined on Define DT overlays as "dwc2","dr_mode=host","w1-gpio". On Define DT parameters for the default overlay. I added the parameter "enable_serial=1".
To know what DT overlay parameters I needed, i downloaded the edgebox RPI200 official image and checked the bcm2711-rpi-cm4.dtb and used the same overlays.
Once the device is restarted, you should be able to access to the /dev/ttyACM0 to read all the data from RS485 devices and /dev/ttyACM1 for RS232 devices connected through the Phoenix Connector.
Now, the device is fully functional and I would like to connect the Seeed Studio Modbus sensor collecting temperature and humitidy using the RS485 with N3uron on the EdgeBox RPI200 running on balena.
To connect the sensor to the power supply on the DIN rail the VCC+ and VCC-. The A and B cables to the RS485 A and B ports of the EdgeBox RPI200 as you can see in the image above.
Next step is to get all the data of the sensor and visualize it.
Remember that we are running N3uron on the Seeed Studio EdgeBox RPI200. And now it’s time to access to the N3uron application to access to the Modbus data generated by the Seeed Studio Temperature and Humidity sensor.
To access to N3uron, copy your local ip address and paste it on a browser using the port 8003 (e.g. http://192.168.1.53:8003/).
As we are connecting a Modbus Serial device, I selected Serial type and then the port name as /dev/ttyACM0 as this sensor is using the RS485. Create a device there, I called it SHT-1 and I left the default parameters as they matched with the parameters from the sensor manual.
Now, we need to create Tags. Go to the Explorer menu on Tags. Create the first tag (e.g. Temperature) and add all the parameters needed. The temperature register from the device is on the address 40001.