Home > database >  Read the data from serial port mysql?
Read the data from serial port mysql?

Time:09-17

Novice, there is a demand: the temperature and humidity of the zigbee board to collect data from serial port input, but how in the database?

CodePudding user response:

Novice asked a great god!

CodePudding user response:

Itself, MYSQL is a database only, unable to provide direct access to the serial communication interface, the need to write their own procedures to monitor incoming COM from the data, and then inserted into the database,

CodePudding user response:

You should look at the example of the corresponding, mysql API, the temperature and humidity data collected from the serial port input, the need to use C language to the corresponding data into the database,

CodePudding user response:

I'm dizzy,
Opening report to decide, but beginners lost, special method is also so much, not sure what the
Now there are two problems:
1, made of their host made a MySQL server and to receive from the serial port to send data automatically, deposited in the database,
2, the local database, how to become a network database, and then give the app interface,
Before have a idea, the local server mapping a web page, page only valid data in the data, maps to the network, parse the json format provides interface for APP, as a beginner I now don't understand this method on unreliable,
The great god, and to give directions, and there is no professional point? Please help, thank you!

CodePudding user response:

? _? Tomcat Sqlite is what this a few database what's the difference between a web server and the usual what's the difference between the server and watched the recommend a tutorial or something wrong? What's in the socket communication implementation? Novice confused,,

CodePudding user response:

reference 4 floor baidu_29029173 response:
I'm dizzy,
Opening report to decide, but beginners lost, special method is also so much, not sure what the
Now there are two problems:
1, made of their host made a MySQL server and to receive from the serial port to send data automatically, deposited in the database,
2, the local database, how to become a network database, and then give the app interface,
Before have a idea, the local server mapping a web page, page only valid data in the data, maps to the network, parse the json format provides interface for APP, as a beginner I now don't understand this method on unreliable,
The great god, and to give directions, and there is no professional point? Please help, thank you!

For 1: can be made on an external network, peanut shells can access, mysql is port 3306,
2: mysql is port 3306, you can access, provide app interface, is Java development has a corresponding interface,

CodePudding user response:

Ok, then I can according to this methodology.
Thank you to solve!

CodePudding user response:

I use Java a serial port communication, you need to import the RTXX. Jars, realize the serial communication, serial data read in print to the console, if is the results you need, you can operate the ah, into an array, in addition, I read it is problematic, as follows: when I read it is characters, for example, 23, read out is received 2, then just received 3, there is a space, the reason is the c language without string type, all, you need to read in the data processing can be deposited in the mysql database, the easiest way to even to read all the data in an array, including Spaces in the array, also through the array subscript, pieced together again, finally can use the conventional database operations in the,
  • Related