I am running a few Pi's which are independently uploading their BMP280 temperature readings to my Adafruit.io feed. I have ensured I am not exceeding my feed limit, but on one of the Pi's, a Raspberry Pi Zero W, I am frequently getting this error - notably, not on any of the other three Pi's.
Code: Select all
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='io.adafruit.com', port=443): Max retries exceeded with url: /api/v2/themusicman/feeds/pizerotemp/data (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0xb4d73d90>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))
Code: Select all
ADAFRUIT_IO_USERNAME = "removed"
ADAFRUIT_IO_KEY = "removed"
aio = Client(ADAFRUIT_IO_USERNAME, ADAFRUIT_IO_KEY)
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_bmp280.Adafruit_BMP280_I2C(i2c, address=0x76)
try:
pizerotemp = aio.feeds('pizerotemp')
except RequestError:
test_feed = Feed(name='pizerotemp')
test_feed = aio.create_feed(test_feed)
try:
pizeropressure = aio.feeds('pizeropressure')
except RequestError:
test2_feed = Feed(name='pizeropressure')
test2_feed = aio.create_feed(test2_feed)
while True:
aio.send_data(pizerotemp.key, round(sensor.temperature, 1))
aio.send_data(pizeropressure.key, round(sensor.pressure, 2))
time.sleep(120)
John