# Balena sense multi sensor support

**URL:** <https://forums.balena.io/t/balena-sense-multi-sensor-support/277373>\
**Category:** balenaSense\
**Tags:** support, raspberrypi3\
**Created:** [March 24, 2021, 10:15am UTC](https://forums.balena.io/t/balena-sense-multi-sensor-support/277373 "2021-03-24T10:15:58Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhatikar](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@abhatikar](https://forums.balena.io/u/abhatikar)\
**Post date:** [March 24, 2021, 10:15am UTC](https://forums.balena.io/t/balena-sense-multi-sensor-support/277373/1 "2021-03-24T10:15:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![alanb128](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/alanb128/32/2839_2.png) [@alanb128](https://forums.balena.io/u/alanb128)\
**Post date:** [March 25, 2021, 1:29am UTC](https://forums.balena.io/t/balena-sense-multi-sensor-support/277373/3 "2021-03-25T01:29:46Z")

</div>

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](https://github.com/balenalabs/balena-sense/blob/master/sensor/scripts/sensor.py))

---

<div class="post-metadata">

**Author:** ![abhatikar](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@abhatikar](https://forums.balena.io/u/abhatikar)\
**Post date:** [March 26, 2021, 8:17am UTC](https://forums.balena.io/t/balena-sense-multi-sensor-support/277373/5 "2021-03-26T08:17:15Z")

</div>

Already done. Thanks anyways.

 ![IMG_20210326_081400](https://global.discourse-cdn.com/balena/original/2X/a/ac3fd5f22f561c28e1ff40935d673cfcf59c1361.jpeg)

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.

---

<div class="post-metadata">

**Author:** ![phil-d-wilson](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/phil-d-wilson/32/3730_2.png) [@phil-d-wilson](https://forums.balena.io/u/phil-d-wilson)\
**Post date:** [March 29, 2021, 2:29pm UTC](https://forums.balena.io/t/balena-sense-multi-sensor-support/277373/6 "2021-03-29T14:29:05Z")

</div>

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](https://github.com/balenablocks/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](https://www.balena.io/blog/introducing-balenablocks-jumpstart-your-iot-app-development/) - 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. 🙂

Phil

---

<div class="post-metadata">

**Author:** ![abhatikar](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@abhatikar](https://forums.balena.io/u/abhatikar)\
**Post date:** [March 29, 2021, 2:45pm UTC](https://forums.balena.io/t/balena-sense-multi-sensor-support/277373/8 "2021-03-29T14:45:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![phil-d-wilson](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/phil-d-wilson/32/3730_2.png) [@phil-d-wilson](https://forums.balena.io/u/phil-d-wilson)\
**Post date:** [March 29, 2021, 3:38pm UTC](https://forums.balena.io/t/balena-sense-multi-sensor-support/277373/9 "2021-03-29T15:38:48Z")

</div>

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](https://www.balena.io/docs/reference/supervisor/supervisor-api/#post-v1reboot)

---

<div class="post-metadata">

**Author:** ![abhatikar](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@abhatikar](https://forums.balena.io/u/abhatikar)\
**Post date:** [March 29, 2021, 4:04pm UTC](https://forums.balena.io/t/balena-sense-multi-sensor-support/277373/11 "2021-03-29T16:04:34Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![anujdeshpande](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/anujdeshpande/32/3155_2.png) [@anujdeshpande](https://forums.balena.io/u/anujdeshpande)\
**Post date:** [March 30, 2021, 6:27am UTC](https://forums.balena.io/t/balena-sense-multi-sensor-support/277373/12 "2021-03-30T06:27:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![abhatikar](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@abhatikar](https://forums.balena.io/u/abhatikar)\
**Post date:** [April 5, 2021, 2:58pm UTC](https://forums.balena.io/t/balena-sense-multi-sensor-support/277373/14 "2021-04-05T14:58:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![phil-d-wilson](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/phil-d-wilson/32/3730_2.png) [@phil-d-wilson](https://forums.balena.io/u/phil-d-wilson)\
**Post date:** [April 6, 2021, 3:07pm UTC](https://forums.balena.io/t/balena-sense-multi-sensor-support/277373/15 "2021-04-06T15:07:26Z")

</div>

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:

> **[balena-io/debugging-masterclass - 4. Accessing a Device using a Gateway Device](https://github.com/balena-io/debugging-masterclass#4-accessing-a-device-using-a-gateway-device)**
>
> A guide to debugging balena device issues. Contribute to balena-io/debugging-masterclass development by creating an account on GitHub.

Phil

---

<div class="post-metadata">

**Author:** ![abhatikar](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@abhatikar](https://forums.balena.io/u/abhatikar)\
**Post date:** [April 6, 2021, 4:05pm UTC](https://forums.balena.io/t/balena-sense-multi-sensor-support/277373/17 "2021-04-06T16:05:17Z")

</div>

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

---

<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:** [April 7, 2021, 8:46am UTC](https://forums.balena.io/t/balena-sense-multi-sensor-support/277373/19 "2021-04-07T08:46:49Z")

</div>

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