Closed euquiq closed 5 years ago
Side note: I wonder internally, how TinyGSM works ... if it establishes a single, transparent connection into gprs, or "tap dances" with AT commands and several channels, in verbose mode, all at once, on an incoming data basis. I will try to give it a look, maybe there I will find some answers
Update: I fixed it. I moved the mqttclient.loop(); into the main void loop() {} and it started working just fine. I understood that "it was the same" one place or another, provided that it is called periodically, but it seems not, or at least not where is placed in the exposed code on my first post.
Sorry and hopefully this "insight" may help someone else!
Hello!
I manage to connect (and pass through a Last will on connection into my own (mosquitto, linux server based) broker. I can see my broker receiving the user / pass (and last will) and returning the ACK.
Then my Arduino Sketch subscribes into two topics. Again, I can see the topic subscription request on my mosquitto log, and the ACK is sent back.
All is fine.
Fifteen seconds (or so) later, PubSubClient indicates that MQTT broker is disconnected (from my arduino) and thus another MQTT connection is started. This behavior keeps going and going.
In the brief moments that my mqtt client SEEMS to be connected, I try to send an MQTT package into it, but nothing is being received by TinyGSM (and PubSubClient).
It is to be noted that this same hardware works flawlessly with my own code (I did implement the at commands, and then the mqtt protocol itself, in order to connect, publish, subscribe and receive packets). SO I know that the Gsm modem works fine, my gsm sim data plan is OK, and my remote Linux based Mosquitto broker is working fine too.
I could go on using my own code, but if I managed to get TinyGSM / PubSubClient working, it would be a tremendous simplification (way easier to manage and upgrade) than my custom code. So I really want this to work.
Any ideas or help are appreciated a lot!
Euquiq