I am using Simcom SIM 808 to post data to Azure Iot Hub. My problem is that Azure Iot Hub requires a SAS string in the Authorization header, but I can not find a way to add this header. Anyone have experience with sim 808 and Azure iot? Is it possible to add the authorization string to the url?
I am using the SIM800 series AT command manual v 1.07.pdf for reference.
Header arguments that are supported is: CONTENT, USERDATA and some more.
Here you can find a program I made to send data to my Azure IoT Hub via HTTPS using SIMCOM Modules (SIM800, SIM900...): https://developer.mbed.org/users/BorjaTarazona/code/Azure_SIM800_HelloWorld/
I had the same issue, my problem was that you need to write before your shared access signature "Authorization: ". You need to use the argument "USERDATA" and the command will look like this:
AT+HTTPPARA="USERDATA","Authorization: YourSharedAccessSignature"\r\n
The commands I use to send data to Azure via HTTPS with SIMCOM modules are:
Initialization
Set context type: AT+SAPBR=3,1,"CONTYPE","GPRS"\r\n
Set APN: AT+SAPBR=3,1,"APN","YourAPN"\r\n
AT+SAPBR=1,1\r\nAT+SAPBR=2,1\r\nAT+HTTPINIT\r\nAT+HTTPSSL=1\r\nData transmission
AT+HTTPPARA="CID",1\r\nAT+HTTPPARA="URL","YourURL"\r\nAT+HTTPPARA="USERDATA","Authorization: YourSharedAccessSignature"\r\nAT+HTTPPARA="CONTENT","application/json"\r\nAT+HTTPDATA=StringLength,20000\r\nYourJSONStringAT+HTTPACTION=1\r\nIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With