Arduino MQTT code for SIM800L module - Working :)


#1

Hi Ravi,

Thanks for the quick response earlier today.

I incorporated the code into my already existing error handling code.

the modem connects to the server but the connection is closed immediately as per this video

the code I am using can be found in a repository Here

Kindly let me know what could be wrong with the code since it worked with sim900 in Ravi’s Tutorial.
Regards


MQTT TCP connection getting closed using SIM800 with PIC18F4620
MQTT TCP connection getting closed using SIM800 with PIC18F4620
Problem while receiving packets from cloudmqtt.com to Arduino
#2

I am seeing no gap between CIPSEND commands. One command is sent before another is finished.
Add a delay and try. Also put some delay after TCP connection is opened and then send the connect packet.
To see if packets are formed properly, may be you can tap the UART lines and see in a hex editor.


#3

I figured out the problem. The repository is updated for anyone that may wish to try it out!
Happy coding


#4

Thanks Peter :slight_smile:
Working code link re written by Peter


#5

Hello Peter Sir… I have downloaded the re written code by you on the link mbari_peter / sim800 mqtt-ravi
But when i am compiling it then it shows error that Serial2 is not declared , initTCP not declared… please help


#6

Hello guys
i tried it too, and it gives me an error
“exit status 1 ‘initTCP’ was not declared in this scope”
your replay will be highly appreciated
regards


#7

Same problem with my setup.

“exit status 1 ‘initTCP’ was not declared in this scope”

Please help!