vshymanskyy / TinyGSM

A small Arduino library for GSM modules, that just works
GNU Lesser General Public License v3.0
1.93k stars 715 forks source link

SIM7000 SSL #437

Closed marmotton closed 3 years ago

marmotton commented 3 years ago

[X] I have read the Troubleshooting section of the ReadMe

What type of issues is this?

[(x)] Request to support a new module

[ ] Bug or problem compiling the library [ ] Bug or issue with library functionality (ie, sending data over TCP/IP) [X] Question or request for help

What are you working with?

Modem: SIM7000E Main processor board: ESP32 TinyGSM version: github master

Question

Hello, I'm currently trying to implement SSL support for the SIM7000E module. To my understanding, one has to use the "CA" commands (CACID, CAOPEN, CASEND, CARECV etc.). This means that not only the modemConnect method must be modified, but also modemSend, modemRead etc. I guess it is better to stay with the "CIP" commands for plain TCP as some functions wouldn't be available with "CA" commands, e.g. CIPRXGET=4 to query how much data is available and more importantly the possibility of using 8 connections (mux).

Now I'm wondering what would be the best way to go:

Thanks for your help,

Ben

kantum commented 2 years ago

You can check this repository, it was working back then, I just made it public so you can try to get something out of it. The keys are outdated, so I kept it in the repository, you may want to do differently. See the dev branch for last commits.

nicklasb commented 2 years ago

@kantum Thanks! Will check it out and get back!

JayPalm commented 2 years ago

I simply had to change TinyGsmClient to TinyGsmClientSecure,

@marmotton I've been banging my head against the wall for several hours with this. Thank you, it really was that simple!

Fishtronics commented 2 years ago

Hi everyone I bought the LilyGO-T-SIM7000G and i am trying to send data to google spreadsheet with it see link:https://www.electroniclinic.com/google-spreadsheet-or-google-sheets-with-esp8266-nodemcu-for-data-logging/ but the example shows only how to do it via wifi not via a sim card. I Have tested the lilygo see link: https://github.com/Xinyuan-LilyGO/LilyGO-T-SIM7000G/blob/master/examples/Arduino_TinyGSM/AllFunctions/AllFunctions.ino works fine but I don't know how to get it to work with the google spreadsheet? please help me as have been trying for over two weeks thanks!!

Fishtronics commented 1 year ago

please is there any one out there to help me!!? how do i put a valid google certifcat on the sim7000

gotnull commented 1 year ago

I also wrote the SIM7000SSL-notes.md to help us getting started.

Link not working.

gotnull commented 1 year ago

Hi @gsvitak , yes of course ! I did some cleanup, this is the branch: https://github.com/marmotton/TinyGSM/tree/SIM7000SSL . I also wrote the SIM7000SSL-notes.md to help us getting started.

This SSL fix doesn't work for 7670SA modules, right? I can't seem to connect over port 8883 and a private SSH broker.

https://github.com/Xinyuan-LilyGO/T-A7670X

I have raised a ticket: https://github.com/Xinyuan-LilyGO/T-A7670X/issues/35

calvarez03 commented 11 months ago

Hi everyone I bought the LilyGO-T-SIM7000G and i am trying to send data to google spreadsheet with it see link:https://www.electroniclinic.com/google-spreadsheet-or-google-sheets-with-esp8266-nodemcu-for-data-logging/ but the example shows only how to do it via wifi not via a sim card. I Have tested the lilygo see link: https://github.com/Xinyuan-LilyGO/LilyGO-T-SIM7000G/blob/master/examples/Arduino_TinyGSM/AllFunctions/AllFunctions.ino works fine but I don't know how to get it to work with the google spreadsheet? please help me as have been trying for over two weeks thanks!!

Hi Fishtronics,

Were you able to make this happen? I having the same issues as you.

Thanks in advance!

dalbert2 commented 2 months ago

For anyone finding this thread, on a SIM7000G running 1529B08SIM7000G firmware:

There are numerous issues, including incorrect documentation in the user manual. For example, the +CARECV: , documentation is wrong, it just returns +CARECV:

Unfortunately, AT+CARECV? command just returns OK; no count of characters pending.

Worse, the provided in the AT+CARECV response is not always correct. For example, when receiving multiple segments (e.g. downloading a file), you may ask for 1024 bytes send: AT+CARECV=0,1024\r and receive an indication that 1024 bytes are ready: \r\n+CARECV: 1024, ...but the modem won't actually send 1024 bytes after the comma (so include a timeout!) It works better if you ask for smaller chunks (e.g. 512 bytes) (mismatch in internal buffer sizes?). I'm still working on figuring out a reliable solution and will post here if I find it. If anyone else has solved the SIM7000 SSL AT+CAxyz magic, please share it!