SIM7600 and Adafruit IO

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
mdymczyk
 
Posts: 2
Joined: Fri Dec 30, 2022 3:40 pm

SIM7600 and Adafruit IO

Post by mdymczyk »

Hello,
First of all, thanks a lot for this very valuable forum and keeping it running!

I'm trying to set up a very basic project that reads sensor data and then posts it to an Adafruit IO feed using the SIM7600 module and its builtin HTTP stack.

I'm running into the same problem described here: viewtopic.php?p=923075&hilit=406#p923075 (but it's locked, so I cannot follow up)

My log looks awfully similar to the post about the same issue:

Code: Select all

AT+HTTPINIT
OK

AT+HTTPPARA="URL","https://io.adafruit.com/api/v2/mdymczyk/feeds/temperature/data"
OK

AT+HTTPPARA="CONTENT","application/json"
OK

AT+HTTPPARA="USERDATA","X-AIO-Key: <edited out>"
OK

AT+HTTPDATA=42,5000
DOWNLOAD
{"value": 39, "lat": 23.1, "lon": "-73.3"}
OK

AT+HTTPACTION=1
OK

+HTTPACTION: 1,406,45
HTTP/1.1 406 Not Acceptable
As you can see, the connection with server is correctly established, but I'm getting an error 406 after. The value obviously doesn't appear in the feed.

On the other hand, using curl with the same feed and the API key works totally fine:

Code: Select all

curl -H "Content-Type: application/json" -d '{"value": 39, "lat": 23.1, "lon": "-73.3"}'  -H "X-AIO-Key: <edited out>" https://io.adafruit.com/api/v2/mdymczyk/feeds/temperature/data
Any idea what could be wrong with the SIM7600 approach?
What would e406 even mean in this context?
Do you maybe have any idea how could I better pinpoint the source of the issue? Is this about authentication, data format, API key?

User avatar
mdymczyk
 
Posts: 2
Joined: Fri Dec 30, 2022 3:40 pm

Re: SIM7600 and Adafruit IO

Post by mdymczyk »

Sorry for multiple posting, I might have a hint - as a response I can read out:

Code: Select all

HTTP Status 406: Invalid HTTP_ACCEPT Header: 
So it seems that the HTTP_ACCEPT header I'm sending is not right?

I've tried to set it up in the module:

Code: Select all

AT+HTTPPARA="ACCEPT","*/*"
OK
Which seems to be recognized by Adafruit IO, but still not working:

Code: Select all

HTTP Status 406: Invalid HTTP_ACCEPT Header: */*
I've also tried to specify specific formats, but no luck either:

Code: Select all

{"status":406,"error":"Invalid HTTP_ACCEPT Header: text/plain,application/json"}

User avatar
lorennorman
 
Posts: 28
Joined: Wed Mar 04, 2020 12:54 pm

Re: SIM7600 and Adafruit IO

Post by lorennorman »

Hello mdymczyk!

Thank you for reporting this issue. I've tracked it down and made some changes on our end, it is my belief you were getting an incorrect error message that was hiding the true problem.

Would you mind trying again now? Things will either work, or we'll have a better error track down.

Thanks for your patience in this!

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”