gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: need help: have issues with gpsd-client under python


From: Beta Tester
Subject: Re: Re: need help: have issues with gpsd-client under python
Date: Thu, 30 Jun 2022 18:42:27 +0200

hi Jon, you are absolutely right, my SLEEP_LOOP values are way too high.
this explains, why i have way more trouble with gpsd 3.24 than with older 
versions. gpsd 3.24 send way more frequently records with less filled 
informations. gpsd 3.23 and older were sending less records but with more 
filled information.

i changed the SLEEP_LOOP values in my code.

and now the application survives longer under gpsd 3.24. test still running.


i am interested only in `TPV` and `SKY` data. all others i ignore.


i watched the debug output on the gpsd-server side and there it appears the 
message:
gpsd:WARN: client(0) has vanished.
gpsd:INFO: detaching 192.168.1.2 (sub 0, fd 7) in detach_client
after that, the gpsd-client starts to go crazy....

i forgot to tell, that the WiFi connection between the router and the 
gpsd-servers are very poor.

i soldered an external WiFi antenna connector to the RPi Zero W - what a 
nightmare to solder.
now i also have a better WiFi signal as well.


will see if what issues are solved now...


> Gesendet: Donnerstag, 30. Juni 2022 um 14:44 Uhr
> Von: "Jon Schlueter" <jon.schlueter@gmail.com>
> An: "Beta Tester" <alpha-beta-release@gmx.net>
> Cc: "gpsd users" <gpsd-users@nongnu.org>
> Betreff: Re: need help: have issues with gpsd-client under python
>
> so, one thing to keep in mind is that the number of messages you
> receive back in a given second will vary.
>
> I see a LOOP_SLEEP = 0.25
> With that it will at most process 4 messages from your GPS per second
>
> try adding a debug message or logging message for what messages are received
> https://github.com/beta-tester/python-gpsd-client/blob/main/gps_issue.py#L413
>
> you may be getting other messages than sky or tvp and not updating anything.
>
> On Thu, Jun 30, 2022 at 6:55 AM Beta Tester <alpha-beta-release@gmx.net> 
> wrote:
> >
> > hi, i have several issues with gpsd under python.
> > i have two Raspberry Pi Zero W (rev.1.3) acting as gpsd-server (via WiFi, 
> > HOST_1:192.168.1.7 & HOST_2:192.168.1.8) with an GPS device on each 
> > connected via serial port on GPIO.
> > and i have a Raspberry Pi 4 acting as gpsd-client (via LAN-cable, 
> > IP:192.168.1.2) to collect and store gps data from both gpsd-servers.
> >
> > the gpsd-client is made in python:
> > two threads are running `gps.gpd(host=HOST_1)`, `gps.gpd(host=HOST_2)` to 
> > collect gps data of interest (`TPV`,`SKY`) and make a copy of it (with 
> > transforming nested dictwrapper to dict) and put the data to a queue.
> > another thread is taking the data from the queue and store them to a 
> > in-memory database first and every 10 minutes it store the data from the 
> > in-memory database to a file and clean the in-memory database and it starts 
> > a script that uses the data from the database file to publish the data for 
> > a local webpage.
> >
> > everything works well except:
> >
> > 1. `gps.next()` seems to get crazy from time to time in two ways.
> >    case 1: `gps.next()` blocks forever and never returns.
> >    case 2: `gpd.next()` returns the same gps record repeatly over and over.
> >
> > 2. because `gps.next()` or `gps.read()` blocks the thread, is there a way 
> > to set a timeout to get back control to the loop?
> >    or is there a non-blocking way to see if there are data in `gps.gps()` 
> > before entrering the blocking `gps.next()` or `gps.read()`?
> >
> > 3. when starting with `gps.gps(reconnect=True)`, when does a reconnect 
> > happen? i cannot see any difference between reconnect enabled or disabled.
> >    e.g., the gpsd-servers powers off and powers on again, 
> > gps.gps(reconnect=True) does not come back receiving gps data.
> >
> > 4. not every time i get a `StopIteration` exception, then the gpsd-server 
> > goes down while `gps.next()`.
> >
> > on all Raspberry Pi's there is the newest RasPiOS Bullseye installed and is 
> > full updated.
> > on all RPi's i tried the debian distribution of gpsd v3.22 and i compiled 
> > gpsd `release-3.22`, `release-3.23`, `release-3.24` and `3.24.1-dev` from 
> > source code.
> > all RPi's (gpsd-servers/-clients) were always on the same version of gpsd.
> > the gpsd v3.24 shows up the issue quicker than v3.23
> >
> > on the gpsd-server on the RPi ZeroW i run `gpsd -D 5 -G -N -n -s 115200 
> > /dev/ttyAMA0 2>&1 | tee /tmp/test-gpsd.txt` as root
> >
> > do i something wrong in the two gpsd-client threads?
> > maybe the RPi Zero W with its single core CPU is too weak to handle a 
> > gpsd-client?
> >
> > the link to the python source code i use, in case someone will watch the 
> > code to point me, what i am doing wrong there:
> > https://github.com/beta-tester/python-gpsd-client/blob/main/gps_issue.py
> >
> > PS.: i know `gpsplot` exists. i just want to know what is going wrong in my 
> > application.
> >
> > thank you in advanced.
> >
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]