ESP32 with GSM modem - PPP over Serial (PPPoS) client example

Ritesh
Posts: 607
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: ESP32 with GSM modem - PPP over Serial (PPPoS) client example

Postby Ritesh » Wed Aug 08, 2018 9:21 am

Hi Loboris,

I have one question like do we need to add interface input for GSM as well into TCP IP Adapter Interface Input List like WiFi STA, WiFi Ap and Ethernet Interface if we plan to add GSM Interface as well with ESP32?

/* TODO: add Ethernet interface */
typedef enum {
TCPIP_ADAPTER_IF_STA = 0, /**< ESP32 station interface */
TCPIP_ADAPTER_IF_AP, /**< ESP32 soft-AP interface */
TCPIP_ADAPTER_IF_ETH, /**< ESP32 ethernet interface */
TCPIP_ADAPTER_IF_MAX
} tcpip_adapter_if_t;
Regards,
Ritesh Prajapati

mr1000
Posts: 18
Joined: Fri Jan 12, 2018 9:05 am

Re: ESP32 with GSM modem - PPP over Serial (PPPoS) client example

Postby mr1000 » Wed Aug 29, 2018 7:57 am

Has someone faced issues when downloading 'large' files with the GSM? (Same file download using WIFI has no problem)

I'm downloading a 100Kb file, but when GSM module reads it, gets stuck at 16Kb aprox.
The first 16 chunks of 1024 bytes are read ok, but then it starts to 'Dropping bad fcs...''

I attach PPP DEBUG:
https://pastebin.com/ZYGKEZvE

I'm using same functions of loboris example
For reading via HTTPS I'm doing like the example

Code: Select all

do
        {
            len = BUFFSIZE;
            ret = mbedtls_ssl_read(&ssl, (unsigned char *)bufferRead, len);

            if(ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE)
            {
         ...
            }

            if(ret == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY)
            {
         ...
            }

            if( ret < 0 ) /* receive error */
            {
         ...
            }
            else if( (ret > 0) && (!resp_body_start) )   /* reading header first and a piece of body */
            {
         ...
            }
            else if( (ret > 0) && (resp_body_start) )   /* already read the header, reading body */
            {
         ...
            }
            else if( ret == 0 )   /* packet over */
            {
         ...
            }
        }
        while(1);
       

To make you an idea, I'm printing debug messages in each of the conditionals 'if' and when GSM gets stuck downloading, can't see more messages there.

Thanks in advance

EDIT: so in the library there's this comment (refering to Dropping bad FCS)
/* Note: If you get lots of these, check for UART frame errors or try different baud rate */
It's true that UART lines from ESP32 to module are relatively large (10 cm)
Gsm module works at 115200 by default, so I changed to 57600 still having bad FCS, then changed to 38400 and it worked
Not sure if the problem is really a hw issue or just the baudrate was too fast that internal libraries couldnt take that speed.

Who is online

Users browsing this forum: No registered users and 2 guests