How in the heck do I do this?
On one side I have a dsPIC30F4013. On the other side, a Linux server with a mySQL data base. The server is hosting web pages so I can input data from a web interface.
I have a DS1812 hooked up to the pic and can pull tempture from it. I would like to get that data into the mySQL data base.
Lets make it a bit harder. The pic is in the middle of nowhere and is solar powered. Yes, that area does have cell covarage, so I am guessing a GSM modem will be needed.
How do I pull this off?
From a PIC to a mySQL data base? How do do that?
The home alarm companies do this with GSM -- or with whoever's cell system they are using.
If they are doing it inside a small monthly alarm fee ... it can not be too expensive.
We have this on a house in Arizona ... which has no wire line phone. I don't recall the price but it is a standard alarm rate. No too much.
You may find some commercial re-seller of this service (other than the cellphone companies) who will put you on their sub-net for a reasonable fee. Perhaps even the alarm companies provide this service as an adjunct .. it would not surprise me.
There are also some 2-way radio communications companies who provide data relay -- including internet interface. Check Motorola in the area of interest. Not sure of the price..
One can, of course, do it themselves if a base station location is possible.
If they are doing it inside a small monthly alarm fee ... it can not be too expensive.
We have this on a house in Arizona ... which has no wire line phone. I don't recall the price but it is a standard alarm rate. No too much.
You may find some commercial re-seller of this service (other than the cellphone companies) who will put you on their sub-net for a reasonable fee. Perhaps even the alarm companies provide this service as an adjunct .. it would not surprise me.
There are also some 2-way radio communications companies who provide data relay -- including internet interface. Check Motorola in the area of interest. Not sure of the price..
One can, of course, do it themselves if a base station location is possible.
Thousand Oaks, CA
Skype Address is: "PatDarden"
Skype Address is: "PatDarden"
Hi DingbatCA,
I made use of a PHP script file on my server that receives data and then passes it to the mySQL database.
A simple script will look something like this
Now when you go to your internet explorer or firefox and type
It will write Hello into the Data field. To do this on the PIC, you will need a GPRS modem such as the Telit GM862, make a simple GPRS connection and then send the following code to the module
Hope this help
Anton
I made use of a PHP script file on my server that receives data and then passes it to the mySQL database.
A simple script will look something like this
Code: Select all
<?php
$db_host = "www.yourhost.com";
$db_user = "your_mysql_username";
$db_pwd = "your_mysql_password";
$db_name = "the_database";
$vdata = $_REQUEST['data'];
mysql_connect($db_host, $db_user, $db_pwd) or die("Unable to connect to database");
mysql_select_db($db_name) or die("Unable to select database");
mysql_query("INSERT INTO YOUR_TABLE (DataID, Data) VALUES ('NULL', '.$vdata.')");
mysql_close();
?>
Code: Select all
http://www.yoursite.com/write2.php?data=Hello
Code: Select all
GET write2.php?data=Hello HTTP/1.1
Host: www.yoursite.com
Connection: close
Anton
Another proud user of LV 24-33A Development System and mikroPascal PRO for dsPIC :)
PortA not working? Add CMCON := 7; PortD not working? Add ADCON1 := 6;
To paste code on the forum, please use the [b] Code [/b] button !! ;)
PortA not working? Add CMCON := 7; PortD not working? Add ADCON1 := 6;
To paste code on the forum, please use the [b] Code [/b] button !! ;)