balenalabs / balena-sense services are not starting

Thanks a lot for the product it looks very promising.
I’ve start my journey with balenalabs / balena-sense guided by https://www.balena.io/blog/build-an-environment-and-air-quality-monitor-with-raspberry-pi and had no issues to push the code to my Raspberry Pi. In a while all services were downloaded and installation was kicked off.
But only grafana and mqtt were started. the others are still displayed as Downloaded.

There are no logs for influxdb.

Telegraph expectedly fails as can’t connect to Influx:
14.03.20 19:06:17 (+0100) telegraf 2020-03-14T18:06:17Z W! [outputs.influxdb] when writing to [http://influxdb:8086]: database “balena-sense” creation failed: Post http://influxdb:8086/query: dial tcp 172.17.0.4:8086: connect: connection refused
14.03.20 19:06:20 (+0100) telegraf 2020-03-14T18:06:20Z E! [inputs.http] Error in plugin: [url=http://sensor]: Get http://sensor: dial tcp 172.17.0.5:80: connect: connection refused

Sensor logs say:
14.03.20 19:06:26 (+0100) sensor ================ Starting Balena Sense ================
14.03.20 19:07:02 (+0100) sensor Enviro Plus hat not found
14.03.20 19:07:03 (+0100) sensor Sensor HTTP server running
14.03.20 19:07:10 (+0100) sensor 172.17.0.6 - - [14/Mar/2020 18:07:10] “GET / HTTP/1.1” 200 -
14.03.20 19:07:10 (+0100) sensor ----------------------------------------
14.03.20 19:07:10 (+0100) sensor Exception happened during processing of request from (‘172.17.0.6’, 42606)
14.03.20 19:07:10 (+0100) sensor Traceback (most recent call last):
14.03.20 19:07:11 (+0100) sensor File “/usr/local/lib/python3.5/socketserver.py”, line 313, in _handle_request_noblock
14.03.20 19:07:11 (+0100) sensor self.process_request(request, client_address)
14.03.20 19:07:11 (+0100) sensor File “/usr/local/lib/python3.5/socketserver.py”, line 341, in process_request
14.03.20 19:07:11 (+0100) sensor self.finish_request(request, client_address)
14.03.20 19:07:11 (+0100) sensor File “/usr/local/lib/python3.5/socketserver.py”, line 354, in finish_request
14.03.20 19:07:11 (+0100) sensor self.RequestHandlerClass(request, client_address, self)
14.03.20 19:07:11 (+0100) sensor File “/usr/local/lib/python3.5/socketserver.py”, line 681, in init
14.03.20 19:07:11 (+0100) sensor self.handle()
14.03.20 19:07:11 (+0100) sensor File “/usr/local/lib/python3.5/http/server.py”, line 422, in handle
14.03.20 19:07:11 (+0100) sensor self.handle_one_request()
14.03.20 19:07:11 (+0100) sensor File “/usr/local/lib/python3.5/http/server.py”, line 410, in handle_one_request
14.03.20 19:07:11 (+0100) sensor method()
14.03.20 19:07:11 (+0100) sensor File “/usr/src/app/scripts/sensor.py”, line 118, in do_GET
14.03.20 19:07:11 (+0100) sensor measurements = balenasense.sample()
14.03.20 19:07:11 (+0100) sensor File “/usr/src/app/scripts/sensor.py”, line 90, in sample
14.03.20 19:07:11 (+0100) sensor return self.apply_offsets(self.sensor.get_readings(self.sensor))
14.03.20 19:07:11 (+0100) sensor AttributeError: ‘balenaSense’ object has no attribute ‘sensor’
14.03.20 19:07:11 (+0100) sensor ----------------------------------------

Can you please suggest how these can be fixed?
I’ve tried to reboot device and re-push the code. Still the same.

I’m running application: 638f5fb841786ade699164d1d38707da
with balenaOS 2.46.1+rev1 on Raspberry Pi1B
balena-sense 1.9.0

Hi,

Can you please share with us your device UUID and grant support access so we can have a look at your device?

Hi,

I have the same issue.
I followed this:

I tried two devices.
a raspberry pi zero w - i don’t get any sensor data at all
and a
raspberry pi 4 (4GB) - where I do get the exact same issue as described above.

Could you please assist?
UUID is 4a17d88f40c07b9be52694ebf0a0d654
access granted

Thanks! :upside_down_face:
Kind Regards,
Descents

edit:
add UUID and the this:

18.03.20 20:05:00 (+0100) sensor 172.17.0.4 - - [18/Mar/2020 19:05:00] “GET / HTTP/1.1” 200 -
18.03.20 20:05:00 (+0100) sensor ----------------------------------------
18.03.20 20:05:00 (+0100) sensor Exception happened during processing of request from (‘172.17.0.4’, 36720)
18.03.20 20:05:00 (+0100) sensor Traceback (most recent call last):
18.03.20 20:05:00 (+0100) sensor File “/usr/local/lib/python3.5/socketserver.py”, line 313, in _handle_request_noblock
18.03.20 20:05:00 (+0100) sensor self.process_request(request, client_address)
18.03.20 20:05:00 (+0100) sensor File “/usr/local/lib/python3.5/socketserver.py”, line 341, in process_request
18.03.20 20:05:00 (+0100) sensor self.finish_request(request, client_address)
18.03.20 20:05:00 (+0100) sensor File “/usr/local/lib/python3.5/socketserver.py”, line 354, in finish_request
18.03.20 20:05:00 (+0100) sensor self.RequestHandlerClass(request, client_address, self)
18.03.20 20:05:00 (+0100) sensor File “/usr/local/lib/python3.5/socketserver.py”, line 681, in init
18.03.20 20:05:00 (+0100) sensor self.handle()
18.03.20 20:05:00 (+0100) sensor File “/usr/local/lib/python3.5/http/server.py”, line 422, in handle
18.03.20 20:05:00 (+0100) sensor self.handle_one_request()
18.03.20 20:05:00 (+0100) sensor File “/usr/local/lib/python3.5/http/server.py”, line 410, in handle_one_request
18.03.20 20:05:00 (+0100) sensor method()
18.03.20 20:05:00 (+0100) sensor File “/usr/src/app/scripts/sensor.py”, line 118, in do_GET
18.03.20 20:05:00 (+0100) sensor measurements = balenasense.sample()
18.03.20 20:05:00 (+0100) sensor File “/usr/src/app/scripts/sensor.py”, line 90, in sample
18.03.20 20:05:00 (+0100) sensor return self.apply_offsets(self.sensor.get_readings(self.sensor))
18.03.20 20:05:00 (+0100) sensor AttributeError: ‘balenaSense’ object has no attribute ‘sensor’
18.03.20 20:05:00 (+0100) sensor ----------------------------------------
18.03.20 20:05:10 (+0100) sensor 172.17.0.4 - - [18/Mar/2020 19:05:10] “GET / HTTP/1.1” 200 -
18.03.20 20:05:10 (+0100) sensor ----------------------------------------
18.03.20 20:05:10 (+0100) sensor Exception happened during processing of request from (‘172.17.0.4’, 36724)
18.03.20 20:05:10 (+0100) sensor Traceback (most recent call last):
18.03.20 20:05:10 (+0100) sensor File “/usr/local/lib/python3.5/socketserver.py”, line 313, in _handle_request_noblock
18.03.20 20:05:10 (+0100) sensor self.process_request(request, client_address)
18.03.20 20:05:10 (+0100) sensor File “/usr/local/lib/python3.5/socketserver.py”, line 341, in process_request
18.03.20 20:05:10 (+0100) sensor self.finish_request(request, client_address)
18.03.20 20:05:10 (+0100) sensor File “/usr/local/lib/python3.5/socketserver.py”, line 354, in finish_request
18.03.20 20:05:10 (+0100) sensor self.RequestHandlerClass(request, client_address, self)
18.03.20 20:05:10 (+0100) sensor File “/usr/local/lib/python3.5/socketserver.py”, line 681, in init
18.03.20 20:05:10 (+0100) sensor self.handle()
18.03.20 20:05:10 (+0100) sensor File “/usr/local/lib/python3.5/http/server.py”, line 422, in handle
18.03.20 20:05:10 (+0100) sensor self.handle_one_request()
18.03.20 20:05:10 (+0100) sensor File “/usr/local/lib/python3.5/http/server.py”, line 410, in handle_one_request
18.03.20 20:05:10 (+0100) sensor method()
18.03.20 20:05:10 (+0100) sensor File “/usr/src/app/scripts/sensor.py”, line 118, in do_GET
18.03.20 20:05:10 (+0100) sensor measurements = balenasense.sample()
18.03.20 20:05:10 (+0100) sensor File “/usr/src/app/scripts/sensor.py”, line 90, in sample
18.03.20 20:05:10 (+0100) sensor return self.apply_offsets(self.sensor.get_readings(self.sensor))
18.03.20 20:05:10 (+0100) sensor AttributeError: ‘balenaSense’ object has no attribute ‘sensor’
18.03.20 20:05:10 (+0100) sensor ----------------------------------------
18.03.20 20:05:20 (+0100) sensor 172.17.0.4 - - [18/Mar/2020 19:05:20] “GET / HTTP/1.1” 200 -
18.03.20 20:05:20 (+0100) sensor ----------------------------------------
18.03.20 20:05:20 (+0100) sensor Exception happened during processing of request from (‘172.17.0.4’, 36726)
18.03.20 20:05:20 (+0100) sensor Traceback (most recent call last):
18.03.20 20:05:20 (+0100) sensor File “/usr/local/lib/python3.5/socketserver.py”, line 313, in _handle_request_noblock
18.03.20 20:05:20 (+0100) sensor self.process_request(request, client_address)
18.03.20 20:05:20 (+0100) sensor File “/usr/local/lib/python3.5/socketserver.py”, line 341, in process_request
18.03.20 20:05:20 (+0100) sensor self.finish_request(request, client_address)
18.03.20 20:05:20 (+0100) sensor File “/usr/local/lib/python3.5/socketserver.py”, line 354, in finish_request
18.03.20 20:05:20 (+0100) sensor self.RequestHandlerClass(request, client_address, self)
18.03.20 20:05:20 (+0100) sensor File “/usr/local/lib/python3.5/socketserver.py”, line 681, in init
18.03.20 20:05:20 (+0100) sensor self.handle()
18.03.20 20:05:20 (+0100) sensor File “/usr/local/lib/python3.5/http/server.py”, line 422, in handle
18.03.20 20:05:20 (+0100) sensor self.handle_one_request()
18.03.20 20:05:20 (+0100) sensor File “/usr/local/lib/python3.5/http/server.py”, line 410, in handle_one_request
18.03.20 20:05:20 (+0100) sensor method()
18.03.20 20:05:20 (+0100) sensor File “/usr/src/app/scripts/sensor.py”, line 118, in do_GET
18.03.20 20:05:20 (+0100) sensor measurements = balenasense.sample()
18.03.20 20:05:20 (+0100) sensor File “/usr/src/app/scripts/sensor.py”, line 90, in sample
18.03.20 20:05:20 (+0100) sensor return self.apply_offsets(self.sensor.get_readings(self.sensor))
18.03.20 20:05:20 (+0100) sensor AttributeError: ‘balenaSense’ object has no attribute ‘sensor’
18.03.20 20:05:20 (+0100) sensor ----------------------------------------

Hi @eugen.kolesnik & @Descents.

I checked in with our balenaLabs team and they pointed out that they recently released some updates to the balenaSense project, so asked that you try and older version to see if we’ve introduced a regression.

Can you please checkout the previous release tag (v1.8.3) and push that version of the code to your devices?

In case you need assistance, here’s a step-by-step guide:

  1. On your local workstation, change working directory into your local checkout of the balenaSense project.
  2. Checkout the release tag git checkout v1.8.3 - you will get a lengthy warning about being in a detached-head state. You can always go back to master by running git checkout master if you need to.
  3. Run balena push to push the currently checked-out version to your device.

Additionally, can you please tell us what sensor you’re using and how you have it physically connected?

Thanks,
James.

Hi James,

thanks for the help.
I installed v1.8.3 and now the sensor is working!

I’m using a BME680 (6-Pin, like this one on Amazon: https://amzn.to/2QtHe57 )

on the raspberry 4 it worked like a charm, but on the zero I had to reinstall the OS - for some reason the zero did not boot again - As I just started out with this setup I did not mind and I’m afraid I can’t be of any help as of why it did not boot again.

Anyhow after it’s back up and setup with v1.8.3 on it it does read the sensor correct as well.
(same sensor on both pis)

Thanks,
Descents

@eugen.kolesnik and @Descents thanks so much for trying the project and for taking the time to sign up to the forums to let us know about the issue, we really appreciate that.

We’ve now deployed a fix that should resolve this for you going forward, it’s available in v1.9.1 and up.

@chrisys
A BIG THANK YOU to you and the team for the fast solution!

I just tried and pushed the update. It took some time for the pi to start up and connect again to the cloud but now the sensor does read and everything does look good!

just one more thing about the preassure reading and the offset - ab I supposed to enter the Offset in meters above sealevel or should i calculate the offset in mbar?

@Descents you’re welcome!

With regard to the offsets, the docs are here but the tl;dr is that for temperature and humidity the offset is in celcius and %RH respectively. For the pressure sensor you don’t set an offset but rather use the BALENASENSE_ALTITUDE variable with your elevation above sea level in metres. :+1: