I have implemented the code similar to this tutorial https://www.youtube.com/watch?v=5FbafyVvN3E but have used different cloud address and port and have used sim800c module in a custom board with ATMEGA328-PU MCU. I m sending data of AT Commands: AT+CBC and AT+CNETSCAN.
In addition, Similarly, I have implemented a basic TCP protocol for sending the same data . I have observed that the power consumption of the MQTT protocol is 50% lesser than the TCP protocol.
I would like to know the cause of the power optimization as the implementation of the MQTT protocol looks very similar to the normal TCP protocol. Please help me as I m not able to understand the difference between them.
The power consumption jumps up when you send data. In MQTT you send very less data and it goes back to idle state. In TCP also you should get same results. But if you are transmitting more data repeatedly then you might see more consumption. There is no difference as both are just sending data over a open TCP connection.
Do you mean that after every time we publish to a specific topic in MQTT , it goes back to idle state? and Can we send data multiple times in tcp by using AT+CIPSEND as we do in MQTT.
If you close the TCP connection it goes back to idle state. or it will stay connected consuming more current.