balenaSense + Pi3B+ + Sense Hat = no pressure readings

Just set up a balenaSense instance and my Sense Hat is not reporting pressure. This is the Sense Hat I ordered: https://www.amazon.com/gp/product/B07XGFG8MF/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1

How can i test this from the terminal?

Is it an official Raspberry Pi Sense HAT or a clone?

The Sense HAT uses an LPS25H pressure sensor on i2c address 0x5c. If you run balena run --rm -it --privileged balenalib/raspberry-pi-debian:latest i2cdetect -y 1 from the host OS command line and see an output like this (which includes 0x5c) then you should be good to go:

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- 1c -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- UU -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- 5c -- -- 5f
60: -- -- -- -- -- -- -- -- -- -- 6a -- -- -- -- --
70: -- -- -- -- -- -- -- --

If not then it’s probably a faulty device.

James.

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- 1c -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- UU -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- 5c -- -- 5f 
60: -- -- -- -- -- -- -- -- -- -- 6a -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

This is the output of that command on my Pi. It is identical to yours, but my Pressure display shows “No Data”.

Hey @etrigan63 welcome to the forums and thanks for trying the balenaSense project!

Right now, the project does not support pressure readings from the Sense-HAT, as it requires a lot of dependencies to use that we didn’t want to include in the image. Instead of installing the full Sense-HAT library, we only install support for the specific sensors on the board, and there wasn’t an obvious candidate for the LPS25H pressure sensor at the time, so it was omitted.

You could try going back to version v1.0.4 which uses the full Sense-HAT library and may work OK for you; a lot of the later changes have been developments for other sensors. You can download that version here: https://github.com/balenalabs/balena-sense/releases/tag/v1.0.4

If that version does not work I’d recommend looking at either adding the LPS25H support (this snippet may help), or editing your local copy of the application to install the full Sense-HAT library again. You can see where it’s commented out in the code here: https://github.com/balenalabs/balena-sense/blob/master/sensor/scripts/sense_hat_air_quality.py#L93

I hope this helps!

I edited the local copy and when I saved it, it was promptly replaced by the copy on the server.

Hi, can you describe exactly what you edited and how it was replaced? Did you balena push the updated code to your device?

Logged on the the sensor container.
nano the sense-hat python script
edit the code
save the code
code is replaced by server.

If you tell me to “edit the code locally”, that is what I interpret this as.
I am old-school IT. Been at it for 35 years.

Can you edit the local version of the file on your development machine (the one you initially downloaded the balenaSense project to), make the change there and then use the same balena push to deploy the modified code to the device. That should resolve any issues that you have.

OK that worked but this is what I get in the Console:

File "/usr/src/app/scripts/sense_hat_air_quality.py", line 93, in get_readings
28.02.20 17:28:00 (-0500)  sensor      'pressure': float(sensor.environ.pressure),
28.02.20 17:28:00 (-0500)  sensor  AttributeError: 'HTS221' object has no attribute 'environ'

Can you confirm the changes you made to the project before pushing? Did you just uncomment the line here https://github.com/balenalabs/balena-sense/blob/master/sensor/scripts/sense_hat_air_quality.py#L93 as from my reading of the thread you will also need to install the full Sense-HAT library again to get that to work.

Yes, I un-commented the line.
No, I did not install the libraries. Where are said libraries and how do I install them?

Hi
So after you made the change on your development machine, did you do a balena push to the raspberry pi?
That way there’s a new container with the updated library that gets deployed on the Pi.

I changed the code and used balena push and the device is still not reporting as I do not have the libraries and no one has told me how to do that. This is not documented anywhere and not intuitive. Any links to instructions on deploying the libraries?

Hi,

This thread seems to be going off the rails, so I thought it best we get back to a baseline before trying to assist further.

Containers are ephemeral, meaning that if they restart then any changed content that isn’t mounted into them via a volume or host bind will be lost. This is what you saw when you made changes on the device directly, and isn’t the way to work with balenaOS/balenaCloud. The workflow is always to push the source to our builder, have the images built from those sources, and then the image artifacts are delivered to the device to be run. This is what balena push ... is doing. This process creates a new release in your balenaCloud application and devices run one of these releases.

Looking back through this thread, it seems that the initial solution is to pull the v1.0.4 release which my colleague linked above; I suggest that you extract this release into a new directory and do a balena push ... from their to create a new balenaCloud release for that version. It should be delivered to your device (can be confirmed by the release ID returned from the push command, matching the release on the device’s info page on the dashboard)

Once you can confirm that the raw, untouched version 1.0.4 is running on your device, then I think we can pursue this further :+1:

No joy with v1.04. Fails to deploy.

