Home > OS >  Linux host how to use a serial port receives the data, and parses the serial data to computer school
Linux host how to use a serial port receives the data, and parses the serial data to computer school

Time:10-01

Ever, understand this, Windows can write small software, realize the purpose, the Linux how could the simplest implementation purposes, Linux small white, super terminal will only some simple review instructions

CodePudding user response:

Under Linux is a serial port tools, can read through serial port tools to the data of serial port equipment, if need to parse the data, then the Windows need additional coding, Linux also requires additional coding,

CodePudding user response:

reference 1st floor weixin_40290083 response:
under Linux is a serial port tools, data can be read through serial port tools to a serial port equipment, if need to parse the data, then the Windows need additional coding, Linux also requires additional coding,

My contact is Linux system without a graphical interface, this can only be accessed through the super terminal Settings, what method

CodePudding user response:

Linux can use super terminal has a lot of, such as minicom, picocom can via a serial port to connect to the serial port devices, data read and displayed on the screen, but the data is only showed on the screen, these tools to parse data software itself is not achieve them,
To parse the data: 1, you can use the tool reads the data, and then the analytical data by shell solution (should be able to complete),
2, the use of C, Java language such as open serial port programming, serial port data read, parse the data,
3, see your title, via a serial port equipment to update the system time, either way, time serial port and eventually computer setup time is error, it is difficult to do high precision high, difficult because I haven't been level), the reason is that (1) to get data from serial port, parsing time information, update the amount of time spent on the computer time this process is not fixed, (2) serial port to send data every time is not necessarily complete data frames, sometimes a complete data is in the two data, so data parsing is delay, this also leads to the inaccurate of time, I once via a serial port to read GPS time information, several sets of test equipment shows that the difference in time up to 5 seconds,
4, to synchronize time suggest using NTP service,
  • Related