问题
I designed a web page with PHP, the data can be read from database including lat, long, speed and it displays the data on a map. I have a MVT380 tracker that I can set IP and port on, so the data through GPRS can be sent to these IP and port.
The problem is how to read the data and save it in database (is there any special hardware that can read the sent data to these IP and port and save it to database? or should we design a web page that can read the data through GET/POST protocol and save it to database?). Is there any other way?
回答1:
I had exactly the same question: How to receive GPS data from device with PHP?
After a little struggle this is what I got:
For a gps tracker device that sends TCP/UDP data to an ip address and port we really need a server. There will be no POST/GET data. The server will receive data through a port that needs to be decoded. But it was not as complicated as I thought. Even without any knowledge of Java I was able to install a software and manipulate it to my liking.
What I did:
Got a windows server (2012) hosting (6 months for free) so I could try it out. Downloaded opengts and followed their instruction manual exactly. And did not find it hard at all. It worked without having much headache Once I got to the part where everything was working I could play around with the device and it was working fine. Ofcourse we need to know the protocol (the data) that the device is sending and decode so it can be saved in the database.
回答2:
maybe i didnt say it clearly, let me put it differently--the data is sent through Internet--. i've got a GPS with GPRS module, that IP and port can be set on it and this device sends lat, long to these IP and port.the problem is i dont know how to read data and save it to database(the real deal is how to read the sent data to IP and port). IP and port of my server are those which are set in gps
来源:https://stackoverflow.com/questions/24173244/how-to-get-data-from-gps-and-send-to-server-and-how-save-to-database