Bell202 object, AX.25 and APRS
ke4pjw
Posts: 1,172
I started playing with the Bell 202 object last night. I just used the test program and listened to the audio through speakers. My plan is to build a "PropTracker" for APRS. I have not dug into the object too much, but I just wanted to get some confirmation that I am traveling down the correct path.
It appears that I will have to construct the complete AX.25 UI frame, including flag fields. Is that correct?
BTW, the documentation and everything that goes with this object is great! Kudos to PhiPi!
It appears that I will have to construct the complete AX.25 UI frame, including flag fields. Is that correct?
BTW, the documentation and everything that goes with this object is great! Kudos to PhiPi!
Comments
-Luke AC0AV
Maybe we can collaborate on our projects.
-Phil
The packet should be
However it is not decoded by the remote TNC. (transmitting into a dummyload on UHF) I am using this specific packet because I have taken it from this document and did not want to deal with an unknown quantity. (Bad FCS field, etc)
I hope someone can point out a huge oversight on my part.
EDIT: Ok, two big mistakes. FCS is missing from above. I have commented out the two ASM opcodes that create the start and stop bits and decremented the bit counter by 2. I feel like I am making progress.
http://forums.parallax.com/showpost.php?p=908872&postcount=64
http://forums.parallax.com/showpost.php?p=919074&postcount=75
I have looked at your code, as well as that of others. (Though I haven't had any time this weekend to really dig into it). I like the modified CRC you have in your code and used it in mine. One question I have is in the modulator portion of your code, you have the instructions for the start and stop bits commented out, however the bit count to send is still #11. Why is that? That sort of has me confused.
Thanks,
Terry
I will have to try this object too. It has always been the dificulty in getting the the modem chips that has put me off.
I used to be G8LCU.
Terry,
I started my work with the demodulator and I haven't completely mangled the modulator yet. The same lessons I learned with the demod will surely apply however, including the bit-stuffing and the NRZI code.
AX.25 over Bell 202 utilizes bit-stuffing (pushing in an extra "0" state in the data stream) after five "1" states to keep the NRZI (Non-Return to Zero Inverted) stream that is passed to/from the raw modem from stagnating at one tone or the other (high or low). Stagnation would make re-synchronization and recovery of the bit rate of the raw stream very difficult (if not impossible under some circumstances). The other purpose of bit-stuffing is to keep a (begin/end) "flag" sequence of six ones in a row--0x7Eh--from showing up in the middle of a packet.
My modifications to the demod code take both of these issues into account (NRZI and bit-stuffing) and can be implemented in inverse to make your transmit/modulate code work a bit more reliably.
I strongly recommend looking at the AX.25 spec if you haven't yet to help you along (and in case I've bollocksed something above or in my additions to Phil's code) and it appears that you've already had a look at the APRS spec which will help a lot as well.
Good Luck! I've set this thread to notify me on updates so you can post back here if you have more questions. Maybe I'll have some idea how to help, and maybe you'll inspire me to fix something else!
i.e the possibility to transmit an valid APRS formated packet and let the code create the proper AX25 and transmit it.
TX_AX25_KISS("LA3QMA-9 >VP2QW0,WIDE2-2:`{\Kl#P>/]"41}=")
Same thing for RX. Let the code do all the tricky part and return it as "clear text" or "TNC2" format.
I have some APRS projects and i want to use this Bell code but i think i have to learn more SPIN and finish my first project.
My original intent was to implement a KISS TNC object and then use that to build an APRS digi. If Terry (or somebody else) gets there first that doesn't bother me--so long as I can understand their code!
Anyhow i'm using the TNC-X with XDigi for doing digipeating.
But doing "TNC2" mode is more useful for me. So this thread is going to be visited by me often
Doing it by ethernet would make it too easy, for the others :-)
I am very interested. I felt as if I was close to being able to generate valid X.25 packets a few months ago, but had to give it a rest after my baby girl was born. I would love to look at your code!
I'm still around. Part of what's been taking up my time was getting involved with git.git--it's the one SCM that shows promise of being able to properly handle UTF-16 text (like that generated by Parallax's Propeller programming tool) as text. That's less of a problem for me, as BST handles UTF-8 just fine (and that's handled by most SCM software without pain).
-Phil
AD7YF
Did you transmit RF packets or did you do a serial connection to your PC? I'm curious if your packets were picked up by a digi-peater and are visible on http://www.aprs.fi .
Dave
KE5LOL
Dude! Can't wait to see your code!
EDIT: The CRC code I use in my YMODEM program is shown below.
$90, $84, $72, $b4, $a4, $90,$60, $90, $84, $72, $a0, $aa, $9e, $e1, $f1 checksum $30 $26
The checksum is sent most significant bit first, so I am not sure whether this checksum should be reversed or not. The algorithm is CRC-CCITT. Let me know if anyone can recreate this checksum from the given data.
And there is this description from http://n1vg.net/packet/index.php
Start with the 16-bit FCS set to 0xffff. For each data bit sent, shift the FCS value right one bit. If the bit that was shifted off (formerly bit 1) was not equal to the bit being sent, exclusive-OR the FCS value with 0x8408. After the last data bit, take the ones complement (inverse) of the FCS value and send it low-byte first.
The code does not seem to give a valid checksum. Can anyone spot mistakes?
Ok, I am tired, but the hard work has been done. There seems to be a lot of interest, so here is my rough program. The bell202 modem object has been modified to do bit stuffing and NRZI encoding. The bell202demo simply transmits a valid AX.25 packet, by copying the contents from a received packet (and includes a working checksum algorithm). Hopefully someone can wrap it up into a nice send packet function, otherwise I will do it tomorrow.
Edit: I am new to the propeller, so my code can most probably be improved!
Have fun, guys
I am desperately looking over your post for some linkage or source code
UPDATE: Thanks for posting the code!!!
As the one who made the conversion from Jason's original, I'd like to know very much what is purported to be wrong with this. I will note that I have only tried DECODING packets with it, and that's not exactly the same process of encoding.
The assembly looks reasonable. I haven't tried it yet, but I don't anticipate problems. Perhaps you'll be able to take the work I've done patching the recieving side and make a whole tranciever from it.