Handle breaking errors in kiss_and_db.py #38
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix-kiss"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #37.
Started with an example mixed together from https://github.com/python-aprs/aprs3 and https://github.com/python-aprs/kiss3/blob/main/examples/tcp_async.py. The
await
was missing from the first example, so beware.Doesn't seem like
test_async.py
is picking up anything from dw, even though dw reports the connection.Got local environment going again and maybe I'll have better luck debugging this. May create another branch to try readme example at https://github.com/python-aprs/aprs3.
Well there's your problem:
https://owenduffy.net/blog/?p=2969
Wes asked about keepalive on the TCP connection, and I can't see anything like that in the aprs3/kiss3 code, but that doesn't mean it's not another level down from where I'm looking.
But I'm wondering if I could send an empty packet (or one with no path) every x minutes and have that keep the connection alive?
/home/pi/.local/lib/python3.7/site-packages/kiss/classes.py
The older version of
kiss
does not useasyncio
to handle the TCP connection:5c8baba2ce/kiss/classes.py (L205)
I don't know if switching back to this will fix the connection or break other things.
If this
import socket
refers to this, I think keepalive is included? https://docs.python.org/3/library/socket.htmlBut I can't seem to
pip3 install
the olderkiss
andaprs
packages.Started 11:50, seems to have quit/hung ~14:27 CST.
Seems hung after this. Packets came in after this, but nothing in log.
Is it telemetry that is causing issues?
This is where I am using
aprslib
instead ofaprs3
for parsing into tabular format.Was fooling around with packages earlier and ran into this again. Had to reinstall stuff in right order, but first delete some things.
Turned off periodic restart after the messages this afternoon, see also #37.
Same thing happening this morning. Breaking in between "Parsed ok" and when I attempt to log the
Also need to think about what characters may need to be escaped for SQLite.
Now seeing this?
Deployed code is a bit ahead what is in the repo right now.
Adding more errors (I think): https://www.freecodecamp.org/news/python-print-exception-how-to-try-except-print-an-error/
EDIT: Doesn't need to be? https://digi.w1cdn.net/aprs_api/packets?from=N0CBV-2
Example with a single quote? Can it be escaped?
N0CBV-2>APNU3B,KB0UGF-3,WIDE2-1:!4636.05NS09641.52W#PHG7230W2 MNn Wolverton 932'
https://stackoverflow.com/questions/3151146/replace-the-single-quote-character-from-a-string
Frame could not be parsed.
is an overarching log message I added for failure and includes everything from parsing to DB insertion. It's not very helpful.try except else
https://amiok.net/gitea/W1CDN/aprs_tool/src/branch/fix-kiss/kiss_and_db.py#L75
Logging errors is not working correctly. These show up in the
screen -r
output, but not in the log file:Stub out fix-kiss.to Handle breaking errors in kiss_and_db.pyNow that errors are being logged in more detail, I can let this run and see if it keeps working. Then deal with other additions in a different branch.