Now if you want to achieve the Internet of things communication, need to solve is the next computer and the host computer communication!
While the communication protocol is usually the can protocol or Modbus protocol, and in the actual network process of the various protocols will inevitably appear to expand the number of lower machine limit.
Like Modbus protocol, the lower machine can drag up to 32 devices, special circumstances can drag 256 devices, so this will give the actual cover face network equipment expansion brought great limitations.
Therefore, there is a relatively simple way to solve such problems. In the case of not changing the lower machine, the basic idea is:
1, the lower machine normal use different protocol, such as Modbus-rtu, because it uses the serial port to communicate, so need to set up the next Computer serial communication environment (to not change the original Equipment Foundation!) This is more important)
2, Communication Protocol: Communication protocol is best not to change, this needs to have a to B and a.
3, the host computer: if the actual connection of the serial port is also OK, but the host computer serial resources are limited, and the serial port resources once disconnected, if the host computer program single-threaded, easy to directly die program, the need to re-release the serial resources, the point is not good when the need to restart the computer, very depressed.
4, Communication conversion: Now the most mature communication protocol non-TCP/IP and UDP mo, a face with a connection, a non-connected, the merits. The network communication protocol into the form of serial communication, how good!! Here in C # WinForm programming, the socket provides a lot of convenience. Because of the convenience of networking, communication stability, in the experimental use of the process can be tested to see the rate of packet loss.
5, Hardware solution: Ti Company's CC3200 this chip is still very powerful, support TCP server UDP server, and so on, the focus is to support the transmission, what meaning? That is, you host computer and chip communication is TCP, and the chip will get the data transferred to the on-chip UART, so, the next machine only need to hook up the communication line to the UART resources on the line!
6, socket at the same time can communicate the resources of the network, the next machine through 485 to hang 32 devices, the solution is still very cool! Gives a solution!
I am a small rookie, this article is forbidden to reprint! If you want to reprint, mark the source! Thank you!
IoT Multi-Connection