recv call blocking in gps.py

Bug #850494 reported by sqqqrly
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gpsd
New
Undecided
Unassigned

Bug Description

I am trying to use /usr/share/pyshared/gps/gps.py. I have gpsd running (gpsd -N -D8). A Garmin GPS is connected to ttyUSB0 via the devices serial output with a serial/usb converter. Using Mint 10, 64-bit on a vmware virtual machine. Host machine is ubuntu mav 64 bit. Running gpsd version 2.94 (revision 2010-05-17T16:11:43) on mint and mav. This problem happens every time tested.

When I run gps.py, it connects to gpsd, prints three lines (version, devices, and watch), and then blocks on recv, line 74 of client.py.

When I repeat this exercise on Ubuntu Mav, I get gps data streaming correctly.
On Mint, I also tried cpgs. It too fails, but with only the devices line. xgps displays the version line.

I next ran Mint:gpsd with -G option added (INADDR_ANY) and connected from Mav using cgps. Only initial preamble received. With -G, mint's cgps still fails.

Finally I ran gpsd on mav and cgps on mint. cgps failed to connect at all.

Here is the output of gpsd (mint) showing gps.py connecting:
mint dev # gpsd -N -D8 /dev/ttyUSB0
gpsd: launching (Version 2.94)
gpsd: opening IPv4 socket
gpsd: passivesock_af() -> 3
gpsd: opening IPv6 socket
gpsd: passivesock_af() -> 4
gpsd: listening on port gpsd
gpsd: NTPD shmat(0,0,0) succeeded, segment 0
gpsd: NTPD shmat(32769,0,0) succeeded, segment 1
gpsd: NTPD shmat(65538,0,0) succeeded, segment 2
gpsd: NTPD shmat(98307,0,0) succeeded, segment 3
gpsd: successfully connected to the DBUS system bus
gpsd: running with effective group ID 0
gpsd: running with effective user ID 0
gpsd: stashing device /dev/ttyUSB0 at slot 0
gpsd: select() {3 4} -> {} at 1316041274.798542
gpsd: select() {3 4} -> { 3 } at 1316041275.523800
gpsd: client 127.0.0.1 (0) connect on fd 6
gpsd: => client(0): {"class":"VERSION","release":"2.94","rev":"2010-05-17T16:11:43","proto_major":3,"proto_minor":2}
gpsd: select() {3 4 6} -> { 6 } at 1316041275.523942
gpsd: checking client(0)
gpsd: <= client(0): ?WATCH={"enable":true,"json":true}
json: json_read_object() sees '{"enable":true,"json":true}
'
json: Target address for class (offset 0) is (nil)
json: Target address for enable (offset 0) is 0x60b6f0
json: Target address for scaled (offset 0) is 0x60b6f8
json: Target address for timing (offset 0) is 0x60b6f9
json: Target address for device (offset 0) is 0x60b6fa
json: JSON parse of '{"enable":true,"json":true}
' begins.
json: State init , looking at '{' (0x7fff1d7a9497)
json: State await_attr , looking at '"' (0x7fff1d7a9498)
json: State in_attr , looking at 'e' (0x7fff1d7a9499)
json: State in_attr , looking at 'n' (0x7fff1d7a949a)
json: State in_attr , looking at 'a' (0x7fff1d7a949b)
json: State in_attr , looking at 'b' (0x7fff1d7a949c)
json: State in_attr , looking at 'l' (0x7fff1d7a949d)
json: State in_attr , looking at 'e' (0x7fff1d7a949e)
json: State in_attr , looking at '"' (0x7fff1d7a949f)
json: Collected attribute name enable
json: State await_value , looking at ':' (0x7fff1d7a94a0)
json: State await_value , looking at 't' (0x7fff1d7a94a1)
json: State in_val_token , looking at 'r' (0x7fff1d7a94a2)
json: State in_val_token , looking at 'u' (0x7fff1d7a94a3)
json: State in_val_token , looking at 'e' (0x7fff1d7a94a4)
json: State in_val_token , looking at ',' (0x7fff1d7a94a5)
json: Collected token value true.
json: State post_val , looking at ',' (0x7fff1d7a94a5)
json: Target address for enable (offset 0) is 0x60b6f0
json: State await_attr , looking at '"' (0x7fff1d7a94a6)
json: State in_attr , looking at 'j' (0x7fff1d7a94a7)
json: State in_attr , looking at 's' (0x7fff1d7a94a8)
json: State in_attr , looking at 'o' (0x7fff1d7a94a9)
json: State in_attr , looking at 'n' (0x7fff1d7a94aa)
json: State in_attr , looking at '"' (0x7fff1d7a94ab)
json: Collected attribute name json
json: State await_value , looking at ':' (0x7fff1d7a94ac)
json: State await_value , looking at 't' (0x7fff1d7a94ad)
json: State in_val_token , looking at 'r' (0x7fff1d7a94ae)
json: State in_val_token , looking at 'u' (0x7fff1d7a94af)
json: State in_val_token , looking at 'e' (0x7fff1d7a94b0)
json: State in_val_token , looking at '}' (0x7fff1d7a94b1)
json: Collected token value true.
json: State post_val , looking at '}' (0x7fff1d7a94b1)
json: Target address for json (offset 0) is 0x60b6f1
json: JSON parse ends.
gpsd: opening GPS data source type 3 at '/dev/ttyUSB0'
gpsd: speed 9600, 8N1
gpsd: => GPS: 2450415348512c5249442a32380d0a
gpsd: => GPS: @F0.3=1*67
gpsd: => GPS: @F2.2=1*64
gpsd: writing oncore control type Cj:4040436a290d0a
gpsd: => GPS: 4040436a290d0a
gpsd: Navcom: command dump: 0299661c0800040200001203
gpsd: => GPS: 0299661c0800040200001203
gpsd: Navcom: sent command 0x1c (Test Support Block)
gpsd: Navcom: command 0x1c mode = 02, length = 0
gpsd: Navcom: command dump: 029966200e000001ae02000071000000f203
gpsd: => GPS: 029966200e000001ae02000071000000f203
gpsd: Navcom: sent command 0x20 (Data Request) - data block id = ae at rate 00
gpsd: Navcom: command dump: 029966200e00000186020a0071000000d003
gpsd: => GPS: 029966200e00000186020a0071000000d003
gpsd: Navcom: sent command 0x20 (Data Request) - data block id = 86 at rate 0a
gpsd: writing superstar2 control type 63 len 14:013fc008554750532d3030300403
gpsd: => GPS: 013fc008554750532d3030300403
gpsd: writing superstar2 control type 45 len 6:012dd2000001
gpsd: => GPS: 012dd2000001
gpsd: open(/dev/ttyUSB0) -> 7 in gpsd_open()
gpsd: Garmin: garmin_gps Linux USB module not active.
gpsd: Probing TSIP
gpsd: speed 9600, 8O1
gpsd: => GPS: 2450415348512c5249442a32380d0a
gpsd: => GPS: @F0.3=1*67
gpsd: => GPS: @F2.2=1*64
gpsd: writing oncore control type Cj:4040436a290d0a
gpsd: => GPS: 4040436a290d0a
gpsd: Navcom: command dump: 0299661c0800040200001203
gpsd: => GPS: 0299661c0800040200001203
gpsd: Navcom: sent command 0x1c (Test Support Block)
gpsd: Navcom: command 0x1c mode = 02, length = 0
gpsd: Navcom: command dump: 029966200e000001ae02000071000000f203
gpsd: => GPS: 029966200e000001ae02000071000000f203
gpsd: Navcom: sent command 0x20 (Data Request) - data block id = ae at rate 00
gpsd: Navcom: command dump: 029966200e00000186020a0071000000d003
gpsd: => GPS: 029966200e00000186020a0071000000d003
gpsd: Navcom: sent command 0x20 (Data Request) - data block id = 86 at rate 0a
gpsd: writing superstar2 control type 63 len 14:013fc008554750532d3030300403
gpsd: => GPS: 013fc008554750532d3030300403
gpsd: writing superstar2 control type 45 len 6:012dd2000001
gpsd: => GPS: 012dd2000001
gpsd: speed 9600, 8N1
gpsd: => GPS: 2450415348512c5249442a32380d0a
gpsd: => GPS: @F0.3=1*67
gpsd: => GPS: @F2.2=1*64
gpsd: writing oncore control type Cj:4040436a290d0a
gpsd: => GPS: 4040436a290d0a
gpsd: Navcom: command dump: 0299661c0800040200001203
gpsd: => GPS: 0299661c0800040200001203
gpsd: Navcom: sent command 0x1c (Test Support Block)
gpsd: Navcom: command 0x1c mode = 02, length = 0
gpsd: Navcom: command dump: 029966200e000001ae02000071000000f203
gpsd: => GPS: 029966200e000001ae02000071000000f203
gpsd: Navcom: sent command 0x20 (Data Request) - data block id = ae at rate 00
gpsd: Navcom: command dump: 029966200e00000186020a0071000000d003
gpsd: => GPS: 029966200e00000186020a0071000000d003
gpsd: Navcom: sent command 0x20 (Data Request) - data block id = 86 at rate 0a
gpsd: writing superstar2 control type 63 len 14:013fc008554750532d3030300403
gpsd: => GPS: 013fc008554750532d3030300403
gpsd: writing superstar2 control type 45 len 6:012dd2000001
gpsd: => GPS: 012dd2000001
gpsd: no probe matched...
gpsd: gpsd_activate(): opened GPS (fd 7)
gpsd: flagging descriptor 7 in assign_channel()
gpsd: => client(0): {"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/ttyUSB0","activated":1316041278.13,"native":0,"bps":9600,"parity":"N","stopbits":1,"cycle":1.00}]}\x0d\x0a{"class":"WATCH","enable":true,"json":true,"nmea":false,"raw":0,"scaled":false,"timing":false}
gpsd: select() {3 4 6 7} -> {} at 1316041279.135254
gpsd: select() {3 4 6 7} -> {} at 1316041280.136961
gpsd: select() {3 4 6 7} -> {} at 1316041281.138477

