Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

other services like websocket.loop() or timeClient.begin () over GSM #434

Closed
holajuanfe opened this issue Aug 26, 2020 · 10 comments
Closed

Comments

@holajuanfe
Copy link

holajuanfe commented Aug 26, 2020

Hello Everyone, thanks for reading my question.
I am trying to program a TTCall with SIM 800L and the TinyGSM library. It's for a college project. Our server works with socket.io.

From the Wifi.h libraries I have no problem, but with the TinyGSM, when I launch services like websocket.loop () or timeClient.begin (), the system reboots and crashes and I have this error in Terminal.

I have tried using TaskHandle_t to use the two cores of ESP32 but I still can't figure out how to do it.

Can someone give me a hand?

Thank you very much!

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

What type of issues is this?

[ ] Request to support a new module

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

What are you working with?

Modem:
Main processor board:
TinyGSM version:
Code:

Scenario, steps to reproduce

I would like to execute webcocket.loop() and timeClient.begin() and i tried to move it to an other loop or in other task and i have the same bad result.

Expected result
the proper emit of the socket or get the time from internet

Actual result
The system crash and restart.

Fin del setup
Connecting to APN: movistar.es Connection OK
GPRS connected
Iniciando TimeClient
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/queue.c:1442 (xQueueGenericReceive)- assert failed!
abort() was called at PC 0x40090abd on core 1

Backtrace: 0x40094714:0x3ffca100 0x40094945:0x3ffca120 0x40090abd:0x3ffca140 0x40135f9a:0x3ffca180 0x4013619a:0x3ffca1a0 0x4012821c:0x3ffca1c0 0x40128285:0x3ffca1e0 0x40125006:0x3ffca200 0x40123d30:0x3ffca220 0x40127912:0x3ffca260 0x400dc0be:0x3ffca280 0x400dc165:0x3ffca2c0 0x401b79ba:0x3ffca2f0 0x400dcf43:0x3ffca310 0x400d35ab:0x3ffca330 0x400e024d:0x3ffca390 0x40090e29:0x3ffca3b0

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8

@holajuanfe
Copy link
Author

Any Help? Thanks!

@SRGDamia1
Copy link
Collaborator

The ESP core libraries are only built for using the integrated wifi and sockets built on that. When you're using TinyGSM, the ESP is communicating with the cellular chip using a serial line. A TinyGSMClient (or any other Arduino Client) cannot be used in place of the ESP's internal client's in this case. They're completely different classes.

@holajuanfe
Copy link
Author

Hi! With TinyGSM I was able to make it work with a web socket. Do you know why? It’s that different with socket.io ?

Thanks !

@SRGDamia1
Copy link
Collaborator

I'm sorry, I know this is pretty old.

TinyGSM works on OSI level 4 (or 5 for a few modules that support SSL). Websockets are a level 7 protocol that works on top of TCP. So if you found a library that creates a WebSocket on top of a standard Arduino client, then it would work with TinyGSM. But functions like the websocket and timeclient that are part of the ESP32 core are NOT built on a standard "Client" object; they use a separate class unique to the ESP32 using its internal wifi connection. Other libraries may use the ESP's own Client type or they may use the standard Arduino Client, it depends on the library. But you cannot supply a TinyGSM Client in place of the ESP32's separate WebClient.

@maggusscheppi
Copy link

I am on the same search for a way to create a secure websocket via GSM on the TTGO T-Call. Does anyone has a running sample? The ESP-IDF PPPos sample misses some preconfiguration of the SIM800L and in the Arduino-Libraries there seems to be no way to connect a websocket to a instanciated GSM-client.
Would be great, if you got a hint.
kind regards, Markus

@ghost
Copy link

ghost commented Feb 8, 2021

@holajuanfe and @maggusscheppi
Hi there, I recently came across the same issue...I want to run a wss connection via TinyGSM / TTGO T-Call 800L...the libraries I googled to use are mainly
#include <TinyGsmClient.h>
#include <ArduinoWebsockets.h>

However, I have not been able to them them interworking, I am not a developer to that depth..., but I was lucky to read that it is possible in principle...would it be possible for you to share some code snippets on this?
Thank you very much in advance!
Kind regards,
Michael

@maggusscheppi
Copy link

maggusscheppi commented Feb 9, 2021

Hi,
finally I got it running. GSM, GPS and sending data via a secure websocket connection.
I would like to share the code but I am not familiar with dropping code in github.
So i can tell only this link to my webserver for the sources.
https://schepplications.de/esp32/esp_gsm_gps_secure_websocket.zip

I have commented out the and for connecting via secure websocket in main.c.
Pls. use your own installation.
In case u want to use GPS, pls. check main/nmea_parser.h:
#define NMEA_PARSER_CONFIG_DEFAULT()
.rx_pin = 2 tells, on which pin to connect the tx of the GPS device. I did not connect the rx of the GPS device.

kind regards, markus

@DomolinBolivia
Copy link

No se puede descargar el codigo.

@mlibak
Copy link

mlibak commented Mar 6, 2022

Hi, finally I got it running. GSM, GPS and sending data via a secure websocket connection. I would like to share the code but I am not familiar with dropping code in github. So i can tell only this link to my webserver for the sources. https://schepplications.de/esp32/esp_gsm_gps_secure_websocket.zip

I have commented out the and for connecting via secure websocket in main.c. Pls. use your own installation. In case u want to use GPS, pls. check main/nmea_parser.h: #define NMEA_PARSER_CONFIG_DEFAULT() .rx_pin = 2 tells, on which pin to connect the tx of the GPS device. I did not connect the rx of the GPS device.

kind regards, markus

Hi @maggusscheppi,

I am doing project with same functionality. Unfortunately I can't make WebSocket and SIM800L work together. The link you provided gives this response The requested URL /esp32/esp_gsm_gps_secure_websocket.zip was not found on this server. I would be very grateful if you could provide the code

@maggusscheppi
Copy link

maggusscheppi commented Mar 7, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants