I finally got my SkyWeather built, and I was having problems with the AM2315 temperature/humidity sensor. The "testAM2315.py" program would sometimes return data, but most often it just froze. I decided to do some digging to see if I could figure out why.
I found some information from other people using this sensor that indicated that it needed at least 2 "wakeups", and it appeared that only one was being done in the SDL_Pi_AM2315/AM2315test.py function. I changed the code to loop on the wakeup until it worked, up to a preset number of times, then attempt to request the data it wants. that really seems to have helped.
I am a bit curious about the need to connect the AM2315 via one of the Grove PowerSave boards. From what I read on the net, this sensor powers itself down to avoid false readings from heating, which is why it needs to be woken up. If that's the case, why turn off the power?
I had a lot of trouble talking to the AM2315 while it was connected to the Grove PowerSave board, If I connect it directly to either the 6 Port I2C board or one of the I2C connectors on the Pi2Grover it works very reliably.
I will post a copy of my code changes so others can see if this helps them.
I did not see anything in the driver that did a double wakeup. Are you talking about SDL_Pi_AM2315/AM2315.py? There is some code that could do a second wakeup, but with the try/except setup it never actually does that. If any one of the writes fail it bails and starts over. To do a wakeup you just have to keep sending them and ignore the errors. That's what I re-wrote. Before I changed the code it was failing 90% of the time. Now it works every time.
What started me on this was the AM2315 hanging and killing the entire program. Now it runs reliably.
I'm looking at that. I am not sure what I did and why I commented out the first one and didn't replace it. I'm going to check this out this afternoon. The last big change was to adjust the i2c bus to better match the AM2315 I2C specification, which I did. I may have hosed this up!