🎁📬❄️📦 Holiday Shipping Deadlines are approaching! International customers and domestic ground - get your orders in 12/9/2020 📦❄️📬🎁
0

Can't request time from Adafruit.io
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Can't request time from Adafruit.io

by visionline on Sun Nov 15, 2020 2:41 pm

Background: I'm a seasoned Python programmer, but this is my first jump into CircuitPython. I've got a MagTag with adafruit-circuitpython-adafruit_magtag_2.9_grayscale-en_US-20201113-8d3a878.bin installed as the firmware. I've installed the adafruit-circuitpython-magtag-6.x-mpy-1.0.2 library and extra libs from adafruit-circuitpython-bundle-6.x-mpy-20201113 . The hello world type examples work, as well as generic network access. So my secrets.py file is setup correctly for that. When I try to run the https://github.com/adafruit/Adafruit_Learning_System_Guides/tree/master/MagTag_SimpleClock example with my Adafruit.io key I just get
Code: Select all | TOGGLE FULL SIZE
Traceback (most recent call last):
  File "code.py", line 26, in <module>
  File "adafruit_magtag/magtag.py", line 282, in get_local_time
  File "adafruit_magtag/network.py", line 203, in get_local_time
  File "adafruit_magtag/network.py", line 185, in get_local_time
  File "adafruit_requests.py", line 585, in get
  File "adafruit_requests.py", line 563, in request
  File "adafruit_requests.py", line 432, in _get_socket
RuntimeError: Sending request failed

The offending line is "magtag.get_local_time()"

I'm guessing that my key in the secrets dict is malformed, but I'm at a loss for how. Right now it says:
Code: Select all | TOGGLE FULL SIZE
secrets = {
    'ssid' : 'MySSID',
    'password' : 'MYPassWord',
    'timezone' : "America/New_York", # http://worldtimeapi.org/timezones
    'aio_username' : "MyUserName",
    'aio_key' : "aio_MyKey"
    }

visionline
 
Posts: 7
Joined: Sun Nov 15, 2020 2:20 pm

Re: Can't request time from Adafruit.io

by visionline on Sun Nov 15, 2020 9:42 pm

I did some digging and this might be connected to my issue. I noticed that the last commit for https://github.com/adafruit/Adafruit_CircuitPython_MagTag/blob/main/adafruit_magtag/network.py was a1df065, two days ago as of this post. The get_local_time() function in there has the comment "NOTE: Do not use yet. This is currently not working." So that might have something to do with why this code isn't working. So that is a thing.

visionline
 
Posts: 7
Joined: Sun Nov 15, 2020 2:20 pm

Re: Can't request time from Adafruit.io

by tannewt on Mon Nov 16, 2020 5:55 pm

Hi! We currently have a bug communicating with IO on the ESP32-S2. It'll be fixed today or tomorrow so keep updating to the absolute newest version. Thanks!

tannewt
 
Posts: 1922
Joined: Thu Oct 06, 2016 8:48 pm

Re: Can't request time from Adafruit.io

by visionline on Tue Nov 17, 2020 1:36 am

tannewt wrote:Hi! We currently have a bug communicating with IO on the ESP32-S2. It'll be fixed today or tomorrow so keep updating to the absolute newest version. Thanks!


Glad to know it is being addressed! Thanks!

visionline
 
Posts: 7
Joined: Sun Nov 15, 2020 2:20 pm

Re: Can't request time from Adafruit.io

by visionline on Fri Nov 20, 2020 12:13 am

Circuit-Python 6.1.0 beta fixes this problem! It was probably the TLS issue, if I were a betting man. Anyway, all is now good for me in the MagTag world. At least for now. :)

visionline
 
Posts: 7
Joined: Sun Nov 15, 2020 2:20 pm

Re: Can't request time from Adafruit.io

by tannewt on Mon Nov 23, 2020 5:36 pm

Great! I'm glad it's working now.

tannewt
 
Posts: 1922
Joined: Thu Oct 06, 2016 8:48 pm

Please be positive and constructive with your questions and comments.