[sensor]    You are using pip version 19.0.1, however version 20.0.2 is available.
[sensor]    You should consider upgrading via the 'pip install --upgrade pip' command.
[sensor]    
[sensor]    Removing intermediate container ccd05cd3a90c
[sensor]     ---> 271a623f3428
[sensor]    Step 8/11 : WORKDIR /usr/src/app
[sensor]     ---> Running in 947bc57903d5
[sensor]    Removing intermediate container 947bc57903d5
[sensor]     ---> 59efc7f8d265
[sensor]    Step 9/11 : COPY ./scripts ./scripts
[sensor]     ---> f93fe3f02b76
[sensor]    Step 10/11 : RUN chmod +x scripts/*.py
[sensor]     ---> Running in dd9d06314761
[sensor]    Removing intermediate container dd9d06314761
[sensor]     ---> f1160d43cfe3
[sensor]    Step 11/11 : CMD /usr/src/app/scripts/take_measurement.py
[sensor]     ---> Running in 6c4c0af51905
[sensor]    Removing intermediate container 6c4c0af51905
[sensor]     ---> 057d73719dcf
[sensor]    Successfully built 057d73719dcf
[Info]      Uploading images
[Success]   Successfully uploaded images
[Error]     Some services failed to build:
[Error]       Service: influxdb
[Error]         Error: The command '/bin/sh -c sed -i 's|/var/lib/influxdb|/data/influxdb|g' /etc/influxdb/influxdb.conf' returned a non-zero code: 1
[Info]      Built on arm03
[Error]     Not deploying release.
Remote build failed

Additional information may be available by setting a DEBUG=1 environment
variable: "set DEBUG=1" on a Windows command prompt, "$env:DEBUG = 1" on
powershell, or "export DEBUG=1" on Linux or macOS.

If you need help, don't hesitate in contacting our support forums at
https://forums.balena.io

For CLI bug reports or feature requests, have a look at the GitHub issues or
create a new one at: https://github.com/balena-io/balena-cli/issues/

(node:24790) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

Can you show the log output for the influxdb service? We can see the summary, but it would be good to understand why the command failed, which may be in more detail above :+1:

Also, are you running on Windows/MacOS or Linux?

Thanks.

influxdb 2020-03-02T19:15:44.882081Z info Starting continuous query service {“log_id”: “0LJAeLn0000”, “service”: “continuous_querier”}
02.03.20 14:15:44 (-0500) influxdb 2020-03-02T19:15:44.882380Z info Starting HTTP service {“log_id”: “0LJAeLn0000”, “service”: “httpd”, “authentication”: false}
02.03.20 14:15:44 (-0500) influxdb 2020-03-02T19:15:44.882670Z info opened HTTP access log {“log_id”: “0LJAeLn0000”, “service”: “httpd”, “path”: “stderr”}
02.03.20 14:15:44 (-0500) influxdb 2020-03-02T19:15:44.883609Z info Storing statistics {“log_id”: “0LJAeLn0000”, “service”: “monitor”, “db_instance”: “_internal”, “db_rp”: “monitor”, “interval”: “10s”}
02.03.20 14:15:44 (-0500) influxdb 2020-03-02T19:15:44.884500Z info Listening on HTTP {“log_id”: “0LJAeLn0000”, “service”: “httpd”, “addr”: “[::]:8086”, “https”: false}
02.03.20 14:15:44 (-0500) influxdb 2020-03-02T19:15:44.884990Z info Starting retention policy enforcement servic{“log_id”: “0LJAeLn0000”, “service”: “retention”, “check_interval”: “30m”}
02.03.20 14:15:44 (-0500) influxdb 2020-03-02T19:15:44.886136Z info Listening for signals {“log_id”: “0LJAeLn0000”}
02.03.20 14:15:44 (-0500) influxdb 2020-03-02T19:15:44.886195Z info Sending usage statistics to usage.influxdata.com {“log_id”: “0LJAeLn0000”}

I am running Manjaro Linux

Hi, I took a closer look at the error you received and it looks like the location of the influxdb.conf file has moved since version 1.04 was released. It’s a simple fix though. Just go into the influxdb folder of the repository on your development machine with a text editor and change the line RUN sed -i 's|/var/lib/influxdb|/data/influxdb|g' /etc/influxdb/influxdb.conf to RUN sed -i 's|/var/lib/influxdb|/data/influxdb|g' /etc/influxdb.conf (essentially just removing the extra influxdb/ folder from the destination part of the command.) Save the file, go back to the repository root folder then push again from the balena CLI. Let us know if you get a successful build of this version.

OK that worked, but my barometric pressure readings are oddly high and my temp offset is not being recognized.