Protocols for IoT System

Thread Starter

Kittu20

Joined Oct 12, 2022
511
Hi there,

I'm interested in understanding programming steps and protocol about how IoT based temperature system would send temperature data to cloud server.

I am explaining general hardware design of an IoT-based temperature system involves with temperature sensor, microcontroller, Ethernet module, Power supply and router.

  1. Temperature sensor: The temperature sensor is the component that measures the temperature in a particular location.
  2. Microcontroller: The microcontroller is the brain of the system that processes the temperature data and sends it to the cloud server.
  3. Ethernet module: The Ethernet module is the component that allows the microcontroller to connect to the internet via a wired Ethernet connection.
  4. Router: The router is the component that connects the Ethernet module to the internet.

I've been trying to understand fundamental, but I'm not quite grasping some of the concepts and how they relate to the functionality of the system.

I'm hoping you could help me better understand some of the programming steps and protocol and how it relates to the system.

I was wondering if we need to use the either TCP/IP protocol or the HTTP or Both protocol to send the data to servers.

Can you clarify which protocol is needed?

Thank you!"
 

Thread Starter

Kittu20

Joined Oct 12, 2022
511
is this your homework assignment? then ask your teacher
Hello,
I've been having some difficulty understanding certain fundamental concepts in protocol connectivity for IoT system, and I was wondering if someone might be able to help me out. Just to be clear, this isn't related to any specific homework assignment - I just want to make sure I have a solid understanding of the basics before moving on to more complex topics.

Would you be willing to offer some guidance or point me in the right direction? Any help would be greatly appreciated.

Thank you!"
 

Ya’akov

Joined Jan 27, 2019
10,226
I think you would benefit from stepping back and learning something about network protocols in general. Your question suggests you haven't really understood what a protocol is and how to evaluate their attributes.

Protocols occur at various levels in the network stack. The OSI Network Model is an attempt to delineate these levels and can be very useful in understanding protocols though it is a theoretical model whose layers are often not so neatly separated as the seven it calls out. They are often combined for practical reasons.

Nonetheless, your questions are confusing because you are confused. Do some reading on network protocols before you try to understand how they work together. the truth is, this is much simpler than you are making it—at least at the level you are asking about.

For example, TCP/IP and HTTP are not commensurate. TCP/IP is a transport layer protocol while HTTP application layer protocol. They are far apart on the stack. HTTP depends on a protocol like TCP/IP to operate. You can't choose between them.

For IoT, it is very likely that MQTT rather than HTTP would be used for sensor data. It could also be something like XMPP or CoAPP. HTTP would be a poor choice, though it could be used. It has far more overhead than is needed or desirable for IoT devices which could have limited power and bandwidth.

This article seems like a good introduction to MQTT for you, and it includes context with TCP so it’s not so abstract as something entirely about network models will be. Read it carefully and be sure you understand everything. Then if you have any questions they will be answerable ones that make some sense.
 
Last edited:

Thread Starter

Kittu20

Joined Oct 12, 2022
511
I think you would benefit from stepping back and learning something about network protocols in general. Your question suggests you haven't really understood what a protocol is and how to evaluate their attributes.
I just want to clarify that I'm asking these questions because I'm still trying to wrap my head around network protocols and how they work.

TCP/IP is the standard communication protocol used for transmitting data over the Internet. It is used to connect devices on the internet.

HTTP (Hypertext Transfer Protocol) is a communication protocol used to transfer data over the internet

I think If the server we're sending data to is using HTTP, then the IoT system would also use HTTP and TCP/IP
 

Ya’akov

Joined Jan 27, 2019
10,226
I just want to clarify that I'm asking these questions because I'm still trying to wrap my head around network protocols and how they work.
OK, but you are not going to wrap your head around anything real if you keep smuggling in incorrect assumptions in framing your questions. I am trying to tell you that your questions are borne of ignorance but you are assuming things that are wrong and basing the questions on that.

TCP/IP is the standard communication protocol used for transmitting data over the Internet. It is used to connect devices on the internet.

HTTP (Hypertext Transfer Protocol) is a communication protocol used to transfer data over the internet
What is a “communications protocol“ in this context? Where does that term come from?

TCP/IP is a catch-all name for a suite of protocols originally developed for ARPANET¹ (which later became DARPANET, and eventually “the Internet” of today). The TCP/IP protocol suite includes both connection-based and connectionless protocols, so it doesn’t necessarily connect computers.

This may seem to be a picky point, but protocols are nothing if not a carefully crafted collection of picky points and “connection” has technical meanings so if you want to understand what is going on, don’t mixed common meanings with technical ones or you will go off the rails very quickly.

HTTP is surely an Internet protocol but it is one of many, why did you choose it? Why not MQTT, or XMPP, or CoAPP? Remember you framed your question as one about IoT sensor data, not web pages or an API, or something else.

