Not sure if this is considered bad form - talking about the RPi2 and AirPi here on the Pimoroni forum, and need to state that I’m very much new to the whole world of the RPi, Python, Linux and the AirPi! However, I wanted to post this in case it’s of any help to anyone else having problems getting the AirPi (1.4) to work with the RPi2.
Anyway, I took delivery of an AirPi 1.4 on Friday, duly assembled it Friday night, and then connected it up to the RPi2 via a BlackHat (both bought from Pimoroni).
Ran the airpi.py script up and - nothing!
After a lot of fiddling around in the python script, and the sensors configuration file I managed to establish that the basic RPi to AirPi communication was working, the two status LEDs were addressable, and while several of the sensors were okay, the problem was that the script would hang as soon as the DHT22 sensor code was called (Temp and Humidity).
I double and triple checked the DHT22 soldering, and checked it’s connections to the GPIO using a digital multimeter, and after satisfying myself that it should work, turned my suspicion to the “dhtreader.read” call, and sure enough it was failing at that point.
Much googling of “dhtreader.read” later I found references to rebuilding the “dhtreader.so” file, so thought I’d give it a try in case it needed to be rebuilt for the RPi2:
So, I cloned the AdaFruit Raspberry Pi Driver code from GitHub, and downloaded the updated bcm2835-1.42.tar.gz file from airspayce.com, built and installed the updated bcm2835 driver, and then built the AdaFruit_DHT driver for python.
Finally, copied the new “dhtreader.so” file from the build folder over int the AirPi folder replacing the AirPi original file, and hey presto, the AirPi now works successfully on the RPi2.
The necessary URLs are:
bcm2835 library: - http://www.airspayce.com/mikem/bcm2835/bcm2835-1.42.tar.gz
I hope this is useful to anyone new to the RPi2 world (particularly newbies like myself) that are interested or struggling with the AirPi on the RPi2.
(Now to get the AirPi to offload it’s data to somewhere useful).
Cheers - Paul