Realise I am very late to this party - a bad link on switchdoc.com had me believing the forum was dead...
Can confirm that rebooting my Pi does not solve the problem with AM2315, but power cycle does. However: Power cycle also seems to (at least sometimes) solve another problem I have, namely that of sunlight sensor returning 0 values. Can these problems somehow be related?
For what it is worth, my offer of VPN access to the device still stands - I can set up either L2TP/IPSec, PPTP, or OpenVPN access for you (previous access was revoked for security purposes, but can be reinstated). The RPi receives power over ethernet - I can even give you access to the switch, so you can cold reboot if required. The only problem now would be the fact that the Pi is installed outside, so you will probably access it during our night time - may be a problem with the sunlight sensor, but the IR should pick up something.
I apologise if I am just filling up this thread with irrelevant posts - please move / delete / create a new thread as appropriate.
On initial setup a few months ago, I connected the light sensor directly (without the multiplexer) to confirm that it was not in fact DOA - it worked without the multiplexer.
During attempted debugging a few days ago (wired as per instructions, using multiplexer) I tried inserting a sleep command after switching the Multiplexer to Bus 3, but before reading values (working on a thought that this may be a timing issue). This caused a Remote IO error to be raised (to me this looked exactly like the errors you see when trying to read from a non-existing I2C device).
This leads to my question:
In the absence of I2C address conflicts, would it not perhaps be worthwhile removing the multiplexer from the device? I would however need advice on how to rewire the system...
I just now removed the multiplexer. So far the AM2315 seems to work fine, but I will be keeping an eye on it for the next 24 hours before I can be sure. The sunlight sensor initially returned 0 values. I opened another command line window and ran 'simpletest.py' in the SI1145 subdirectory, which gave me realistic values. Interesting thing though: suddenly GroveWeatherPi.py started returning values as well! A few minutes later the main routine started reporting 0 values again, but recovered when I ran simpletest again.
Interesting data point. At least I can start narrowing down what is going on with my system. Also, I now have a way to force the sunlight sensor to return values if I cannot find the problem in the groveweatherpi.py - just keep running simpletest in the background.
Last Edit: Dec 21, 2018 23:07:41 GMT -8 by hvrooyen: grammar, clarity
Some more info: I must have missed a command somewhere when trying to pull the latest version. You may have noticed that I had been running V3.02 above. However:
After upgrading to V3.12 (with multiplexer removed) nothing worked - weather board, thunder board, AM2315, Sunlight - all not present.
So I ran V3.02 of GroveWeatherPi.py again. Everything (except thunderboard) is picked up, but Sunlight sensor gives 0 values - until I run simpletest.py, then GroveWeatherPi reports values again. The only problem is that after a few hours I run into the debounce issue again.
I realise that assembly instructions include use of the multiplexer, but the code does not assume its presence and I can at least get usable weather information without it (it seems I don't need it - except maybe for the thunderboard?). It also seems to me there is useful debugging info in here somewhere.
Output - notice the initial result from as3935, then nothing:
[email protected]:~/SDL_Pi_GroveWeatherPi $ sudo python GroveWeatherPi312.py visible= 0 as3935 present at 0x02 outsideTemperature: 29.0 C outsideHumidity: 31.0 % crc: 0x-1
GroveWeatherPi Solar Powered Weather Station Version 3.12 - SwitchDoc Labs
Program Started at:2018-12-23 09:16:32
---------------------- I2C Mux - TCA9545: Present BMP280: Present DS3231: Present HDC1080: Not Present HTU21DF: Not Present AM2315: Not Present ADS1015: Not Present ADS1115: Present AS3935: Present OLED: Not Present SunAirPlus: Not Present Sunlight Sensor: Present WXLink: Not Present
UseBlynk: Not Present UseMySQL: Present Check WLAN: Not Present WeatherUnderground: Not Present ---------------------- ----------------- Sample and Display ----------------- ----------------- Weather Sampling ----------------- ----------------- ----------------- SunAirPlus Not Present ----------------- ----------------- ----------------- ----------------- Raspberry Pi= 2018-12-23 09:16:35 DS3231= 2018-12-23 09:16:35 DS3231 Temperature= 31.00 C ----------------- AS3935 Lightning Detector ----------------- Last result from AS3935: ----No Lightning detected--- Lightning Count = 0 ----------------- ----------------- Sample and Display Done ----------------- ----------------- Scheduled Jobs .....
From there on forward the only results I see are from the DS3231 and the thunderboard. I can run weatherracktest.py in a separate window and see wind / rain results, but nothing is shown in the main routine. Nada from the light sensor (although judging from experience without the multiplexer as well as with old code, it is there).
With the multiplexer and v3.02 code I cannot get the light sensor to work reliably. It may be possible to "fix" this by hacking together a version of simpletest that can talk to the sensor via the thunderboard. With the multiplexer and V3.12 code nothing works, except for the thunderboard. My gut feeling is that the initial detection / setup code bombs out with errors, and then decides the devices don't exist. Without the multiplexer I can get the light sensor working by running code in another window (!), but I cannot access the thunderboard. With or without the multiplexer I eventually run into the debounce problem, and everything screeches to a halt.
I think, based on some experiments you have done, and that I have done, it looks like two things are going on.
There may be a problem with the Sunlight sensor and I2C access. I'll have to look at that.
OK, it looks like something is going on with the I2C multiplexer in your system. It has got to be with your multiplexer or your wiring, because everything works here (expect I have seen some issues with the Sunlight sensor and haven't gotten back to that problem).
Would you send a good clear picture of the I2C Multiplexer so I can check the wiring?
This means that when you see that, you are getting a lot of interrupts on the WeatherRack wind line. I suspect this is caused by noise (it could be caused by a very high wind gust, but I doubt it) in the power supply for some reason. Something is injecting noise into the system.
Thanks for the reply. I have replaced the multiplexer with another one (identical wiring). Photos of the wiring can be seen at goo.gl/zL8AF9 Noise in the system: I suspect that may be the Raspberry Pi POE HAT - earlier versions had a noise problem, but that was supposedly fixed. Although difficult to tell, it may be when the fan comes on. I will see if I can make some other plan with power.