You are asking about a very specific scenario then choosing elements that are arbitrarily connected to it.

I think If the server we're sending data to is using HTTP, then the IoT system would also use HTTP and TCP/IP
The server doesn’t “use HTTP”, the server runs an http (HTTP Daemon), a program that implements the HTTP protocol and handles things like reading and writing storage or sending the data somewhere else. This is an important distinction.

A server can run and https like NGINX and an MQTT broker like Mosquito at the same time. It’s totally normal to do it. So, you’d have to say “if the httpd is using HTTP (a foregone conclusion) then if it is the server we are sending data to, we’d use HTTP” which is a useless syllogism.

No, we would talk to whatever the application that needs to receive the data uses as its interface to receive data, and that depends on the architecture of the IoT system we are using.

So, start much simpler. If you want to use HTTP as an example of a protocol, start by following the chain of events that happens when a browser attempts to retrieve a web page. There are a lot of steps there that are a good model for anything else you want to know.

Some of them are common to many other protocols, some are specific to certain kinds, and some to HTTP itself. Nonetheless, it is a much better thing to explore than your example which you simply don’t know enough to ask about.

If fully explored, question will touch on IP stacks on the computers, ARP, DNS, BGP, TCP, IP, HTTP, HTML, and others. It’s an effectively bottomless pit you can return to over and over as you try to unravel the layers of the OSI network model.

1. Mandatory reading for anyone who really wants to understand the Internet is RFC1000 written by Joyce Reynolds and Jon Postel in 1987.
 

Thread Starter

Kittu20

Joined Oct 12, 2022
511
OK, but you are not going to wrap your head around anything real if you keep smuggling in incorrect assumptions in framing your questions. I am trying to tell you that your questions are borne of ignorance but you are assuming things that are wrong and basing the questions on that.
In context of my hardware design. Which protocols would you use if you want to send temperature data to cloud server from anywhere outside the world and if cloud server uses http protocol?

You will need an internet connection to send data to the cloud server. This could be through a Ethernet network, Wi-Fi network, a cellular network.

Once you are connected to the internet, you will need to establish a TCP/IP connection with the cloud server. This involves sending a request to the server to initiate a connection and waiting for the server to respond. Once the connection is established, you can start transmitting data.

TCP/IP is a suite of protocols that operates at the network layer (Layer 3) and transport layer (Layer 4) of the communication stack. It provides the protocols for addressing, routing, and transmitting data packets over a network. This includes the Internet Protocol (IP), which is responsible for addressing and routing packets across the internet, and the Transmission Control Protocol (TCP), which provides reliable transmission.

Overall, sending temperature data to a cloud server requires a combination of TCP/IP protocol and HTTP protocol because server using the HTTP protocol
 

Ya’akov

Joined Jan 27, 2019
10,226
In context of my hardware design. Which protocols would you use if you want to send temperature data to cloud server from anywhere outside the world and if cloud server uses http protocol?

You will need an internet connection to send data to the cloud server. This could be through a Ethernet network, Wi-Fi network, a cellular network.

Once you are connected to the internet, you will need to establish a TCP/IP connection with the cloud server. This involves sending a request to the server to initiate a connection and waiting for the server to respond. Once the connection is established, you can start transmitting data.

TCP/IP is a suite of protocols that operates at the network layer (Layer 3) and transport layer (Layer 4) of the communication stack. It provides the protocols for addressing, routing, and transmitting data packets over a network. This includes the Internet Protocol (IP), which is responsible for addressing and routing packets across the internet, and the Transmission Control Protocol (TCP), which provides reliable transmission.

Overall, sending temperature data to a cloud server requires a combination of TCP/IP protocol and HTTP protocol because server using the HTTP protocol
This is muddled. I’m sorry but we just don’t connect. Good luck with whatever it is you are doing.
 

trebla

Joined Jun 29, 2019
599
In context of my hardware design. Which protocols would you use if you want to send temperature data to cloud server from anywhere outside the world and if cloud server uses http protocol?
In hardware perspective, you must have in your design some processor (MCU or CPU) and a ethernet or wifi transceiver. These tranceivers handle physical link layer connection protocols to your local gateway or router. Then you must implement IP, UDP or TCP protocols in the MCU (CPU) software. IP protocol handles internet adressing protocols, UDP and TCP handles data transport protocols. For HTTP data is better use the TCP protocol over IP instead of UDP. But if you want only send temperature data to server then you don't need http protocol on your sensor side. So better is configure your server to receive temperature data from sensor over some simpler protocol and then present processed data (as formatted text or graph) to users via web server using HTTP protocol so all the graphical processing is done in server. For connecting sensors to cloud servers is more convient (and secure) way to use MQTT protocol over TCP/IP.
 
Top