I have a very strange problem. I have to perform https requests for this I use the standard urequest library but I get an error in the gataddrinfo() function. I get the EAI FAIL error. The only documentation I found is :
I use the NB-IoT network. When I do the same thing in Wifi I don't have any problem...
Maybe someone has already encountered this problem? Or an idea of how to solve it?
Thanks in advance.
@Tgasser Have you tried different locations? The GPY has only 1 lte antenna which makes it susceptible to multipath. I have a few locations at our premises that show reasonable RSRP at -85dBm but the connection reliability is hopeless. When I move the antenna a couple of metres the connection becomes rock solid.
@kjm My SIM card can't connect to LTE-M. My operator is 1NCE and yes I have tried Wifi and I have no problem with it ...
@Tgasser I don't have any NB-IoT experience, I'm using cat M1. Have you tried connecting your device using wifi through a router instead of lte to prove your problem is lte related? Or maybe tried using lte cat M1 in lieu of NB-IoT to try to get a handle on where the problem is exactly?
@kjm Thanks, I did the tests to see if I am well connected before the request and it is always the case. For two hours I was able to do some request, but now I'm back to the problem.
For ntp, I never get in the synced case.
@Tgasser give this a shot
timeserver='time.google.com'; print('syncing', end=' '); rtc.ntp_sync(timeserver) for i in range(3): if rtc.synced(): t=time.time(); print(' epoch', t); break print(i, end=' '); time.sleep(1)
if it doesn't work then maybe double check the modem is attached/connected
@kjm Thank you for your answer. I've already tried to run rtc.ntp_sync to get a timestamp with the current date but I couldn't get it to work. Do you have an example for me please?
_urequests has a whole raft of errors it can throw, the EAI is maybe related to DNS lookup problems? The thing is not to get bogged down with them because there isn't much you can do about them. Personally I check the lte modem is still functional by pinging or doing an rtc.ntp_sync then retry later.