I’ve built the air quality monitor and connected it to Luftdaten following all the instructions here:
https://learn.pimoroni.com/tutorial/sandyj/enviro-plus-and-luftdaten-air-quality-station
Everything works fine if I run the luftdaten.py script by hand. Everything also runs fine from crontab on reboot as long as I have my keyboard attached. It all goes wrong as when I reboot without the keyboard attached.
I’ve directed output to a log file so I can see what’s going on and in the case of it not working when the keyboard is not attached I get the following:
Raspberry Pi serial: 000000008a8fe1d4
Wi-Fi: connected
{‘P2’: ‘2’, ‘pressure’: ‘62699.62’, ‘P1’: ‘2’, ‘temperature’: ‘4.80’, ‘humidity’: ‘50.59’}
(“bad handshake: Error([(’’, ‘osrandom_rand_bytes’, ‘getrandom() initialization failed.’)],)”,)
{‘P2’: ‘2’, ‘pressure’: ‘102746.46’, ‘P1’: ‘2’, ‘temperature’: ‘22.86’, ‘humidity’: ‘26.47’}
(“bad handshake: Error([(’’, ‘osrandom_rand_bytes’, ‘getrandom() initialization failed.’)],)”,)
The other symptom of the problem is that the LCD on the Enviro+ starts up all pixellated and never displays the serial number and ‘WiFi connected’ message that appears when it is working properly and logging data to Luftdaten.
So, it’s clear there’s a problem but I can’t for the life of me think why simply removing the keyboard would matter.
The keyboard and mouse I’m using and wireless and so I’m putting the wireless dongle into the USB port on the Pi to get the keyboard and mouse working.
Anyway, I’m baffled and this is driving me nuts. If anyone can explain what the problem is and how to resolve it I’d be most grateful. Obviously I can’t deploy this monitoring station until I can make it boot successfully without screen, keyboard and mouse attached.
Alice