CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

How to put data into the database using serial communication

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
seyoung



Joined: 11 Nov 2016
Posts: 8

View user's profile Send private message Send e-mail

How to put data into the database using serial communication
PostPosted: Wed May 17, 2017 6:22 am     Reply with quote

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: 9097
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed May 17, 2017 2:20 pm     Reply with quote

'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

View user's profile Send private message Send e-mail

PostPosted: Wed May 17, 2017 7:42 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed May 17, 2017 11:06 pm     Reply with quote

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: 19215

View user's profile Send private message

PostPosted: Thu May 18, 2017 12:06 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group