FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
1,939 views 7 comments
by
I'm trying to send coordinates from a RUT850 to a MySQL Database.

I set up a PHP (or HTML) page on my server that should receive the coordinates and upload to the DB via queries.

If i set the HTTP/HTTPS server address on the RUT850, how do I read RUT850 data? Are they sent via POST or GET (or something else)?

1 Answer

0 votes
by anonymous

Hello,

Sorry for late response,

If you are talking about Services > GPS > HTTPS configuration, then information is being set via POST messages to yours HTTP(S) server.

Best regards,
VidasKac.

by
Ok, thank you for the answer

However i'm trying to retrieve these data via $_POST on a PHP page but i cannot get it to work.

After enabling the "HTTPS Server Settings" and setting the server address ("IP_address/directory/page.php"), should i enable something else in order to send data?

Also, $_POST is an associative array, so what are the names of the data?
by anonymous

Hello,

You should only need to enable GPS and choose Satelite Configuration in Services > GPS > General tab, and then Enable and enter URL in Services > GPS > HTTPS you should check if yours server is not dropping packets incoming from Router for some reason.

Names of the data is respectively names of NMEA sentences that are being sent, here is an example of how it would look:

You can also check which side s responsible, by simply connecting yours pc/laptop to a router and running application like Hercules  to act as a TCP server and check if router sends out data.

Best regards,
VidasKac.

by
Hello,

I've tried to run Hercules and listen on TCP port 80, the result was successful.

When I try to send data to the server however, POST array length remains 0.

Maybe the content-type is not recognized?

Thank you.
by anonymous
Hello,

So at server side it receives connection router, but it shows that content length is 0?

Do you have any way to troubleshoot server side, since as you said, you did confirm that router sends out GPS data. If you could use tcpdump on router and on server side, you could see if router sends out information but server does not recognize it, or router is sending empty packets.

Best regards,
VidasKac.
by

Hello, 

the content length is 803, here is a sample data (received on Hercules):

POST /?imei=865546040689768&serial_num=1104633324 HTTP/1.1

Host: 192.168.1.112

Accept: */*

Content-Type: application/vnd.teltonika.nmea

Content-Length: 803

$GPGSA,A,2,08,10,15,16,18,20,21,26,27,,,,1.1,0.9,0.7*3E

$PQGSA,A,2,06,13,14,16,27,28,,,,,,,1.1,0.9,0.7,4*3A

$PQGSA,A,2,,,,,,,,,,,,,1.1,0.9,0.7,5*32

$GPGSV,4,1,13,07,01,322,34,08,21,300,28,10,55,151,43,15,07,052,30*7A

$GPGSV,4,2,13,16,64,243,30,18,31,056,43,20,58,080,31,21,65,036,39*7B

$GPGSV,4,3,13,26,41,188,21,27,54,313,39,11,01,270,,41,,,40*45

$GPGSV,4,4,13,49,,,37*72

$PQGSV,3,1,10,02,07,102,36,05,25,123,36,06,09,066,37,09,07,094,37,0,4*60

$PQGSV,3,2,10,13,10,057,30,14,30,059,42,16,11,071,40,27,49,300,32,0,4*6A

$PQGSV,3,3,10,28,61,060,42,30,00,282,,0,4*6C

$GPGGA,124341.00,4126.958143,N,01534.410124,E,1,09,0.9,71.0,M,41.0,M,,*5C

$GPVTG,206.3,T,205.1,M,0.0,N,0.0,K,A*22

$GPRMC,124341.00,A,4126.958143,N,01534.410124,E,0.0,206.3,220620,1.2,E,A*36

$PTLTIO,9,65535*13

$PTLTIO,1,0*1b

$PTLTIO,2,0*18

the PHP page is programmed to receive both GET and POST packages and query to an SQL server, the result is shown below:
As you can see, i can receive both IMEI and Serial by GET but POST array length is 0. I think this problem comes from the server and not the router, so thank you anyway. 
by

Hello,

I solved by reading the raw incoming data in the following way:

$rawdata = file_get_contents("php://input");

this return a single string containing all the POST data.

Thank you anyway

by anonymous
Could you please provide us your solution. I want to store the gps data also in a db. Thanks for your help