====== MMDVM-TNC ====== MMDVM-TNC is a new firmware for some MMDVM hardware which enables high speed (9600 bits/sec, potentially 19200 or 38400 bits/sec in future) C4FSK IL2P modem functionality using new modulations which will be interoperable with the NinoTNC in due course. It is a Pi hat form factor board which exposes a KISS modem on the GPIO header pins serial port, `/dev/ttyAMA0`. Some of this might not work yet. This page is a WIP. ===== Requirement ===== * MMDVM Repeater board * Raspberry Pi (tested on 3 / 4) ===== Preparation ===== Tested on 32 bit Bullseye Raspi OS Verified to NOT work on 64 bit Verified to NOT work on Bookworm, only Bullseye, due to /sys/class/gpio/export deprecation Burn Raspberry Pi OS Bullseye 32 bit Lite to a micro SD, boot it ''sudo raspi-config'' → interface options → serial port → serial shell disabled, serial port enabled Then: # Disable Bluetooth sudo sh -c "echo \"dtoverlay=disable-bt\" >> /boot/config.txt" sudo systemctl disable hciuart # Fetch the flashing tool curl -OLs https://www.bi7jta.org/files/MMDVM_Firmware/repeater_HAT/stm32flashV5 chmod +x stm32flashV5 sudo reboot ===== Building and flashing from source ===== sudo apt install -y git build-essential gcc-arm-none-eabi git clone https://github.com/g4klx/MMDVM-TNC.git cd MMDVM-TNC git submodule init git submodule update Run: make dvm Firmware is now built. Flash it: mv ../stm32flashV5 . while ! sudo ./stm32flashV5 -v -w bin/mmdvm_f4.hex -R -i 20,-21,21:-20,-21,21 /dev/ttyAMA0; do echo Again; done Carefully but swiftly (!) plug the board into the header. If it fails, unplug the board for a while and leave it before trying again later. A minute or two should be fine. This is required because of some capacitor in the wrong charge state and there may be some workaround coming. ===== Testing notes ===== D-Star LED is Mode 1 (1200 bit/sec AFSK AX.25) DMR LED is Mode 2 (9600 bit/sec C4FSK IL2P) Nino has some nice TNC test tools which work fine with this: cd ~ sudo apt install git python3 python3-pip -yq sudo pip3 install pyserial git clone https://github.com/ninocarrillo/tnc-tools.git cd tnc-tools Send one frame: sudo python3 kiss-ax25-ui.py /dev/ttyAMA0 115200 m0lte-1 This will send frames repeatedly: sudo python3 kiss-ax25-ui-batch.py /dev/ttyAMA0 115200 A0AAA B0BBB 100 "Hello world" 100 1 This will listen: sudo python3 kiss-listen.py /dev/ttyAMA0 115200 sudo required for this unless your user is in the dialout group. This diff hacks kiss-ax25-ui-batch.py to: - set persist=255 - divide supplied time interval by 10 diff --git a/kiss-ax25-ui-batch.py b/kiss-ax25-ui-batch.py index 11b3a75..2ebcbf8 100644 --- a/kiss-ax25-ui-batch.py +++ b/kiss-ax25-ui-batch.py @@ -120,6 +120,11 @@ TFESC = int(0xDD).to_bytes(1,'big') TFEND = int(0xDC).to_bytes(1,'big') KISS_PORT = 0 KISS_COMMAND = 0 + +kiss_output_frame = bytearray(FEND) + bytearray(int(0x02).to_bytes(1,'big')) + bytearray(int(0xFF).to_bytes(1,'big')) + bytearray(FEND) +#print(kiss_output_frame) +port.write(kiss_output_frame) + KISS_TYPE_ID = (KISS_PORT * 16) + KISS_COMMAND KISS_TYPE_ID = KISS_TYPE_ID.to_bytes(1,'big') @@ -191,6 +196,6 @@ for i in range(0, frame_count): # print(kiss_output_frame) frame_time = len(kiss_output_frame) * 10 / int(sys.argv[2]) port.write(kiss_output_frame) - time.sleep(frame_interval) + time.sleep(frame_interval/10) print('\nDone.') GracefulExit(port, 0) ===== Serial debugging ===== Available via the TX and GND pins at the opposite end of the board to the DB9 socket. On a typical USB serial breakout cable, connect TX to the white pin, and connect GND to the black pin. Open up PuTTY or similar and watch the COM port at 38400 baud. Limited output but useful to Jonathan. ===== Links ===== * https://www.bi7jta.org/wiki/index.php?title=Main_Page#Compile_firmware