thingsboard / thingsboard-client-sdk

Client SDK to connect with ThingsBoard IoT Platform from IoT devices (Arduino, Espressif, etc.)
MIT License
149 stars 120 forks source link

Device connecting to APN but not to ThingsBoard when using GSM #187

Open jortega11 opened 7 months ago

jortega11 commented 7 months ago

Hello, I am testing a GSM/GPRS/GPS module, the A9G module. The first thing that comes into my mind is that this board is not properly supported (I have not seen this module when you define them at the beginning of the sample code) and that could be why this is not working, but then I checked the commands that the library uses to communicate with the module and they seem to be the same commands that are used for other modules.

I have succesfully worked with another GSM module in the past with that same sample code provided and it worked fine, but now I wanted to add GPS functionalities so I had to change this previous module to the A9G.

I have found that there is a function in the TinyGsmClient library that checks if the module is connected to GPRS or not and sometimes it says that it is connected and some others that it is not. Apparently it connects correctly to the APN but then it does not have Internet so connecting to ThingsBoard becomes impossible.

This is what it is shown in the output.

image

My first guess is that I need something else that it is not supported in the library but I am not sure about that. Any ideas of what can be causing this issue or which troubleshooting steps could I follow to address this issue? Thank you very much!

MathewHDYT commented 7 months ago

@jortega11 For now could you enable Thingsboard debugging, perhaps that will help to find out a specific reason. See Documentation for more information.

@imbeacon Do you know of any incompatibility issues with the aforementioned device?

jortega11 commented 7 months ago

Using the Thingsboard debugging, but could not get any extra information

MathewHDYT commented 7 months ago

I've had a look at the TinyGSM library, perhaps the example PubSubClient integrations provied can help fix the aforementioned issue.

If you want too you can have a look at the example and compare it with your currently not working script. Because there might be special additional steps required to get it working for GPRS/GPS boards.

jortega11 commented 6 months ago

I will take a look at it. Thanks!

imbeacon commented 6 months ago

Hi @jortega11,

Could you try to connect to Matt.thingsboard.cloud instead of thingsboard cloud?

jortega11 commented 6 months ago

Okay, I will try it. Which token should I use in order to connect it?

MathewHDYT commented 1 month ago

@imbeacon Can be closed, because the library would only support the device if a new instance of the MQTTClient interface was created. This can be done by the end users of the library itself, because providing a custom MQTTClient implementation for every user would be too much effor.

Instead only the 2 most common cases are handled in the library itself (PubSubClient and ESP MQTT Client)