ncssar / radiolog

SAR radio log program
Other
15 stars 3 forks source link

poll for GPS causes unbound 'widget' errors #733

Open caver456 opened 8 months ago

caver456 commented 8 months ago

3-2-24 R6: image

these errors continued once per second until closing radiolog.

caver456 commented 8 months ago

Comparing with a 'healthy' polling call which just times out due to no response:

145436:polling GPS for fleet=100 device=3038
145436:com data: ☻R31003038♥
145436:fsLog:[['100', '3001', 'SAR 1', False, 'Sun 14:54:19', 'COM2', 1, 0]]
145436:WARNING: 100:3038 has no fsLog entry so it probably has not been heard from yet
145436:getCallsign called for FleetSync fleet=100 dev=3038
145436:  found matching entry/entries:[['100', '3038', 'SAR 38']]
145444:Timed out awaiting FleetSync or NEXEDGE response

It looks like the '0' traffic was received while waiting for a response, and this '0' traffic was never really processed or cleared from the buffer. It doesn't seem to even be related to the polling...?

Need to try some more to track down the source of the '0' traffic, and also to handle it gracefully and clear it from the buffer.

caver456 commented 8 months ago

Here's the full sequence from the problem session:

154946:polling GPS for fleet=100 device=3087
154946:com data: R31003087
154946:fsLog:[['100', '1301', 'SnowCat 1', False, 'Sat 15:35:55', 'COM4', 0, 1]]
154946:WARNING: 100:3087 has no fsLog entry so it probably has not been heard from yet
154946:getCallsign called for FleetSync fleet=100 dev=3087
154946:  found matching entry/entries:[['100', '3087', 'SAR 87']]
154948:PARSING
154948:0
154948: line:0
154948:checking for existing open new entry tabs: callsign= continueSec=20
Uncaught exception
Traceback (most recent call last):
  File "radiolog.py", line 2069, in fsCheck
  File "radiolog.py", line 2479, in fsParse
UnboundLocalError: local variable 'widget' referenced before assignment
154949:PARSING
154949:0
154949: line:0
154949:checking for existing open new entry tabs: callsign= continueSec=20
Uncaught exception
Traceback (most recent call last):
  File "radiolog.py", line 2069, in fsCheck
  File "radiolog.py", line 2479, in fsParse
UnboundLocalError: local variable 'widget' referenced before assignment
154950:PARSING
154950:0
154950: line:0
154950:checking for existing open new entry tabs: callsign= continueSec=20
Uncaught exception
Traceback (most recent call last):
  File "radiolog.py", line 2069, in fsCheck
  File "radiolog.py", line 2479, in fsParse
UnboundLocalError: local variable 'widget' referenced before assignment
154951:PARSING
154951:0
154951: line:0
154951:checking for existing open new entry tabs: callsign= continueSec=20
Uncaught exception
Traceback (most recent call last):
  File "radiolog.py", line 2069, in fsCheck
  File "radiolog.py", line 2479, in fsParse
UnboundLocalError: local variable 'widget' referenced before assignment
154952:PARSING
154952:0
154952: line:0
154952:checking for existing open new entry tabs: callsign= continueSec=20
Uncaught exception
Traceback (most recent call last):
  File "radiolog.py", line 2069, in fsCheck
  File "radiolog.py", line 2479, in fsParse
UnboundLocalError: local variable 'widget' referenced before assignment
154953:PARSING
154953:0
154953: line:0
154953:checking for existing open new entry tabs: callsign= continueSec=20
Uncaught exception
Traceback (most recent call last):
  File "radiolog.py", line 2069, in fsCheck
  File "radiolog.py", line 2479, in fsParse
UnboundLocalError: local variable 'widget' referenced before assignment
154954:PARSING
154954:0
154954: line:0
154954:checking for existing open new entry tabs: callsign= continueSec=20
Uncaught exception
Traceback (most recent call last):
  File "radiolog.py", line 2069, in fsCheck
  File "radiolog.py", line 2479, in fsParse
