View previous topic :: View next topic |
Author |
Message |
seyoung
Joined: 11 Nov 2016 Posts: 8
|
How to put data into the database using serial communication |
Posted: Wed May 17, 2017 6:22 am |
|
|
I want to upload data to the server using PIC18F66J10's serial communication.
In fact, I do not know what parts are needed because I do not know much about the server.
We have confirmed that there is no abnormality in connecting the fixed IP, port, and address of oracle server.
Normally, only the data of the pic is input at a predetermined position.
If you know that there are related header files provided by PCW Compiler, or if you have experience similar to what you need to do, please share your experience. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9240 Location: Greensville,Ontario
|
|
Posted: Wed May 17, 2017 2:20 pm |
|
|
'server'..... you'll HAVE to get ALL the details about the 'server' before you even consider cutting C code in the PIC.
'server' can be 100 different things to 99 people... in my situations , 'server' is a 18F46K22 NOT a PC, which is 'probably' what you're calling a 'server'. |
|
|
seyoung
Joined: 11 Nov 2016 Posts: 8
|
|
Posted: Wed May 17, 2017 7:42 pm |
|
|
We want to our data upload to oracle database.
We are currently thinking about is roughly like this:
1. Use 18f67j10's serial communication to send data to wireless converter
( The serial signal is changed to wireless communication such as Wi-Fi or the like.)
2. Connects to a specific port on the Oracle server using wireless
communication and stores the data.
3. Import data from the Oracle server onto the web or app.
Now I am trying to do step 1. |
|
|
alyeomans
Joined: 26 Feb 2014 Posts: 24
|
|
Posted: Wed May 17, 2017 11:06 pm |
|
|
The way I load data into our MySQL database is through a VB program. The program reads the serial input, parses the data then connects to the database and loads the data in an SQL statement.
Another way I have used is a webserver loaded with PHP and a MySQL database. The wifi/web modem would send data by HTTP post and the PHP script would then load into the database.
There are a number of programming language combinations that will work however you will need some PC/server software to interpret the data first.
Cheers
Al _________________ I type therefore I press buttons |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Thu May 18, 2017 12:06 am |
|
|
This is all down to the interface program at the server.
Currently do it several different ways.
#1 server offers an HTTPS interface. Remote logger talks to this using GSM.
#2 server has an ftp port available. Downside here is security, depending on the actual network being used to make the connection.
#3 server had a 'port' machine on the network, that accepts data from a simple serial port, in a proprietary CSV format, and then forwards this to the server.
#4 Remote machine writes directly to a file on a separate machine. The database program checks at intervals if this has been updated, and contains a complete data block, and if so, imports it to the database. Nice thing here is the interface code only has 'write' access to the single directory. The file format includes validation bytes, and a checksum, so data can be cleanly verified before import. |
|
|
|