weatherpi
New Member
Posts: 15
Raspberry Pi: Yes
|
Post by weatherpi on Oct 26, 2017 7:58:02 GMT -8
Good morning.
Working on my second Weather Pi, this one the Grove version. Its running ok'ish. However I am getting periodic errors on the HTU21DF module. Its very sporadic, as the basic functions seem to be reading the sensor just fine.
Command '['htu21dflib/htu21dflib', '-l']' returned non-zero exit status 254 File "/usr/local/lib/python2.7/dist-packages/apscheduler/executors/base.py", line 125, in run_job retval = job.func(*job.args, **job.kwargs) File "GroveWeatherPi.py", line 950, in sampleWeather HTU21DFOut = subprocess.check_output(["htu21dflib/htu21dflib","-l"]) File "/usr/lib/python2.7/subprocess.py", line 573, in check_output raise CalledProcessError(retcode, cmd, output=output)
|
|
|
Post by SDL on Oct 27, 2017 15:34:04 GMT -8
Hmmm. First one on that. Do you have an HTU on your previous WeatherPi? Does it do the same thing?
BP
|
|
weatherpi
New Member
Posts: 15
Raspberry Pi: Yes
|
Post by weatherpi on Nov 1, 2017 6:30:56 GMT -8
That one has been running fine for over a year now. The code is slightly different as its the original version. Its only every now and then that it throws that error. Otherwise it reads the sensor fine.
|
|
|
Post by SDL on Nov 1, 2017 18:10:36 GMT -8
|
|
weatherpi
New Member
Posts: 15
Raspberry Pi: Yes
|
Post by weatherpi on Nov 2, 2017 11:34:20 GMT -8
That's what I was thinking too. I get that error as well, usually when this HTU21DF error throws.
|
|
weatherpi
New Member
Posts: 15
Raspberry Pi: Yes
|
Post by weatherpi on Nov 6, 2017 9:20:55 GMT -8
I've been playing around with the job scheduler limiting what is running. When I run it with just the sampleAndDisplay and patTheDog "jobs" I get no HTU21DF errors nor do I get the sunAirPlus errors from this thread.
forum.switchdoc.com/thread/351/errno-121-remote-error
If I add any of the following jobs: sampleWeather, sampleSunAirPlus, writeWeatherRecord, writePowerRecord I will eventually get both errors. Going through the code of those jobs cleaning them up for my version/install. Will see if that helps any.
|
|
|
Post by SDL on Nov 6, 2017 13:59:40 GMT -8
Yes! That really reinforces my "thread problem" argument. The issue is that occasionally two jobs may be running at the same time and will try to access the shared I2C bus. Something is not working quite right in the OS to allow that to happen correctly. I'm thinking I need to put a semaphore regulating access to the I2C bus to make the software totally "thread safe".
BP
|
|
weatherpi
New Member
Posts: 15
Raspberry Pi: Yes
|
Post by weatherpi on Nov 14, 2017 15:31:20 GMT -8
Changed the code to fit my setup a bit better and use the secondCount loop instead of apscheduler. Running a lot better, no HTU errors, no AM2315 temp = 0.0 C, no SunAirPlus errors, No DS3231 errors. Eventually those jobs are on a collision course. I do like the scheduler though because if something does error it still keeps running the code.
|
|
|
Post by SDL on Nov 14, 2017 15:44:24 GMT -8
More proof for my theory. What we are going to do is set up a semaphore to regulate the I2C bus usage. That will take care of the collisions.
BP
|
|
weatherpi
New Member
Posts: 15
Raspberry Pi: Yes
|
Post by weatherpi on Nov 15, 2017 5:10:35 GMT -8
Awesome to hear. Thanks for the update.
|
|