I have a bareboard ATMega328PB with a SIM800L GSM modem.
I have two sketches:
Sketch MAIN:
This sketch currently sends data to my server using a UDP connection.
Sketch MQTT:
This sketch send data to my server using MQTT.
I have found that after numerous tests that using UDP to send data to my server my failure rate is very high.
By using MQTT I have found that this is far more reliable and I have zero failures.
On my server, I have a Mosquitto Broker running and by using the "Sketch MQTT" I can see the data reliably.
I need assistance in "Porting" the MQTT sketch into my MAIN sketch - thus replacing all the UDP code with the MQTT code.
@Declan UDP packets are not guaranteed to arrive at their destination. It should be a fairly simple task to switch to using TCP instead. TCP packets will arrive. Far simpler than moving to MQTT and you could probably learn how to do it in a few hours.
I have used a HTTP connection to the server and failure rate was very high, around 61% failures.
Using UDP failure rate was 82%.
Using a Test MQTT sketch, I had zero failures with 1000 transmit.
I have had the UDP to MQTT sketch done by a forum member for EU 50 and it works fantastically well - 728 transmits and zero errors.