User Tools

Site Tools


packet:mmdvm-tnc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
packet:mmdvm-tnc [2023/09/27 16:41] – [Building and flashing from source (hard mode)] m0ltepacket:mmdvm-tnc [2024/04/14 11:26] (current) – [Testing notes] m0lte
Line 1: Line 1:
 ====== MMDVM-TNC ====== ====== MMDVM-TNC ======
  
-None of this works yet. This page is a WIP.+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 ===== ===== Requirement =====
  
   * MMDVM Repeater board   * MMDVM Repeater board
-  * Raspberry Pi+  * Raspberry Pi (tested on 3 / 4)
  
-===== Flashing using a script (easy mode) =====+===== Preparation =====
  
-<code> +Tested on 32 bit Bullseye Raspi OS
-# curl https://mmdvm-tnc.s3.eu-west-2.amazonaws.com/flash-mmdvm-tnc.sh | sudo sh # NB this doesn't work yet +
-</code>+
  
-NB flashing seems to only work if you do it soon after plugging the board in to the header...+Verified to NOT work on 64 bit
  
-===== Flashing from the web (medium mode) =====+Verified to NOT work on Bookworm, only Bullseye, due to /sys/class/gpio/export deprecation
  
-sudo raspi-config → interfaces → disable serial shell, leave serial port enabled+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:
  
-One-off: 
 <code> <code>
-curl -OL https://www.bi7jta.org/files/MMDVM_Firmware/repeater_HAT/stm32flashV5 +# Disable Bluetooth
-chmod +x stm32flashV5+
 sudo sh -c "echo \"dtoverlay=disable-bt\" >> /boot/config.txt" sudo sh -c "echo \"dtoverlay=disable-bt\" >> /boot/config.txt"
 sudo systemctl disable hciuart sudo systemctl disable hciuart
-</code> 
  
-Every time: +# Fetch the flashing tool 
-<code> +curl -OLs https://www.bi7jta.org/files/MMDVM_Firmware/repeater_HAT/stm32flashV5 
-wget -https://mmdvm-tnc.s3.eu-west-2.amazonaws.com/mmdvm-f4-simplex.hex +chmod +x stm32flashV5 
-while ! sudo ./stm32flashV5 -v -w mmdvm-f4-simplex.hex -R -i 20,-21,21:-20,-21,21 /dev/ttyAMA0; do echo again; done+ 
 +sudo reboot
 </code> </code>
  
-===== Preparation ===== +===== Building and flashing from source =====
- +
-Install board on Pi header +
- +
-Burn Raspberry Pi OS Lite 32 bit to a micro SD, boot it +
- +
-raspi-config -> interfaces -> disable serial shell, leave serial port enabled +
- +
-===== Building and flashing from source (hard(ish) mode) =====+
  
 <code> <code>
Line 52: Line 48:
 </code> </code>
  
-Make Config.h look like this: +Run:
- +
-<code> +
-#define CONFIG_H +
-#define EXTERNAL_OSC 12000000 +
-#define STM32F4_NUCLEO_MORPHO_HEADER +
-#define SERIAL_SPEED    115200 +
- +
-// Select the initial packet mode +
-// 1 = 1200 bps AFSK AX.25 +
-// 2 = 9600 bps C4FSK IL2P +
-#define INITIAL_MODE    2 +
- +
-// TX Delay in milliseconds +
-#define TX_DELAY        300 +
- +
-// P-Persistence in x/255 +
-#define P_PERSISTENCE   63 +
- +
-// Slot Time in milliseconds +
-#define SLOT_TIME       100 +
- +
-// Set Duplex, 1 for full duplex, 0 for simplex +
-#define DUPLEX          0 +
- +
-// Select use of serial debugging +
-#define SERIAL_DEBUGGING +
- +
-// Baud rate for serial debugging. +
-#define DEBUGGING_SPEED 38400 +
- +
-// Set the receive level (out of 255) +
-#define RX_LEVEL        128 +
- +
-// Set the mode 1 transmit level (out of 255) +
-#define MODE1_TX_LEVEL  128 +
- +
-// Set the mode 2 transmit level (out of 255) +
-#define MODE2_TX_LEVEL  128 +
- +
-// Use pins to output the current mode via LEDs +
-#define MODE_LEDS +
-</code> +
- +
-then run:+
  
 <code> <code>
Line 102: Line 54:
 </code> </code>
  
-Firmware is now built. Prep the Pi for flashing:+Firmware is now built. Flash it:
  
 <code> <code>
-sudo sh -c "echo \"dtoverlay=disable-bt\" >> /boot/config.txt" +mv ../stm32flashV5 . 
-sudo systemctl disable hciuart+while ! sudo ./stm32flashV5 --w bin/mmdvm_f4.hex -R -i 20,-21,21:-20,-21,21 /dev/ttyAMA0; do echo Again; done
 </code> </code>
  
-Flash it:+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.
  
-<code> +This is required because of some capacitor in the wrong charge state and there may be some workaround coming.
-curl -OL https://www.bi7jta.org/files/MMDVM_Firmware/repeater_HAT/stm32flashV5 +
-chmod +x stm32flashV5 +
-sudo ./stm32flashV5 -v -w bin/mmdvm_f4.hex -R -i 20,-21,21:-20,-21,21 /dev/ttyAMA0 +
-</code>+
  
-NB this seems to only work if you do it soon after plugging the board in to the header... 
  
-Mode 1 (1200 bit/sec AFSK AX.25) is D-Star LED+===== Testing notes =====
  
-Mode (9600 bit/sec C4FSK IL2Pis DMR LED+D-Star LED is Mode (1200 bit/sec AFSK AX.25
  
-===== Testing =====+DMR LED is Mode 2 (9600 bit/sec C4FSK IL2P)
  
-Nino has some nice TNC test tools.+Nino has some nice TNC test tools which work fine with this:
  
 <code> <code>
Line 147: Line 94:
 </code> </code>
  
-sudo required unless your user is in the dialout group.+This will listen:
  
 +<code>
 +sudo python3 kiss-listen.py /dev/ttyAMA0 115200
 +</code>
 +
 +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
 +
 +<code>
 +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)
 +</code>
 ===== Serial debugging ===== ===== Serial debugging =====
  
Line 155: Line 139:
 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. 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 such as "IL2PTX: type 1 header".+Limited output but useful to Jonathan.
  
 ===== Links ===== ===== Links =====
  
   * https://www.bi7jta.org/wiki/index.php?title=Main_Page#Compile_firmware   * https://www.bi7jta.org/wiki/index.php?title=Main_Page#Compile_firmware
packet/mmdvm-tnc.1695832907.txt.gz · Last modified: 2023/09/27 16:41 by m0lte