GPS Polling?



  • Hi, Is it possible to poll the gps programmatically - i.e. open a serial port and read the NMEA sentences, or something like gpsd?

    Thanks in advance!


  • Dev Team

    You mean attach an external GPS receiver and talk to it over a UART?


  • Dev Team

    If you don't need to manually sample the hardware, voxl-vision-px4 publishes the GPS data to the file system to /run/mpa/vvpx4_gps_raw_int in our MPA format. You can use voxl-inspect-gps to see a viewer friendly terminal output displaying current gps information, and the source serves as a good example of how you could use the information in a c/++ program on voxl.



  • @Alex-Gardner I dont need to manually sample the hardware and it does not have to be extremely precise, I am looking to essentially use the drone system communicating with the cellular component to read cellular metadata via at commands, then tagging the metadata with the x/y/z points, pushing the data to a webserver while in flight to get near time data for analysis. If there was a api call to pull off the xyz that would be great, if not, I'd like to understand if I can use a script to pull off the gps source. Mind you I am just getting into this system and the various API's. Though as I write this, I have taken a step backwards in that I can sync time so I am struggling with the VPN connection back to the webserver, much less getting wwan0 to pull an IP from the carrier. augh. I am not able to locate the voxl-inspect-gps on my system.


  • Dev Team

    @Chuck-Bokath Yes, we have done the same things before. Basically log a position and signal strength indication. What platform are you using? Typically, in a PX4 system, that information will be encapsulated in Mavlink messages. On our Voxl board we have an endpoint for all of those messages that come over a serial port that we then forward on over UDP to a ground control station. However, as @Alex-Gardner points out, that voxl-vision-px4 module will dump all of that raw information to a Linux pipe as it is passing through. And, as @Alex-Gardner also pointed out, there is some example code that shows how to listen to that pipe and parse the message.



  • @Eric-Katzfey I will take a look and try this.



  • @Eric-Katzfey Ok. I am new to modalai dev environment. What I have currently is a px4 LTE enabled drone with no camera. The drone is simply to be used to test BLOS capabilities. I have not set the dev environment up, a vendor did so, but now its mine to deal with. As mentioned, its a LTE enabled drone with a VPN back to the lab. The VPN fails at times after the LTE connects, because the time is not set, therefore the certificate is not valid. I used voxl-test-time it seemed to set the time correctly. Though I need the time to set on startup is that as simple as adding a service? Once I get that going, I realized that I dont have the voxl-vision-px4 module to extract the GPS off. It seems logical to need a camera for the vision to work? I do have opkg setup and i pulled the most stable repository. Can I pull some packages off the repository that can provide me the pipe you are talking about? I am just not sure which ones. I can always write a quick script to extract the info I need from the pipe.


Log in to reply