In addition to setting BOTLETICS_SSL to 1 in the .h file and using dweet.io for the URL, you also need to uncomment this line:
#if defined(SIMCOM_7000) || defined(SIMCOM_7070) // Use this if you have SIM7000A, especially with SSL
and comment out the line above it. It should look like:
// #ifdef SIMCOM_7070 // Use this line if you have the SIM7000G because the 1529B01SIM7000G firmware doesn't seem to run the commands below well #if defined(SIMCOM_7000) || defined(SIMCOM_7070) // Use this if you have SIM7000A, especially with SSL
And of course, make sure you have a LiPo battery plugged in. I just tried it and it worked for my SIM7000A.
so we actually had me update to the b03 firmware a while back to try and fix the GPS/Data issue (I think it was on the other forum). I think it turned out that my board was just dropping connection after being idle for too long, and so I solved it (I think) by just resetting the data connection if I tried using the network and it failed, programmatically through code, for the most part, everything seemed to work after that using IFTTT, even though it was apparently not using SSL/HTTPS. The only issue I had was that for some reason, SMS messages could delay sending to the device, possibly related to the data connection needing to be reset for that as well, but did not have it being done in code. I wonder if it was going into sleep somehow, even though, I think I had sleep disabled.
Anyways, I'm in the process of downgrading to b03 again, and will try and give it a test today or throughout this week /end.
I finally found a nice automation service to use for my HTTP requests as well, just need the damn arduino to work lol.
Also, I'm just gonna nuke my libraries, and try and start fresh lol
ok so I started fresh, lte demo startup shows I'm on revision: 1351B03SIM7000A have commented/uncommented code, and SSL = 1 in botletics.h file, trying to send to https://dweet etc.
serial shows "Failed to connect to server..." I have enabled data using G, but it took a few tries, as I was getting errors for "AT+SAPBR=1,1", and returning "Failed to turn on", I ran g to turn off "Failed to turn off" eventually, G runs and doesn't return any status, just: 12:40:08.192 -> G
Maybe I just need a new sim shield, some defective on here, or maybe defective antenna. IDK, I'm just shooting in the dark at this point, since A fresh clean install should replicate your results. Don't see why not.
Update to any who might encounter similar issues...
Turns out my sim shield just did not work with the SSL/HTTPS features. Not sure why, but got a replacement board that was verified working with this feature...
In order to post using HTTPS/SSL:
Define the SSL code in the .h source file to 1 Use .HTTP_connect("https:/url.com"); sprintf(URL, "/restofpostingurladdressaftercomofbaseaddress"); //note URL is char URL; setup similar to lte demo... Also note URL has a max length! (Think it is 64 characters, not exactly sure, it's in the sim documentation) If you exceed the length, it will error out and not work.
In order to send JSON formatted data in the body of the payload:
.HTTP_addHeader("Content-Type", "application/x-www-form-urlencoded", 64); //necessary to preserve format as JSON //addPara was the only way I could get the code to post successfully WITH body content in the payload. SHBOD, etc didn't work. .HTTP_addPara("value1", value1, 64); // ("Key","value", maxlength in bytes of value)
.HTTP_addPara("value2", value2, 64);
.HTTP_addPara("value3", value3, 64); That will format your data to your post url similar to, where each addPara seems (haven't verified) to add a new array entry key/value pair under body in JSON field.
Then you simply post to the url:
.HTTP_POST(URL, body, 29); //NOTE the body here actually doesn't seem to matter. It doesn't seem to post it anywhere, the previous addPara is what adds to the body
Note: In my application, I am sending JSON payload in body through HTTPS url to a webhook receiver tool. The image above is a screenshot from the receiver running this code with a successful post. I am then able to parse the JSON payload for my own purposes, and use the webhook receiver platform/tool to then send data elsewhere if needed.
screenshot of the webhook receiver platform sending the data from value1 to my discord (actual from these screenshots), with additional information programmatically added:
Much appreciation for botletics to help diagnose issues with this!
Edit: You don't need to mess with or deal with certs, either.