API Request with Sierra Wireless Modem

Jan on 5 Jul 2022
Latest activity Edit by Vinod on 6 Jul 2022

Hi,
I'm trying to connect my Sierra Wireless GL7600 4G modem with ThingSpeak.
To do so I send:
AT+KCNXCFG=1,"GPRS","TM" (APN)
AT+KHTTPSCFG=1,"api.thingspeak.com",443 (configure https session and connect)
When I try to send data
AT+KHTTPGET=1,"api.thingspeak.com/update?api_key=9**********J&field1=2"
I always get a NO CARRIER error.
I have installed the root certificate from thingspeak.com in the modem.
Do I need anything else?
Regards
Jan
Vinod
Vinod on 5 Jul 2022
If you're getting a NO CARRIER, it means you don't have internet connectivity using your SIM card. You will need to troubleshoot that with your cellphone service provider.
Jan
Jan on 6 Jul 2022
Hi Vinod,
I know that NO CARRIER means I can't get through to the server, but this is not a provider issue since I can connect to other HTTPS servers. Was my assumption right that I need to install thingspeak's root certificate on the modem?
Regrads
Jan
Christopher Stapels
Christopher Stapels on 6 Jul 2022
Maybe try not using the secure connection to see if that is the issue. ThingSpeak does not demand that you use certification unless your device demands it. Then you will be sure it is a carrier issue when you are still not able to connect.
Jan
Jan on 6 Jul 2022
Thank you Christopher,
it works indeed with HTTP via port 80.
With my Sierra Wireless GL7600 2G/4G modem the following AT commands were needed to communicate:
AT+KCNXCFG=1,"GPRS","APN" (APN of service provider to be replaced)
AT+KHTTPCFG=1,"api.thingspeak.com",80,1
AT+KHTTPHEADER? (empty header)
AT+KHTTPGET=1,"/update?api_key=x&fieldn=y" (x=API Write Key; n=field no.; y= value)
Vinod
Vinod on 6 Jul 2022 (Edited on 6 Jul 2022)
Looks like the issue when connecting to port 443 may have to do with additional required config you need to make for HTTPS connections. See this post. I'd recommend reaching out to the modem manufacturer for an HTTPS example. I don't see one in their manual (see page 387 on) that I could base a suggested set of AT commands on.
I would strongly recommend HTTPS connections, rather than HTTP, whenever your device can do HTTPS.
Jan
1
Post
2
Replies

Tags

No tags entered yet.