tfeldmann / gpsdclient Goto Github PK
View Code? Open in Web Editor NEWA simple gpsd client and python library.
License: MIT License
A simple gpsd client and python library.
License: MIT License
Maybe due to the newly added datetime timezone info.
Connected to gpsd v3.17
Devices: /dev/ttyO4
Mode | Time | Lat | Lon | Track | Speed | Alt | Climb
-----+----------------------+--------------+--------------+--------+--------+-----------+----------
3 | 2022-11-22 10:29:51+00:00 | 51.778967817 | 6.40282045 | 326.31 | 0.0 | 75.874 | 0.0
3 | 2022-11-22 10:29:52+00:00 | 51.778967817 | 6.40282045 | 326.31 | 0.0 | 75.874 | 0.0
OBSERVED
json.loads() can fail on some (valid) output from GPSD
REPRODUCE
Add a NTRIP source to gpsd and it will emit all kind of (valid) data that is not handled correctly by gpsdclient.
CAUSE
GPSD can emit trailing commas in the json data. This will cause the standard python json parser to choke.
See also: https://stackoverflow.com/questions/56592689/python-remove-comma-of-last-object-in-a-string-for-valid-json
PROPOSED FIX
Use json5 or yaml functions to parse the data.
Hello,
I am getting an timeout error when running your source.
Connected to gpsd v3.22
Devices: /dev/ttyS2
timed out
Do you know what may be causing this issue currently?
Seth
Hello,
I had an error of no connection at first. I restarted the gpsd.service and everything works just as stated. Thank you for making this lib. available.
It is working well so far. I got some help from a person on writing to files in your gpsdclient lib. It helps to keep files of specifics.
oh!
Are there any resources you know of currently for porting to .kml files for Google Earth views? I was going to power my device, take a couple miles out of my day to move around w/ the device, and then hopefully put them manually into a .kml file for viewing in Google Earth.
I think the .kml files need to have a specific way of being managed:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Style id="yellowPoly">
<LineStyle>
<color>7f00ffff</color>
<width>4</width>
</LineStyle>
<PolyStyle>
<color>7f00ff00</color>
</PolyStyle>
</Style>
<Placemark><styleUrl>#yellowPoly</styleUrl>
<LineString>
<extrude>1</extrude>
<tesselate>1</tesselate>
<altitudeMode>absolute</altitudeMode>
<coordinates>
# Here are where the coordinates go in "LAT, LON" and etc.
</coordinates>
</LineString></Placemark>
</Document></kml>
I guess I could pipe the results of my .txt file to a .kml file at a particular section in the file.
Seth
P.S. Anyway, if you are good with Python3 and your lib, please let me know if you have an online resource for this particular method of promoting .txt to .kml to Google Earth. Sorry if this is off topic. It can be closed if it is too far off. Thank you.
Hello,
I'm trying to run the following script:
from gpsdclient import GPSDClient
client = GPSDClient(host="127.0.0.1")
for result in client.json_stream():
print(result)
But it gives me always the error
714 if source_address:
715 sock.bind(source_address)
716 sock.connect(sa)
717 # Break explicitly a reference cycle
718 err = None
ConnectionRefusedError: [Errno 61] Connection refused
I try to change the host to '0.0.0.0' but still not working and I do not know how to solve it ???!!!
Any hints for that!!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.