Trouble with the adafruit IO circuitpython Basic example

Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Locked
User avatar
ablesser
 
Posts: 3
Joined: Mon Jul 11, 2022 5:33 pm

Trouble with the adafruit IO circuitpython Basic example

Post by ablesser »

Hi folks, I'm trying to learn/use circuitpython on a Raspberry pi Pico W, following this tutorial: https://learn.adafruit.com/pico-w-wifi- ... dafruit-io

While the code runs, and data uploads.. it's not at all reliable.. and every so many data transmissions I have my board bomb out and reset (that is, the code hits the exception block) below:

I know the problem isn't in the setup code / wifi, because that always connects reliably. When it bombs, I get "Error:" ... but nothing after error... totally blank.

No errors are showing up on the monitor in adafruit IO either (https://io.adafruit.com/BANNED/monitor).

Suggestions ? I tried increasing / decreasing the time.sleep(1) in the example code below... I noted that removing it entirely seems to cause the board to crash more.. but increasing it past (1) doesn't seem to do anything.

Code: Select all

while True:
    try:
        #  when the clock runs out..
        if clock > 300:
            #  read sensor
            data = [aht20.temperature, aht20.relative_humidity]
            #  send sensor data to respective feeds
            for z in range(2):
                io.send_data(feed_names[z]["key"], data[z])
                print("sent %0.1f" % data[z])
                time.sleep(1)
            #  print sensor data to the REPL
            print("\nTemperature: %0.1f C" % aht20.temperature)
            print("Humidity: %0.1f %%" % aht20.relative_humidity)
            print()
            time.sleep(1)
            #  reset clock
            clock = 0
        else:
            clock += 1
    # pylint: disable=broad-except
    #  any errors, reset Pico W
    except Exception as e:
        print("Error:\n", str(e))
        print("Resetting microcontroller in 10 seconds")
        time.sleep(10)
        microcontroller.reset()
    #  delay
    time.sleep(1)
    print(clock)

User avatar
adafruit_support_carter
 
Posts: 29150
Joined: Tue Nov 29, 2016 2:45 pm

Re: Trouble with the adafruit IO circuitpython Basic example

Post by adafruit_support_carter »

When it bombs, I get "Error:" ... but nothing after error... totally blank.
Where are you seeing that?

User avatar
hyde00001
 
Posts: 13
Joined: Fri Jan 20, 2023 4:16 am

Re: Trouble with the adafruit IO circuitpython Basic example

Post by hyde00001 »

I can’t even get as far as you with my Pi Pico W setup. Can you list which version of Circuit Python and libraries you are/were using??

Locked
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.

Return to “Internet of Things: Adafruit IO and Wippersnapper”