botletics / SIM7000-LTE-Shield

Botletics SIM7000 LTE CAT-M1/NB-IoT Shield for Arduino
https://www.botletics.com/products/sim7000-shield
GNU General Public License v3.0
483 stars 215 forks source link

Example walkthrough for a HTTPS POST and GET #202

Open krish2487 opened 4 years ago

krish2487 commented 4 years ago

Hello,

I know it is a rather vague question, but I was wondering if I can trouble the kind folks here for an example walkthrough of a HTTPS POST example for the SIM7000 shield.

I am able to do a HTTP POST and GET request, but looking at the issues on github page, it looks like the information to do a HTTPS post is scattered and incomplete. I did go through the docs folder and went through the SSL app note. However, there is no single end-to-end example for performing a HTTPS transaction.

I m sure, this information would be helpful for many others like me who are scrambling in the dark about this specific requirement.

What I am looking for / hoping to get

  1. A simple example showing HTTPS POST
  2. showing HTTPS GET
  3. The pre-requisites ( Firmware on the SIM7000 module, etc etc)
  4. Tools ( Software to update the firmware, etc etc)
  5. Certificates ?? ( Relevance of certificates and how to obtain them, upload them, software to upload them to the SIM module, how to use them with the AT commands set)

I apologize if it looks like its too much work, but I feel this is pretty helpful for many others like me. I see a lot of posts with specific sections of information, but no single example that others can use and emulate and learn from..

Thanks in advance! :-)

krish2487 commented 4 years ago

bump!! Any suggestions or inputs?

andrewhong5297 commented 4 years ago

bump looking for similar thing!

botletics commented 3 years ago

Hi there, I just added some revisions from a pull request adding SSL to the library. Please check out the fona.addRootCA() function for TCP + SSL.

johnedstone commented 2 years ago

I don't think we need to download the certs. Let's assume that I am posting to my own rest api. Let's assume that I trust the certs. Is there a simple modification to the following starting block of code from Botletics_SIMCom_Library_v1.1.0/Adafruit_FONA.cpp that would make it possible to post data?

1916 /********************************* HTTPS FUNCTION *********************************/
1917 boolean Adafruit_FONA::postData(const char *server, uint16_t port, const char *connType, const char *URL, const char *body) {
richcj10 commented 2 years ago

I don't think we need to download the certs. Let's assume that I am posting to my own rest api. Let's assume that I trust the certs. Is there a simple modification to the following starting block of code from Botletics_SIMCom_Library_v1.1.0/Adafruit_FONA.cpp that would make it possible to post data?

1916 /********************************* HTTPS FUNCTION *********************************/
1917 boolean Adafruit_FONA::postData(const char *server, uint16_t port, const char *connType, const char *URL, const char *body) {

Did you get HTTPS working? I get an error at AT+CHTTPSSTART.

johnedstone commented 2 years ago

I finally gave up on this board - you can see my trials at this link I just felt like the depth of support was not there :(

I do HTTPS POST with JSON for 3G now with the Arduino MKR GSM 1400 and I do 4G LTE with the GPy pycom board The Arduino MKR NB 1500 was a bust for me for 4G LTE

richcj10 commented 2 years ago

I actually got it working last night. The GPy was a bust for me. To many reliability issues withe LTE modem hanging. (Older FW worked way better than newer FW)

johnedstone commented 2 years ago

Interesting to know, thanks!

richcj10 commented 2 years ago

Take a look at issue https://github.com/botletics/SIM7000-LTE-Shield/issues/292

johnedstone commented 2 years ago

Wow, nice! The GPy went so smooth for me that I never looked back. And eventually, I combined a GPy connected to a Pytracker and a Adafruit BME680 reporting out to a rest api - so I didn't look back

botletics commented 2 years ago

Hey guys, figured out how to connect with SSL without verifying certs on the SIM7000! Please do the following: