For versions of the KISS transports which do NOT automatically encode/decode APRS data, see kiss3.
I think I should be using https://github.com/python-aprs/aprs3.
> For versions of the KISS transports which do NOT automatically encode/decode APRS data, see kiss3.
Just barely working now (packet into database), but I don't understand the structure of the APRSFrame object, so it's going in as a string right now.
```
> repl(frame)
APRSFrame(destination=Address(callsign=b'APZ001', ssid=0, digi=False), source=Address(callsign=b'W1CDN', ssid=0, digi=False), path=[Address(callsign=b'K0UND', ssid=2, digi=True)], control=Control(v=b'\x03'), pid=b'\xf0', info=StatusReport(raw=b'>Hello World!', data_type=<DataType.STATUS: b'>'>, data=b'Hello World!', comment=b'', status=b'Hello World!', _timestamp=None))
```
Switching to aprslib, which parses more easily?
https://aprs-python.readthedocs.io/en/stable/examples.html
**Next up**,
- [x] move code from `tcp_kiss_send_recv.py` to `kiss_and_db.py`.
- [x] test on SBC to see if there is a ton of load from the subprocess
Now need to know all the possible fields that might come up, so they can be added to the db (or maybe write a function to add new fields on the fly?).
Are fields listed in the spec? I think so, see here: https://aprs-python.readthedocs.io/en/stable/parse_formats.html

Added a more complete list of fields that may come out of aprslib.parse() to the database schema.
How to insert the results of that function into the database without having all the columns represented each time?
Seems like we need to keep around a list of columns, drop it into the statement, but also add null dict items to the dict that comes out of aprslib.parse().
Added a more complete list of fields that may come out of `aprslib.parse()` to the database schema.
How to insert the results of that function into the database without having all the columns represented each time?
Seems like we need to keep around a list of columns, drop it into the statement, but also add null dict items to the dict that comes out of `aprslib.parse()`.
https://stackoverflow.com/a/16698310
```
values = {
'title':'jack', 'type':None, 'genre':'Action',
'onchapter':None,'chapters':6,'status':'Ongoing'
}
cur.execute(
'INSERT INTO Media (id, title, type, onchapter, chapters, status)
VALUES (:id, :title, :type, :onchapter, :chapters, :status);',
values
)
```
https://stackoverflow.com/a/69460935
$ python kiss_and_db.py
File "kiss_and_db.py", line 93
attrib_names = ', '.join(f'"{w}"' for w in a.keys())
File "kiss_and_db.py", line 96
sql = f"INSERT INTO frames ({attrib_names}) VALUES ({attrib_values})"
- [x] fix this issue
```
$ python kiss_and_db.py
File "kiss_and_db.py", line 93
attrib_names = ', '.join(f'"{w}"' for w in a.keys())
File "kiss_and_db.py", line 96
sql = f"INSERT INTO frames ({attrib_names}) VALUES ({attrib_values})"
```
On production ^, Python 3.7.3.
But it works on dev machine, Python 3.9.2.
Currently will not run correctly at https://digi.w1cdn.net.
The above issues fixed with with code changes, but things aren't working using waitress on the production machine. Flask dev server works fine.
Getting 502 Bad Gateway with waitress.
Subprocess call to kiss_and_db.py does not seem to be the cause.
The above issues fixed with with code changes, but things aren't working using waitress on the production machine. Flask dev server works fine.
Getting `502 Bad Gateway` with waitress.
Subprocess call to `kiss_and_db.py` does not seem to be the cause.
I thought I had the db entry set up right, but running overnight didn't yield new entries...
screen -r back in tells me why:
I thought I had the db entry set up right, but running overnight didn't yield new entries...
`screen -r` back in tells me why:

Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #5.
https://stackoverflow.com/a/7224186
I think I should be using https://github.com/python-aprs/aprs3.
Just barely working now (packet into database), but I don't understand the structure of the APRSFrame object, so it's going in as a string right now.
Switching to aprslib, which parses more easily?
https://aprs-python.readthedocs.io/en/stable/examples.html
Next up,
tcp_kiss_send_recv.pytokiss_and_db.py.Now need to know all the possible fields that might come up, so they can be added to the db (or maybe write a function to add new fields on the fly?).
Are fields listed in the spec? I think so, see here: https://aprs-python.readthedocs.io/en/stable/parse_formats.html
Subprocess was running all night and doesn't seem to have broken anything.
Added a more complete list of fields that may come out of
aprslib.parse()to the database schema.How to insert the results of that function into the database without having all the columns represented each time?
Seems like we need to keep around a list of columns, drop it into the statement, but also add null dict items to the dict that comes out of
aprslib.parse().https://stackoverflow.com/a/16698310
https://stackoverflow.com/a/69460935
This is looking pretty good...
Copied new code over to
kiss_and_db.pyand it seems to run.Hmmm...

I think it was the DB Browser--I made a manual edit to the structure and didn't save it.
On production ^, Python 3.7.3.
But it works on dev machine, Python 3.9.2.
Currently will not run correctly at https://digi.w1cdn.net.
The above issues fixed with with code changes, but things aren't working using waitress on the production machine. Flask dev server works fine.
Getting
502 Bad Gatewaywith waitress.Subprocess call to
kiss_and_db.pydoes not seem to be the cause.I thought I had the db entry set up right, but running overnight didn't yield new entries...
screen -rback in tells me why:Drop this stuff into
config.ini:I'll be debugging packets forever, I think!