Hello friends,
First of all the obligatory thank-you for all the work I've consumed and used in this community, even without being active at all. I learned quite something already
The tl'dr: When using bme280.load_calibration_params(..) the plugin stops running without warning. Same script works when called via source oprint / python __init__
.
Now onto the long version of the challenge which I'n struggling with:
Goal:
Have a plugin which reads data from a bme280 sensor connected via I2c in the navbar.
What I did:
I created a standalone python script which pulled a bme280 sensor on a raspberry pi 3b running octopi correctly.
Then I basically went through the intro tutorial and some repositories* and created my very first plugin (github link). In the repo is an example log output (example_log.txt), too.
The problem:
In short, I'm out of ideas. I've put several debug warnings in the __init__.py
- the plugin simply stops running, I don't get any errors, other warnings or anything. The magic part of the code is:
self._logger.warning("now I'm running ..")
(use bme280 library)
self._logger.warning("now I'm dead. This log info does not appear.")
Soon, I realized that I can't manage to pull data from the sensor - but only when running the plugin code through octoprint. As soon as I call the modules via console, everything works like a charm and I see the data:
source ~/oprint/bin/activate
python [path-to]/__init__.py
Versions Info:
Python: 2.7.16 OctoPrint 1.4.0rc3 OctoPi 0.17 RPi.bme280 0.2.8
What I'm hoping for is a hint on how to continue debugging and/or how to fix my issue. I have simply no idea on what to even try, I've reduced it to one line of code - with it, it breaks and without it, it doesn't work.
Thanks in advance,
Georg
github . com /jneilliii/OctoPrint-M117NavBar
github . com /Renaud11232/OctoPrint-Resource-Monitor