Database writing through GPRS

Hy guys,

I need some advices.
I need to read data from a sensor over Modbus on the UART and send it trough GPRS in a database.
I implemented the reading of the data on UART, and also made a tcp server on port 23(telnet) and managed to send data trough gprs on a tcp/ip client connected on port 23(putty).

My module is : Fastrack Supreme 10
SIM with public Ip address.

Now i need to write these values to a database. What i need to do for that ?Where do i start? Has anyone did this?
I don’t need an application. I need an ideea…what are my options? I’m new to databases but not totally stranger …i implemented some database operation with php and mysql but long ago and not involving embedded systems.

Thanks in advance.

Where is the database?

Draw a diagram!

eg,

+-------------------------+      +------------+
                 |                         |      |            |
TCP Port 23 ---->+  Interface Application  +----->+  Database  |
                 |                         |      |            |
                 +-------------------------+      +------------+

Note that the “interface application” neither knows nor cares how the data reaches its TCP Port 23 - so GPRS and the Fastrack and MODBUS are all irrelevant at this point.

Hi,
However it isn’t a core in this Forum. There are some programming plataforms that provide specially the connector from your application to your database. Then, you have to make or get a program that placed in a computer like a tcp server stay listening a conection from your fastrack and with the previous processing of the received frame write in the database.
Good luck
RF

I was thinking that i might need an interface application to do that…something like C# or visual basic or i don’t know…but i can’t use web services…for example to publish data on a small website and then to write it to a php script in a mysql database?..

Thanks for your answers…

Why not?

sorry…it was with “?” at the end…i thought at this…and here i need an advice…how can i use web services?..i think making a http server on the wavecom modem and somehow with GET method take the values from there and POST these values on a database…is this a correct way of doing it?

You read the documentation for the web service in question, and then implement that!

No! That’s entirely the wrong way around!
You have the web service on the server, and the modem is the Client

So the modem makes GET and POST requests to the server…

Ok… Than i will start reading the documentation for HTTP client and that article from your other postings about : Http made really easy…and maybe with this i will be able to find a solution…

I think i will need to encode the values on the servers URL and call a cgi, php script to parse the url, take the values and post it to the database…
For example :
webserver.com/post.php?value1=x?value2=x….
Correct?

Thanks for your answers…i will come back if i need to…thanks again…

If you’re using an existing web service, you will need to do whatever its documentaion tells you!

That is certainly one way to do it - but by no means the only way!

Im developing this in same way . Try TCP/IP script and send data as

GET /zapis.php?licznik_id=wavecom&stan=321 HTTP/1.1\r\nACCEPT: text/html, application/vnd.wap.xhtml+xml, application/xhtml+xml, text/css, multipart/mixed, text/vnd.wap.wml, application/vnd.wap.wmlc, application/vnd.wap.wmlscriptc, application/java-archive, application/java, application/x-java-archive, text/vnd.sun.j2me.app-descriptor, application/vnd.oma.drm.message, application/vnd.wap.mms-message, application/vnd.wap.sic, text/x-co-desc, application/vnd.oma.dd+xml, text/vnd.nokia.rs-tgd, */*, text/x-vcard, text/x-vcalendar, image/gif, image/vnd.wap.wbmp\r\nUser-Agent: Haodew/1.1\r\nHost: 220.181.37.183:80\r\nConnection: keep-alive\r\n\r\n";

and put in remote host ip of your server

GET /zapis.php?licznik_id=wavecom&stan=321

where /zapis.php is php file (/folder1/folder2/folder3/file.php) if you use domain you probably need to use
/home/~user/public_html/folder1/folder2/file.php

Try to avoid php error to get directory - easiest way (or phpinfo).

When GPRS sent data you can print it:

<?php
 echo($_GET['licznik_'id]);
 echo($_GET['stan']);
?>

or put code to insert data to database.

redgards,
Łukasz