SIM7600 AT Commands for HTTP POST

Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Locked
User avatar
hurwitz_ilan
 
Posts: 1
Joined: Sun Jul 01, 2018 9:05 am

SIM7600 AT Commands for HTTP POST

Post by hurwitz_ilan »

Hi Everyone,
I'm trying to get a simple project up and running with a SIM7600 connected to an Arduino, checking the temperature and humidity once every 10 minutes, and uploading the results to Adafruit.io.
I decided the easiest way to do this would be using the HTTP POST method, but I'm having some issues with the syntax. After connecting to the network, successfully, I send the following AT commands (I've changed the AIO Key, but everything else is as it runs on my end):

AT+HTTPINIT //Initialize HTTP
AT+HTTPPARA="URL", "https://io.adafruit.com/api/v2/hurwitz_ ... test1/data" //Define URL
AT+HTTPPARA="USERDATA","X-AIO-Key: aio_ABCEDFGHIJKLMNOPQRSTUVWXYZ" //Define AIO key in Header
AT+HTTPPARA="CONTENT","application/x-www-form-urlencoded" //Define formatting as "form" for value=42
AT+HTTPDATA=12,2000 //Prepare to receive 12 bytes of data to send
"value=12.3"
AT+HTTPACTION=1 //Perform PUSH
AT+HTTPREAD=200 //Read Reply
AT+HTTPTERM //Terminate HTTP

I get an "OK" reply from the SIM7600 after each command (except the "HTTPDATA" command which replies with "DOWNLOAD" which tells me to input the text), but the reply I get from the server is:

HTTP Status 406: Invalid HTTP_ACCEPT Header:

And noting updates on my Adafruit IO Feed.

I'm clearly doing something wrong with the X_AIO_Key, but I've tried a bunch of different syntax tweaks and I can't seem to get to any success.
Has anyone successfully implemented this with SIM7600?

Thanks in advance!!

Locked
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.

Return to “Internet of Things: Adafruit IO and Wippersnapper”