GPRS connection is successful but fails shortly later (TinyGSM lib is used)

Hi,

I am using the sim808 gprs module with the arduino nano board and the TinyGSM lib. For testing the connection the ArduinoTinyGSM sketch example has been uploaded.
It is possible to establish a connection to thinger.io
But shortly later the connection aborts. No other connection is possible unless I upload the sketch again.
Please help. Thank you!!

Debug Information:
link = iot.thinger.io:25200 (had to delete links)


[NETWORK] Starting connection…
[NETWORK] Network Status: 1
[[NETWORK] Connected!
[_SOCKET] Connecting to link
[_SOCKET] Using secure TLS/SSL connection: no
[NETWORK] Starting connection…
[NETWORK] Network Status: 1
[NETWORK] Connecting to APN…
[NETWORK] Connected!
[_SOCKET] Connecting to link
[_SOCKET] Using secure TLS/SSL connection: no
[_SOCKET] Error while connecting!
[NETWORK] Starting connection…
[NETWORK] Network Status: 1
[NETWORK] Connecting to APN…
[NETWORK] Connected!
[_SOCKET] Connecting to link
[_SOCKET] Using secure TLS/SSL connection: no
[_SOCKET] Connected!
[THINGER] Authenticating. User: rjakub Device: arduinoNano001
[THINGER] Writing bytes: 45 [OK]
[THINGER] Authenticated
[THINGER] Writing bytes: 2 [FAIL]
[THINGER] Expected:2
[THINGER] Wrote:65535
[_SOCKET] Timeout!
[_SOCKET] Is now closed!
[NETWORK] Starting connection…
[NETWORK] Network Status: 1
[NETWORK] Connecting to APN…
[NETWORK] Connected!
[_SOCKET] Connecting to link
[_SOCKET] Using secure TLS/SSL connection: no
[_SOCKET] Error while connecting!
[NETWORK] Starting connection…
[NETWORK] Network Status: 1
[NETWORK] Connecting to APN…
[NETWORK] Connected!
[_SOCKET] Connecting to link
[_SOCKET] Using secure TLS/SSL connection: no
[_SOCKET] Error while connecting!
[NETWORK] Starting connection…
[NETWORK] Network Status: 1
[NETWORK] Connecting to APN…
[NETWORK] Connected!
[_SOCKET] Connecting to link
[_SOCKET] Using secure TLS/SSL connection: no
[_SOCKET] Connected!
[THINGER] Authenticating. User: rjakub Device: arduinoNano001
[THINGER] Writing bytes: 45 [FAIL]
[THINGER] Expected:45
[THINGER] Wrote:65535
[THINGER] Auth Failed! Check username, device id, or device credentials.
[_SOCKET] Is now closed!
[NETWORK] Starting connection…
[NETWORK] Network Status: 4
[NETWORK] Restarting Modem…
[NETWORK] Waiting for Network…
[NETWORK] Network Connected!
[NETWORK] Connecting to APN…
[NETWORK] Connected!
[_SOCKET] Connecting tolink
[_SOCKET] Using secure TLS/SSL connection: no
[_SOCKET] Error while connecting!
[NETWORK] Starting connection…
[NETWORK] Network Status: 1
[NETWORK] Connecting to APN…
[NETWORK] Connected!
[_SOCKET] Connecting to link
[_SOCKET] Using secure TLS/SSL connection: no

Your sketch is just the stock example?

I had the same problem!

Their are to things to look after!

  1. Check your the powersupply of your sim808 ! It needs up to 2A and seems to be quite sensitive for ripples etc.

  2. Are you using Hardware or Software Serial for the communication with SIM808.
    I used HW Serial but on 9600 baud and had the same problem! After chaning to 57600 baud every thing was fine.

When changing the baud rate make sure that you set the correct baud rate in the sim module or set it to auto detect.

Are you using some developer sim808 board? Perhaps you can post a link of your modell, because I am facing the problem agian after changing the developer board! The new much cheaper on seems to be even more selective regarding power supply.

Good Look!

Thank you for your help.
I could figure out the problem:
My signal quality was too bad. Here at home the signal strength is too weak. At the university, I could connect without any problems.

@Maverick121
1.) Thanks. That is true. I had this problem at the beginning.
Then I figured out that the internal resistance of the bread board and the power supply were the problems. Now, I use an USB power adapter with 2A.

2.) I am using Software Serial. I hadn’t any problems with that, yet.

@alvarolb
Yes, I do. I use the stock sketch and everything works fine.
Btw: Thank you very much for providing the library!!!

Nice it works! :slight_smile: