Beta_Ravener wrote:I have first tried running your command without network connection and indeed got the same error as you:
Hmmm...that could help me try a few ideas.
Are you absolutely sure that you are using STA(tion) mode and you're connected to AP with internet connection?
Yes. My original line of code read like this:
Code: Select all
ai = socket.getaddrinfo("api.thingspeak.com", 80)
To make the Thingspeak updating work, I replaced this with a hard-coded line:
Code: Select all
ai=[(2, 1, 0, '', ('52.200.157.52', 80))] #hardwired for now
After that the code works flawlessly - every 15 seconds it updates Thingspeak...
But, in fact, it shows the problem in REPL - forget about scripts, and running too soon after a reset etc..
And my initialisation of the wlan is:
Code: Select all
wlan = network.WLAN(network.STA_IF)
I need to find a human readable version of "OSError: -2".......