Balena sense multi sensor support

Hello,

Can we add BME680 and DS18B20 to balena sense together and plot the readings in to the GUI ? does it support out of the box ?

Regards
AB

Hello,

Out of the box BalenaSense only works with one sensor at a time, and if it finds a bme680 it won’t also take readings from a one-wire sensor like the DS18B20. However, you could modify the sensor.py file (using Python) to get both readings simultaneously. (balena-sense/sensor.py at master · balenalabs/balena-sense · GitHub)

Already done. Thanks anyways.

I have some more questions

  1. Can we have the system restart if it loses connectivity to internet? I found it lost connectivity and I had to pull the plug.

  2. Can the storage of data made cyclic to prevent error of storage getting full?

3 I would like to know what new features you are planning to add into balena sense. Super excited.

Hey again,

  1. Is the device using WiFi or Ethernet? Either way it should automatically reconnect when the network becomes available. If not, then we can look into why that is happening. You could also include the wifi-connect block into your application which would spin up a portal should the device lose it’s net connection.
  2. No, there isn’t an automated mechanism. You can see the state of your storage in the balenaCloud dashboard, and that metric is available via the balena API - so you could automated something yourself if you wanted?
  3. balenaSense is about to be updated to move it to being implemented by blocks - mostly this will not add features, instead moving it into an easier to maintain and extend paradigm. However, I can say that it will include a new block called sensor which will allow you to plug multiple sensors and the data will be pulled through into the grafana dashboard. :slight_smile:

Phil

Hey @phil-d-wilson, hope things are well. Not sure what went wrong, when I have the balena sense running for a while, the device vpn connection is lost. So, I asked if I can have a watch dog healthmonitor that if the connection is not restored for 15 min, the device should restart itself. Could you please suggest ?

  1. I saw that, I asked to know in case anything is available.

  2. I exactly did that, i created a new sensor block and plugged into the docker-compose.

Hi,

Ideally we should get to the bottom of why the device loses it’s VPN connection. Perhaps you could leave it in that state next time, enable support access and ask us to take a look. You can deploy a second device to the same network (if you have one) and we can use it as a gateway to SSH into the affected device.

To answer your question : if you look at the wifi-connect source, you can see how it detects a lose of net connection. You can replicate (or use and extend) that, if you wish, to reboot the device instead of starting the captive portal. The Supervisor API allows you to restart the device, should that help: Interacting with the balena Supervisor - Balena Documentation

I will reproduce the issue and contact you. Thanks for the detailed answer @phil-d-wilson , I already had wificonnect incorporated into my project. Will check and make the changes. The second device could be a Linux laptop on the same local network, or it has to be a balena edge device ?

The second device would have to be a device running balenaOS - so a balena edge device as you mentioned. It won’t help us to debug if it’s a simple linux device.

@anujdeshpande @phil-d-wilson I have my setup ready. I have 2 Balena edge devices in the same application. One with sensors and the other one without. Let me know if you need anything more. I have provided balena support access and the system is in failed state.

Hi @abhatikar - we will need to know the UUIDs of both of the devices, the failed device (target) and the gateway device.

This is the process we use, should you wish to try and work the issue out yourself, or for future reference:

Phil

This morning both nodes were offline. I had to power cycle both of them. I will email you both uuids and notify you when system has failed. At the moment both are running.

Thanks @phil-d-wilson

@abhatikar Did you find any relevant logs related with why the nodes were offline?