Adafruit connection OSError: -1



  • Im trying to post current sensor value to adafruit. it works great for about 5 mins then i get the error OSError:-1

    0_1525714076951_adaf.PNG

    below are my coding from line 152 to 165:

    try:                                                
        while 1:
                client.check_msg()
                gc.collect()
                acq = Acquire(50) # 50 Hz
                value = acq.reading("P13", 500)
                
                value = round(value, 1)
                current = value
                post_var("pycom", current)
                gc.collect()
                time.sleep(1)
    finally: 
              client.disconnect()
    

    I already use gc.collect() but the result is same.
    thank you.



Pycom on Twitter