UnboundLocalError: local variable 'widget' referenced before assignment
154955:Timed out awaiting FleetSync or NEXEDGE response
154955:getCallsign called for FleetSync fleet=100 dev=3087
154955:  found matching entry/entries:[['100', '3087', 'SAR 87']]
154955:newEntry called with these values:
154955:['1549', '', 'SAR 87', 'FLEETSYNC: No response received for location request from 100:3087 (SAR 87)', '', '', 1709423395.0814044, '', '', '']
154955:new team: newTeamName=SAR 87 extTeamName=z_SAR00087 niceTeamName=SAR 87 shortNiceTeamName=SAR87
154955:extTeamNameList before sort:['dummy', 'z_SAR00087']
154955:grouped tabs:{'NCSOcmd': [], 'NCSO': [], 'NCPD': [], 'TPD': [], 'GVPD': [], 'CHP': [], 'Numbers': [], 'other': ['dummy', 'z_SAR00087']}
154955:extTeamNameList after sort:['spacerLeft', 'z_SAR00087']
154955:setting tab initial style in addTab: #tab_spacerLeft { font-size:20px;background:none;padding-left:1px;padding-right:1px }
154955:setting tab initial style in addTab: #tab_z_SAR00087 { font-size:20px;background:none;padding-left:1px;padding-right:1px }
154955:teamNotesBuildTooltip called for z_SAR00087
154955:next available hotkey:1
154955:  writing C:\Users\NCSSAR\RadioLog\German_Bar_2024_03_02_154108\German_Bar_2024_03_02_154108.csv
154955:  done writing C:\Users\NCSSAR\RadioLog\German_Bar_2024_03_02_154108\German_Bar_2024_03_02_154108.csv
154955:  writing X:\German_Bar_2024_03_02_154108.csv
154955:  done writing X:\German_Bar_2024_03_02_154108.csv
154955:  writing C:\Users\NCSSAR\RadioLog\German_Bar_2024_03_02_154108\German_Bar_2024_03_02_154108_clueLog.csv
154955:  done writing C:\Users\NCSSAR\RadioLog\German_Bar_2024_03_02_154108\German_Bar_2024_03_02_154108_clueLog.csv
154955:  writing X:\German_Bar_2024_03_02_154108_clueLog.csv
154955:  done writing X:\German_Bar_2024_03_02_154108_clueLog.csv
154956:PARSING
154956:0
154956: line:0
154956:checking for existing open new entry tabs: callsign= continueSec=20
Uncaught exception
Traceback (most recent call last):
  File "radiolog.py", line 2069, in fsCheck
  File "radiolog.py", line 2479, in fsParse
UnboundLocalError: local variable 'widget' referenced before assignment
154956:failed on preferred COM port; no alternate COM port available
154957:PARSING
154957:0
154957: line:0
154957:checking for existing open new entry tabs: callsign= continueSec=20
Uncaught exception
Traceback (most recent call last):
  File "radiolog.py", line 2069, in fsCheck
  File "radiolog.py", line 2479, in fsParse
UnboundLocalError: local variable 'widget' referenced before assignment
...
...

So it seems like it timed out appropriately, but it continued to try to process the 'zero' data every second until the end of the session.

Should probably try to duplicate the 'zero' traffic at R6, since I can't duplicate it at home. Then, after fixing the code, confirm that the 'zero' traffic is handled gracefully.

It would also be good to find out why the tracebacks are happening - is it in a piece of dead code that should never be called anyway, or something to that effect?

caver456 commented 4 months ago

The first report was in 3.11.3, and this is in 3.11.4, i.e. 3.11.4 didn't address this issue (and it wasn't supposed to):

tracebacks stop when a valid response is received:

083634:polling GPS for fleet=100 device=2004
083634:com data: R31002004
083634:fsLog:[['100', '2004', 'Radio 4', False, 'Sat 08:30:22', 'COM4', 1, 3]]
083634:getCallsign called for FleetSync fleet=100 dev=2004
083634:  found matching entry/entries:[['100', '2004', 'Radio 4']]
083636:PARSING
083636:0
083636: line:0
083636:checking for existing open new entry tabs: callsign= continueSec=20
Uncaught exception
Traceback (most recent call last):
  File "radiolog.py", line 2070, in fsCheck
  File "radiolog.py", line 2480, in fsParse
UnboundLocalError: local variable 'widget' referenced before assignment
083637:PARSING
083637:0$PKLDS,163609,A,3917.6009,N,12111.5092,W,,,,,00,100,2004,80,00,*13

$PKLSH,3917.6009,N,12111.5092,W,163609,A,100,2004,*3B

$GPRMC,163609,A,3917.6009,N,12111.5092,W,,,,,*0B

$GPGGA,163609,3917.6009,N,12111.5092,W,1,,,,,,,,*4A

083637: line:0$PKLDS,163609,A,3917.6009,N,12111.5092,W,,,,,00,100,2004,80,00,*13

083637: line:$PKLSH,3917.6009,N,12111.5092,W,163609,A,100,2004,*3B

083637:getCallsign called for FleetSync fleet=100 dev=2004
083637:  found matching entry/entries:[['100', '2004', 'Radio 4']]
083637:$PKLSH (FleetSync) detected containing CID: fleet=100  dev=2004  -->  callsign=Radio 4
083637:Valid location string:'3917.6009|N|12111.5092|W'
083637:convertCoords called: targetDatum=WGS84 targetFormat=UTM 5x5 coords=['3917.6009', 'N', '12111.5092', 'W']
083637:Formatted location string:'55930  50889'
083637:convertCoords called: targetDatum=WGS84 targetFormat=D.dList coords=['3917.6009', 'N', '12111.5092', 'W']
083637:WGS84 lat=39.293348333333334  lon=-121.19182
083637:newEntry called with these values:
083637:['0836', 'FROM', 'Radio 4', 'FLEETSYNC LOCATION REQUEST: SUCCESSFUL RESPONSE from device 100:2004 (Radio 4)', '55930  50889', '', 1710002197.0885053, '', '', '']
083637:FLEETSYNC LOCATION REQUEST: SUCCESSFUL RESPONSE from device 100:2004 (Radio 4)