rossengeorgiev / aprs-python

📡 Python module for working with APRS
http://aprs-python.readthedocs.io/en/latest/
GNU General Public License v2.0
118 stars 37 forks source link

Message packets are not what i sent. #86

Closed mytechguyri closed 8 months ago

mytechguyri commented 8 months ago

Here is the code in my program where I'm constructing and sending a message packet. `def send_aprs(msg): try: recipient = str(send_to.ljust(9)) logger.info( f"Forwarding message for {pager_id} to {recipient}@APRS via {aprs_server}: {msg}") AIS = aprslib.IS(str(callsign), passwd=str(aprs_passcode), host=str(aprs_server), port=14580) AIS.connect() AIS.sendall(f"DAPNET>APRS,TCPIP*,qAR::{recipient}:{msg}")

AIS.sendall("DAPNET>APRS,TCPIP*::" + send_to.ljust(9) + ":" + msg)

    #AIS.sendall(aprs_msg)
    return True
except Exception as e
    logger.error(f"Failed to send APRS message {msg}: {e}")
    return False
    pass`

where recipient = "WA1OKB-5" So, the constructed packet is "DAPNET>APRS,TCPIP,qAR::WA1OKB-5:Message text here" the packet received by APRS is: "DAPNET>APRS,TCPIP,qAR,WA1OKB::WA1OKB-5 :WA1OKB: testing dapnet2aprs" What I don't understand is... where is that WA1OKB between WA1OKB-5 and the message text coming from? Is the library adding it? I don't think the aprs-is gateway is adding it.. more importantly, if the library is adding it.. how do I stop it, because its changing the recipient of the message, instead of WA1OKB-5, it thinks the recipient is WA1OKB, so it doesn't show up on the radio with the -5 ssid.

(Complete code is at https://github.com/mytechguyri/DAPNET2APRSNotifier ) please reach out to john@wa1okb.radio if you have any questions.

mytechguyri commented 8 months ago

Okay... I'm an idiot...that's what i get for staying up all night writing code... the extra WA1OKB... that's actually part of the message text as it comes over from DAPNET... message text was "WA1OKB: testing dapnet2aprs"... I might look into doing something with that.... not sure if that callsign is intended to be the sender's callsign or the recipient, hard to tell since my testing is just sending messages to myself... If its the sender, I'll probably extract it so the aprs packet shows the original sender... otherwise I'll likely just strip it off since we know who its going to anyways.