XaiJu
nicsure
nicsure

patreon


RT-880 nicFW's First "Real" APRS Packet

Yet to be tested before release.

Comments

Love it

M0FXB HAM RADIO DIARY

std::array crc compute_crc(std::begin(packet_data), std::end(packet_data)); // Insert CRC at the end of the frame std::vector frame_bytes(std::begin(packet_data), std::end (packet_data)); frame_bytes.insert(frame_bytes.end(), {crc[0], crc[1] }); // Convert the frame bytes to a LS8 bitstream std::vectorsuint8_t> frame_bits; frame_bits.reserve(frame_bytes.size() 8); bytes_to_bits(frame_bytes.begin(), frame_bytes.end(), std::back_inserter (frame_bits)); // Bit stuffing std::vector stuffed_bits; bit_stuff(frame_bits.begin(), frame_bits.end(), std::back_inserter(stuffed_bits)); // Build complete bitstream: preamble data + postamble // Preamble: 45 HDLC Flags (0x7E = 01111110) // Postamble: 3 HDLC Flags std::vector bitstream; add_hdlc_flags(std::back_inserter(bitstream), 45); bitstream.insert(bitstream.end(), stuffed_bits.begin(), stuffed_bits.end()); add_hdl.c_flags(std::back_inserter (bitstream), 3); // NRZI encoding of the bitstream nrzi_encode(bitstream.begin(), bitstream.end()); //AFSK modulation std::vector audio_stream; int sample_rate = 48000; dds_afsk_modulator modulator(1200.0, 2200.0, 1200, sample_rate, 0.88); double silence_duration = 1.0; // seconds int silence_samples = static_cast(silence_duration sample_rate); // 1 second at 48kHz int signal samples = bitstream.size() modulator.samples_per_bit(); audio_stream.resize(silence_samples + signal samples); int write_pos = silence_samples; for (uint8_t bit bitstream) for (int i = 0; i < modulator.samples_per_bit(); ++i) { audio_stream [write_pos++] = modulator.modulate(bit); apply preemphasis (audio_stream.begin() + silence_samples, audio_stream.end(), sample_rate, /tau/75e-6); apply_gain(audio_stream.begin() + silence_samples, audio_stream.end(), 8.3); // scale to 30% volume insert_silence(audio_stream.begin(), sample_rate, silence_duration);

Daniel

I found the following code snippet by chance on Facebook which claims to explain APRS/AFSK in 60 lines, just in case it is of any help:

Daniel

https://github.com/wb2osz/direwolf

medal.bricks

Copy, I’ll try again when able. I’ve used a few APRS programs on PC, and I believe at least one of them allows for diagnostics. I’ll double check, but the best is “Yakk”

medal.bricks

Really excited seeing all the progress with APRS! Can’t wait to be able to send messages to my VR N76 when this is fully fleshed out

Nathan Philip

I did enode a full test APRS message, but I could have made a hundred mistakes. I really need something that lets me analyze it.

Marcus Dudley

That sounds EXACTLY like APRS. I did try to decode it with the aprs .fi app, and it didn’t decode, but I’m also working on so the volume was pretty low. Did you actually encode an APRS message? Or was that just tones which sound like APRS?

medal.bricks


More Creators