# Running balena on the Seeed Studio EdgeBox RPI 200

**URL:** <https://forums.balena.io/t/running-balena-on-the-seeed-studio-edgebox-rpi-200/368000>\
**Category:** Show and Tell\
**Created:** [May 24, 2023, 8:30am UTC](https://forums.balena.io/t/running-balena-on-the-seeed-studio-edgebox-rpi-200/368000 "2023-05-24T08:30:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [May 24, 2023, 8:30am UTC](https://forums.balena.io/t/running-balena-on-the-seeed-studio-edgebox-rpi-200/368000/1 "2023-05-24T08:30:24Z")

</div>

Yesterday I received a new [Seeed Studio EdgeBox RPI 200](https://www.seeedstudio.com/EdgeBox-RPi-200-CM4104016-p-5486.html) that looks perfect to build an industrial IoT edge gateway connecting Modbus Serial sensors using RS485 and RS232 and more.

 ![seed-edgeboxrpi200-balena-outside](https://global.discourse-cdn.com/balena/original/2X/d/d8582544a9762004e992a114677752b40ac15bda.jpeg)

To start playing with it, I decided to use the [N3uron application](https://hub.balena.io/apps/2028505/n3uron) to read the data of the RS485 in the edge.

 ![Add a new device on balenaCloud fleet running N3uron application](https://global.discourse-cdn.com/balena/original/2X/4/4660c121befdab7504b40c92894d8c6a5fb6a0b4.jpeg)

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.

 ![seeed-edgebox-rpi-200-balena-inside](https://global.discourse-cdn.com/balena/original/2X/4/47707d173e93e5e01802d530b19d65f5bca10e1c.jpeg)

To flash the Raspberry Pi CM4 you can use a CM4 IO board such as the official [Raspberry Pi CM4 IO board](https://www.raspberrypi.com/products/compute-module-4-io-board/), the [Waveshare CM4 IO board](https://www.waveshare.com/cm4-io-base-b.htm) that i used or the inexpensive [Nebra CM4 IO board](https://www.nebra.com/products/nebra-raspberry-pi-cm4-flash-stick).

Just flashed balenaOS using balenaEtcher.

Next step will be to power up the device following the instructions from the [User Manual](https://files.seeedstudio.com/wiki/Edge_Box/EdgeBox-RPi-200_Edge_Computing_Controller_User_Manual.pdf) and check if the device works well with the balenaOS CM4 device type OS version.

Stay tunned!

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [May 29, 2023, 6:07pm UTC](https://forums.balena.io/t/running-balena-on-the-seeed-studio-edgebox-rpi-200/368000/2 "2023-05-29T18:07:04Z")

</div>

Today I connected the EdgeBox RPI 200 with a Power Supply (24V) to bring the needed power on a DIN rail to the device.

 ![EdgeBox-RPI200-balena](https://global.discourse-cdn.com/balena/original/2X/1/19c33abbbf9e9e1f6c722c173d38fcec6e3775f1.jpeg)

Now I can see my device online. As i don’t use a WiFi antenna on the EdgeBox RPI200, i need an Ethernet cable to get the device online.

 ![EdgeBox RPI200 running on balena with N3uron app](https://global.discourse-cdn.com/balena/original/2X/0/08b73613fbccd9ea947fff57a9ef3740100f24a1.jpeg)

Next step is to see how to access to the Phoenix Connector GPIO from balenaOS and get the data coming from the Modbus serial sensors connected to it.

Stay tunned!

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [June 12, 2023, 10:58am UTC](https://forums.balena.io/t/running-balena-on-the-seeed-studio-edgebox-rpi-200/368000/3 "2023-06-12T10:58:23Z")

</div>

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.

 ![DT overlays definition on balenaCloud](https://global.discourse-cdn.com/balena/original/2X/9/9a7d6d51ec6ee94dc08e2bd384d5e56a0f5e2e63.png)

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](https://sourceforge.net/projects/edgebox-rpi-200/files/) 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](https://www.seeedstudio.com/RS485-Temperature-and-Humidity-Sensor-p-5235.html) using the RS485 with N3uron on the EdgeBox RPI200 running on balena.

 ![EdgeBox RPI200 and the SeeedStudio Temperature and Humidity Modbus sensor connected](https://global.discourse-cdn.com/balena/original/2X/f/f7d3534708b6edfa363eda62b28af396dca1e35a.jpeg)

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.

Stay tunned!

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [June 12, 2023, 11:33am UTC](https://forums.balena.io/t/running-balena-on-the-seeed-studio-edgebox-rpi-200/368000/4 "2023-06-12T11:33:28Z")

</div>

Remember that we are running [N3uron](https://github.com/n3uron/n3uron-balena) 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/](http://192.168.1.53:8003/)).

 ![N3uron application running on balena](https://global.discourse-cdn.com/balena/original/2X/0/085723c0be6c8069d6f2b2f21a8948106ad17551.jpeg)

Use the credentials `admin` and `n3uron` to access to the N3uron platform.

Click `Config` on the left menu and go to `Modules` on the Explorer menu and click `New Module`.

 ![Add new module on n3uron with balena](https://global.discourse-cdn.com/balena/original/2X/f/fde0c3cf3b106bde1745acb63e345c930c0d2e2c.jpeg)

I called the module `Modbus` and selected the `ModbusClient` type.

 ![Create a new Module on n3uron with balena](https://global.discourse-cdn.com/balena/original/2X/c/cd3b0d2d5ebc19aa9454095f52a580bb800f5461.jpeg)

Now go to the Explorer menu, click `Modbus` and click to create a `New Channel`. I called it `ModbusChannel`.

 ![Create a New Channel on n3uron with balena](https://global.discourse-cdn.com/balena/original/2X/2/2f3d5738a280901ca382d89e01cf9dd695e7f38f.jpeg)

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](https://www.seeedstudio.com/RS485-Temperature-and-Humidity-Sensor-p-5235.html).

 ![Channel and Device created on n3uron with balena](https://global.discourse-cdn.com/balena/original/2X/a/a92ed75085462a98792b0b0e4655f4f36a78e17b.jpeg)

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`.

 ![Temperature tag defined to read from the Modbus address on n3uron and balena](https://global.discourse-cdn.com/balena/original/2X/f/f8344f3dc29caf3fb9466050cc5e2f52b138900d.jpeg)

Afterthat, duplicte the Tag and just change the address to read from the right address, in this case the `40002`.

Go to `Real Time` on the left menu, and you should be able to see the data streaming into the n3uron application.

 ![Real time data from the Modbus sensor on n3uron with balena](https://global.discourse-cdn.com/balena/original/2X/f/f0a94123c67fc3a351cdf019359428527bbe5df8.jpeg)

Next experiments with the Seeed Studio EdgeBox RPI200 will include more data such as the Modbus TCP, send data over MQTT and more.

Stay tunned!
