This is more for information as I do not think there is anything that can be done to resolve the problem.
I brought an Enviro Weather over a year ago. It was setup and running in a remote location within an enclosure. I has been working for ages without problems. But suddenly it went offline.
When it was recovered I connected it to Thonny to check the outputs. What I got was:
2024-12-16 09:01:56 [exception / 132kB] ! Traceback (most recent call last):
File “”, line 71, in
File “enviro/init.py”, line 357, in get_sensor_readings
File “enviro/boards/urban.py”, line 53, in get_sensor_readings
OSError: [Errno 5] EIO
Suddenly the board was being detected as an “urban” and not a “weather”. So I tried hardwiring the board type to “weather”. This caused the following error:
2024-12-16 09:42:51 [exception / 112kB] ! Traceback (most recent call last):
File “”, line 71, in
File “enviro/init.py”, line 411, in get_sensor_readings
File “enviro/boards/weather.py”, line 198, in get_sensor_readings
TypeError: ‘NoneType’ object isn’t subscriptable
It would appear that the sensor on the board has died!
The board appears to be in good condition. There is some surface corrosion on the wireless shield and spiders have taken up residence in the unused wind and rain sockets.
I think the board auto-detection works from what sensors it can see on an I2C scan - so possible that one of them has given up the ghost?
Warranty is two years so drop us an email at support@pimoroni.com with some photos of the board and a link to this post and we’ll see if we can help :)
Thank you for the quick reply! Looking at the code it does appear to poke about on pins to find out what is attached to determine the board type. “urban” is the default if it fails determine any other board type.
You could do an i2c scan and see what shows up. You may have to edit pin numbers to what the enviro uses. I think it uses 4 and 5, if so the following code should work as is.
import machine
sda=machine.Pin(4) # Explorer 20 Breakout 4
scl=machine.Pin(5) # Explorer 21 Breakout 5
i2c=machine.I2C(0,sda=sda, scl=scl, freq=400000)
print('Scan i2c bus...')
devices = i2c.scan()
if len(devices) == 0:
print("No i2c device !")
else:
print('i2c devices found:',len(devices))
for device in devices:
print("Decimal address: ",device," | Hex address: ",hex(device))
Great. That is the sensor I care the least about! It does not give great values inside the Stevenson screen with no way of calibrating it. Just taking the card out of the screen and putting it back messes up all the readings as it is very hard to get it all back into exactly the same positions.
Well if I do not get a warranty replacement I will see about turning off that part of the code.
Thanks for the help with diagnosing the exact issue.
I have commented out lines 190 and 198 in weather.py. I had previously forced the board to set to “weather”. Now when I run the main.py it completes and uploads the data, without Lux of course.
Glad to help. I have several environmental sensor setups. I’m not uploading any data or logging anything though. I just display it locally in my house, in real time.
I have the data sent to a central server using MQTT. It is then processed into a database. I have also written a restful API that allows you to interrogate the database and return data. It will also generate graphs using Bokah and return the code for those that can be embedded into a website.