ampledata / kiss

A pure-Python implementation of the KISS Protocol for communicating with serial TNC devices for use with Amateur Radio.
Other
84 stars 35 forks source link

Socket and Serial write examples not working #21

Open Hibby opened 6 years ago

Hibby commented 6 years ago

I think there's a couple of issues with examples/socket_write.py and examples/serial_write.py -

On running either, I first get the error:

→ python3.6 socket_write.py 
Traceback (most recent call last):
  File "socket_write.py", line 25, in <module>
    main()
  File "socket_write.py", line 17, in main
    frame.text = '>Hello World!'
AttributeError: 'Frame' object has no attribute 'text'

Changing frame.text to frame.info fixes this issue (bringing it in line with aprs/classes.py in the updated aprs module), but then leads on to the next issue:

→ python3.6 socket_write.py
2017-09-03 17:18:09,810 kiss INFO kiss.classes.start:231 - Connected to ('localhost', 1234)
Traceback (most recent call last):
  File "socket_write.py", line 25, in <module>
    main()
  File "socket_write.py", line 21, in main
    ki.write(frame.encode_kiss())
AttributeError: 'Frame' object has no attribute 'encode_kiss'

Which is also in line with aprs/classes.py in the updated aprs module. It looks like the aprs module has removed the encode_kiss() and parse_kiss() functions from the Frame class as part of the 7.0.0 release. Is there a workaround / other recommended strategy?

bhhoyer commented 6 years ago

changing encode_kiss to encode_ax25 took care of that error (from Greg) but now:

Traceback (most recent call last): File "aprs_test.py", line 19, in main() File "aprs_test.py", line 14, in main ki.write(frame.encode_ax25()) File "/usr/local/lib/python3.6/site-packages/aprs/classes.py", line 93, in encode_ax25 encoded_frame.append(self.destination.encode_ax25()) File "/usr/local/lib/python3.6/site-packages/aprs/classes.py", line 202, in encode_ax25 _callsign += b' ' TypeError: must be str, not bytes

KenwoodFox commented 3 years ago

Having a similar error here as well, thanks for the note to fix .info and encode_ax25 maybe we should pr? image