5 thoughts on “How to use sockets properly to reduce latency”
We have a microcontrontroller which gathers data from a number of sensors in a system. This data, typically in chunks of 100-200 bytes 5 times per second, is packaged into Protobuf format and sent to a GL865 chip to be posted to a web page. This modem runs some Python scripts which are, among other things, intended to send this data along to a web server using HTTP POST.
Now, after reading the manual I see that there are several ways of establishing and using a socket, and I’m not sure which way to go. What is the best approach (command mode, online mode, dual MDM…) for achieving a low delay from receiving a data block to completing a HTTP POST request? Is there anything else I should think about such as trying to stay connected as long as possible in some way?
New to socket programming in general 🙂
I would say to try first the HTTP client dedicated AT commands, AT#HTTPCFG and AT#HTTPSND.
Interesting! I was looking in the r15 version of the manual where those commands dind’t exist. They will probably make my life a whole lot easier. Thanks!
We’re currently looking into these commands, but do you know if it’s possible to use multiple custom header lines or are you restricted to just one?
Hi Marco,
currently the limitation of extra headers is 100bytes.
Please note that you need the latest 10.00.xx7 to use these commands.
We use cookies to enhance your browsing experience and help us improve our websites. To improve our website, we carefully select third parties that use cookies to allow us to serve specific content and achieve the purposes set out in our cookie policy. For more information on how to make adjustments through your browser to the cookies being used on your device, please click Find Out More link. By closing this banner or continuing to browse our website, you agree to our use of such cookies. FIND OUT MORE
We have a microcontrontroller which gathers data from a number of sensors in a system. This data, typically in chunks of 100-200 bytes 5 times per second, is packaged into Protobuf format and sent to a GL865 chip to be posted to a web page. This modem runs some Python scripts which are, among other things, intended to send this data along to a web server using HTTP POST.
Now, after reading the manual I see that there are several ways of establishing and using a socket, and I’m not sure which way to go. What is the best approach (command mode, online mode, dual MDM…) for achieving a low delay from receiving a data block to completing a HTTP POST request? Is there anything else I should think about such as trying to stay connected as long as possible in some way?
New to socket programming in general 🙂
I would say to try first the HTTP client dedicated AT commands, AT#HTTPCFG and AT#HTTPSND.
Interesting! I was looking in the r15 version of the manual where those commands dind’t exist. They will probably make my life a whole lot easier. Thanks!
We’re currently looking into these commands, but do you know if it’s possible to use multiple custom header lines or are you restricted to just one?
Hi Marco,
currently the limitation of extra headers is 100bytes.
Please note that you need the latest 10.00.xx7 to use these commands.