Here is gps.py (mint) output:
gps.py
{"class":"VERSION","release":"2.94","rev":"2010-05-17T16:11:43","proto_major":3,"proto_minor":2}
<dictwrapper: {'release': '2.94', 'proto_major': 3, 'rev': '2010-05-17T16:11:43', 'class': 'VERSION', 'proto_minor': 2}>
{"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/ttyUSB0","activated":1316041278.13,"native":0,"bps":9600,"parity":"N","stopbits":1,"cycle":1.00}]}
<dictwrapper: {'class': 'DEVICES', 'devices': [{'parity': 'N', 'activated': 1316041278.1300001, 'bps': 9600, 'stopbits': 1, 'path': '/dev/ttyUSB0', 'native': 0, 'class': 'DEVICE', 'cycle': 1.0}]}>
{"class":"WATCH","enable":true,"json":true,"nmea":false,"raw":0,"scaled":false,"timing":false}
<dictwrapper: {'enable': True, 'scaled': False, 'raw': 0, 'json': True, 'nmea': False, 'timing': False, 'class': 'WATCH'}>
^CTraceback (most recent call last): <-- My C-c
  File "gps.py", line 371, in <module>
    for report in session:
  File "gps.py", line 318, in next
    if self.poll() == -1:
  File "gps.py", line 302, in poll
    status = gpscommon.read(self)
  File "/home/dohlemacher/py/gps/client.py", line 74, in read
    frag = self.sock.recv(4096)
KeyboardInterrupt

Tags: gpsd
affects: linuxmint → gpsd
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.