I'm a complete newbie to the programming universe and I want to create a air quality sensor with the following code.
Code: Select all
import serial, time
from Adafruit_IO import Client
aio = Client('Teamplay','aio_abcdefghik')
ser = serial.Serial('/dev/ttyUSB0')
while True:
data= []
for index in range (0,10):
datum = ser.read()
data.append(datum)
pmtwofive = int.from_bytes(b''.join(data[2:4]), byteorder='little') / 10
aio.send('python3-airquality.py', pmtwofive)
pmten = int.from_bytes(b''.join(data[4:6]), byteorder='little') / 10
aio.send('airquality1.py', pmten)
time.sleep (10)
Code: Select all
Traceback (most recent call last):
File "/home/teamplazer/kingswoodten.py", line 15, in <module>
aio.send('kingswoodtwofive', pmtwofive)
File "/usr/local/lib/python3.9/dist-packages/Adafruit_IO/client.py", line 167, in send_data
return self.create_data(feed, payload)
File "/usr/local/lib/python3.9/dist-packages/Adafruit_IO/client.py", line 313, in create_data
return Data.from_dict(self._post(path, data._asdict()))
File "/usr/local/lib/python3.9/dist-packages/Adafruit_IO/client.py", line 139, in _post
self._handle_error(response)
File "/usr/local/lib/python3.9/dist-packages/Adafruit_IO/client.py", line 117, in _handle_error
raise RequestError(response)
Adafruit_IO.errors.RequestError: Adafruit IO request failed: 404 Not Found - not found - API documentation can be found at https://io.adafruit.com/api/docs
Thank you for your kindness and your time!