Common communication methods in the Internet of Things

Two-way communication

Usually the serial port on the PC is a full-duplex device, which means it can send and receive data at the same time. To do this, it uses separate lines to send and receive data. Some types of serial devices only support one- way communication, so only two wires are used in the cable, the transmission wire and the signal ground wire. Some people’s industrial IoT communication equipment is a two-way communication equipment, such as the common serial port server USR-TCP232-410s, industrial router USR-G806, DTU device USR-G780 V2 and other equipment.

Communicate point by point

After sending the start bit, the transmitter sends the actual data bits. Depending on the number selected, there may be 5, 6, 7 or 8 data bits. Both the receiver and transmitter must agree on the number of data bits as well as the baud rate. Almost all devices use 7 or 8 data bits to transmit data.

Note that ASCII values ​​greater than 127 cannot be sent when using only 7 data bits. Again, using 5 bits limits the maximum possible value to 31. After data is sent, a stop bit is sent. The stop bit has a value of 1 (or flag status), and the stop bit is detected correctly even if the previous data bit also has a value of 1. This is accomplished by the duration of the stop bit. Stop bits can be 1, 1.5, or 2 bit periods in length.

parity bit

In addition to the synchronization provided by the use of start and stop bits, there is an option to send an additional bit called a parity bit with the data. The parity bit provides a small amount of error checking to help detect data corruption that may occur during transmission. You can choose even parity, odd parity, marked parity, spatial parity or none at all. When using even or odd parity, the number of tags (logical 1 bits) in each data byte is counted and a bit is sent after the data bit to indicate whether the number of 1 bits just sent is an even or odd number.

For example, when even parity is selected, the parity bit is sent with a value of 0 if the number of preceding tags is even. For the binary value 0110 0011, the parity bit will be 0. If even parity is valid and the binary number 1101 0110 is sent, the parity bit will be 1. Odd parity is just the opposite, the parity bit is 0 when the number of tag bits in the previous word is an odd number. Parity error checking is very basic. While it will tell you if there is a single bit error in the character, it will not show which bit was received in error. Likewise, if an even number of bits are in error, the parity bits will not reflect any errors at all.

Mark parity means always setting the parity bit to mark signal condition, similarly space parity always sends parity bit in space signal condition. Since these two parity options are useless, they are almost never used.

RS-232C

RS-232 stands for Recommended Standard Number 232, and C is the latest version of the standard. Serial ports on most computers use a subset of the RS-232C standard. The full RS-232C standard specifies a 25-pin “D” connector , of which 22 pins are used. Most of these pins are not required for normal PC communication, and in fact, most new PCs come with a male D-type connector that only has 9 pins.

DCE and DTE equipment

DTE and DCE are two common terms in the Internet of Things. DTE stands for data terminal equipment and DCE stands for data communications equipment. These terms are used to indicate the pinout of a connector on a device and the direction of signals on the pins. Your computer is a DTE device, while most other devices are usually DCE devices.

If you have trouble keeping the two connected in a straight line, replace the term “DTE device” with “your PC” and the term “DCE device” with “remote device” in the following discussion.

The RS-232 standard specifies that DTE devices use a 25-pin male connector, while DCE devices use a 25-pin female connector. Therefore, you can connect a DTE device to a DCE using a direct pin-to-pin connection. However , to connect two similar devices, you must use a null modem cable instead.

Contatto