Skip to content

AWS MQTT ESP32 SIM800 TinyGSM #39

@aneggi

Description

@aneggi

Firts of all, thanks a lot to contribute. :-)

I am trining to connecting to AWS IOT by MQTT. I am using Esp32 with SIM800L.
To manage SIM800L I am using TinyGSM library.
So I copied and paste your MQTT example, and tried with WIFI, and it works fine after some minor fix on the Ethernet library.
Now I added TinyGSM and removed WiFi but I got an error...

Partial important code changing here:

TinyGsm modem(SerialAT);
TinyGsmClient transport(modem);

SSLClient ethClientSSL(transport, TAs, (size_t)TAs_NUM, A5);
PubSubClient mqtt(mqttServer, 8883, callback, ethClientSSL);

I got this error:

Initializing modem...
[8304] ### TinyGSM Version: 0.10.9
[8304] ### TinyGSM Compiled Module:  TinyGsmClientSIM800
[8617] ### Modem: SIMCOM SIM800L
[8617] ### Modem: SIMCOM SIM800L
1
[NET] Signal quality before GPRS ( >10 OK ): 0
Modem Info: SIM800 R14.18
[29070] ### Network time zone updated.
[29073] ### Network time and time zone updated.
[29074] ### Daylight savings time state updated.
Waiting for network... success
Network connected
Attempting MQTT connection...(SSLClient)(SSL_ERROR)(m_update_engine): Error reading bytes from m_client. Write Error: 
(SSLClient)(SSL_ERROR)(m_update_engine): 0
(SSLClient)(SSL_ERROR)(connected): Not connected because write error is set
(SSLClient)(SSL_ERROR)(m_print_ssl_error): SSL_CLIENT_WRITE_FAIL
(SSLClient)(SSL_WARN)(m_run_until): Terminating with write error: 
(SSLClient)(SSL_WARN)(m_run_until): 4
(SSLClient)(SSL_ERROR)(m_start_ssl): Failed to initlalize the SSL layer
(SSLClient)(SSL_ERROR)(m_print_br_error): Unknown error code: 0
failed, rc=-2 try again in 5 seconds
(SSLClient)(SSL_ERROR)(connected): Not connected because write error is set
(SSLClient)(SSL_ERROR)(m_print_ssl_error): SSL_CLIENT_WRITE_FAIL
Attempting MQTT connection...(SSLClient)(SSL_ERROR)(connected): Not connected because write error is set
(SSLClient)(SSL_ERROR)(m_print_ssl_error): SSL_CLIENT_WRITE_FAIL
(SSLClient)(SSL_ERROR)(connected): Not connected because write error is set
(SSLClient)(SSL_ERROR)(m_print_ssl_error): SSL_CLIENT_WRITE_FAIL

Am I doing something bad when I use that "transport(modem)" in this way?
There is any way to find where is the error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions