====== LoRa for AX.25 Packet, and APRS ====== The [[https://en.wikipedia.org/wiki/LoRa|LoRa]] mode, designed for low power and long range, can be used as the physical mode for [[https://en.wikipedia.org/wiki/Automatic_Packet_Reporting_System|APRS]] and connected mode packet radio (BBSes, nodes etc.) There is already a good amount of APRS over LoRa, and it is continuing to grow (see [[http://lora-aprsdirect.sarimesh.net/|this map]] for LoRa-only APRS devices for example). It's use for traditional packet radio is less common, but is finding use in some places, notably [[https://ok2zaw.blogspot.com/search/label/LoRa%20Packet%20Radio|OK2ZAW's blog]]. ===== LoRa APRS ===== APRS over LoRa is gaining traction, and is great for getting good range at low power. The popular LoRa boards from manufacturers like Lilygo, Heltec, and RAK that are used in many other LoRa projects work great for this and are widely supported by APRS firmware. They typically offer around 0.1 watts output, which gets you surprisingly far. Remember to get hardware on the 70cm band and not the 868/915 MHz ISM band that is popular with other license free LoRa projects. While there are a number of other firmware options, people seem to be converging on Ricardo Guzman's (CA2RXU) which incorporates a lot of work done by pervious people. This can be found at: * [[https://github.com/richonguzman/LoRa_APRS_iGate|LoRa_APRS_iGate]] - Digi/iGate fimrware * [[https://github.com/richonguzman/LoRa_APRS_Tracker|LoRa_APRS_Tracker]] - Tracker firmware (periodically beaconing your location) These work completely standalone, but also offer KISS so external APRS clients can be used (for APRS only, not packet, see below!) The iGate firmware makes KISS available on TCP and/or USB-serial, the tracker firmware can do KISS via bluetooth. The tracker does expose a USB-serial port but it is not for KISS and is only for debug output or flashing the device. In the UK, the LoRa APRS frequency and modulation settings are: **439.9125 MHz** (note this is different to elsewhere in Europe)\\ Bandwidth: 125khz\\ Spreading factor: 12\\ Coding Rate 4/5 (ie. enter "5" for the CR4 option) ==== Mini how-to ==== - Download VS Code - Install Platformio IDE extension into VS Code - Follow the iGate or Tracker path below. === iGate === An iGate is a "receiver" and picks up location/messaging/whatever frames from devices in the field, forwards them to the internet, and optionally vice-versa, permitting things like two-way messaging with an internet hop in the middle. A 433MHz Lilygo LoRa32 V2.1_1.6 makes a good board for an iGate. There is web flasher, you can find it [[https://richonguzman.github.io/lora-igate-web-flasher/installer.html|here]]. I didn't have much success with it (the web UI didn't like saving settings), so these are the steps I followed instead: - Connect the board to your computer with a USB cable. - ''git clone https://github.com/richonguzman/LoRa_APRS_iGate.git'' - Optionally replace ''data/igate_conf.json'' with one with sensible UK defaults in from [[https://github.com/M0LTE/LoRa_APRS_iGate/blob/main/data/igate_conf.json|here]] - Set the following fields, and save the file: * callsign (SSID is optional) * wifi.autoAp.powerOff - set to 0 to stop it from spinning up a Wi-Fi AP * wifi.AP.ssid/password - set to your Wi-Fi credentials * beacon.latitude/longitude - self explanatory, find at https://gridreferencefinder.com/ * aprs_is.passcode - enter your callsign on [[https://apps.magicbug.co.uk/passcode/|here]] to find your value * personalNode - change the URL to include your callsign and feel free to create a page - Click the Tick button in the bottom bar of VS Code (tooltip is PlatformIO: Build) to check everything builds - Click the Right arrow in the bottom bar of VS Code (tooltip is PlatformIO: Upload) to upload firmware to the board - In the left bar of VS Code, click the PlatformIO icon (ant head). - In the next leftmost bar of VS Code, find Project Tasks (at the top). Expand ''ttgo-lora32-v21'' (for this board, pick the board you are using) - Expand Platform, and click Upload Filesystem Image. Another upload will happen, ensure it is successful. The board should boot and display its IP address from your Wi-Fi on its screen. Navigate to http://that-ip-address in your browser. It should also now appear on [[https://aprs.fi/info/a/MB7UTL|aprs.fi]] and on [[https://lora.ham-radio-op.net/|lora.ham-radio-op.net]]. An iGate is best sited up high, connected to a full size 70cm antenna, e.g. a colinear, dipole, or 5/8ths or quarter wave vertical. NB Sometimes uploading can fail, in this case try re-plugging or swapping USB port, or plug the board in with its RST button held. NB If you don't use the recommended file with sensible UK defaults then you will need to set more options to be compatible with UK settings (most importantly, the UK LoRa APRS frequency is 439.9125 MHz, with SF=12, BW=125k, CR=4:5). Typical output power is 20dBm or 0.1W. === Tracker === A tracker is a device you carry around with you and it sends and receives beacons, messages etc. It can optionally be used with a companion smartphone app (via bluetooth) or PC software (via USB or bluetooth) as a TNC. A 433MHz Lilygo T-Beam Supreme makes a good board for a tracker. Add a single 18650 cell and a 3D printed case for convenience. Unlike the iGate, at the time of writing, there is no web flasher, so you'll need to follow the steps, which are similar to the iGate. - Connect the board to your computer with a USB cable. - ''git clone https://github.com/richonguzman/LoRa_APRS_Tracker.git'' - Set the following fields in ''data/igate_conf.json'', and save the file: * callsign (SSID is optional) * Remove the second and third beacon configurations (unless you want to have multiple configs available on the tracker, of course...) * sendBatteryInfo: true * bluetoothType: 0 for iPhone, 1 for Android * For the UK, specify ''lora'' as follows: "lora": [{ "frequency": 439912500, "spreadingFactor": 12, "signalBandwidth": 125000, "codingRate4": 5, "power": 20 }], - Click the ''env'' section in the bottom bar of VS Code and pick the appropriate board, e.g. ''env:ttgo_t_beam_s3_SUPREME_v3'' - Click the Tick button in the bottom bar of VS Code (tooltip is PlatformIO: Build) to check everything builds - Click the Right arrow in the bottom bar of VS Code (tooltip is PlatformIO: Upload) to upload firmware to the board - In the left bar of VS Code, click the PlatformIO icon (ant head). - In the next leftmost bar of VS Code, find Project Tasks (at the top). - Expand General, then Platform, and click Upload Filesystem Image. Another upload will happen, ensure it is successful. The tracker should boot and start looking for GPS. Your iGate should show a green LED when it receives a frame from your tracker. Your tracker should now show up on [[https://aprs.fi/aprs.fi]] and on [[https://lora.ham-radio-op.net/|lora.ham-radio-op.net]], separately from your iGate, and if you walk around with it, it should beacon your position, picked up by your iGate, repeated and/or sent to the internet. APRS.fi have an iPhone app which works with this TNC for beaconing, and also it appears messaging, but this is hidden behind a subscription so I've not tried it. ==== Licence Requirements ==== If you want to run an unattended Digi that may be subject to 3rd party use (ie. digi'd packets from other people) in the UK, you will need to coordinate with the ETCC for a [[https://ukrepeater.net/forms_central.html|Frequency Assignment Certificate (FAC)]] and be aware of any license conditions that need to be followed. This will be an ''MB7Uxx'' callsign, where you get to pick ''xx''. ''MB7Ux'' is being phased out. ===== LoRa Packet Radio ===== (This is still being investigated by OARC members, so the following is a work in progress) Unfortunately, the LoRa PRS firmware mentioned above is not suitable for traditional connected mode packet radio, even though KISS is exposed. This is because the on-air format of LoRa APRS is actually a TNC2 style string in the payload of the LoRa packet, and not a full AX.25 packet as would be typical of VFH APRS. This TNC2 string does not represent all the header fields of an AX.25 packet, which is fine for APRS which always uses certain values anyway, but destroys important information needed for packet radio. An AX.25 frame is constructed with hardcoded APRS header values specifically to send to KISS clients. This means all packets, regardless of how they were sent to the KISS port, will end up looking like UI packets on the other side. It is possible to have a UI-packet chat this way, but it is impossible to "connect" to another station. There are however other options, though these have not yet been tested by OARC members. These are: * [[https://unsigned.io/rnode_bootstrap_console/guides/tnc_mode.html|Using an RNode With Amateur Radio Software]] - some newer device support might also be available in the community fork at [[https://github.com/liberatedsystems/RNode_Firmware_CE|RNode_Firmware_CE]] * [[https://github.com/tomelec/RPi-LoRa-KISS-TNC|Raspberry Pi LoRa TNC]] - OK2ZAW also provides Pi images [[https://ok2zaw.blogspot.com/search/label/LoRa%20Packet%20Radio|on his blog]] - newer chips may be supported by [[https://github.com/IZ7BOJ/RPi-LoRa-KISS-TNC-2ndgen|RPi-LoRa-KISS-TNC-2ndgen]] RNode supports many of the same LoRa hardware options as the APRS firmware, but not all (it does seem to be actively worked on though), and even supports home brew hardware builds. It can also do a lot of other things as well as packet radio, not all amateur radio related. ==== RNode TNC ==== RNode firmware can be installed using the rnodeconf command included in the rns python package, which can be installed with pip: pip install rns This provides the rnodeconf command. Install firmware by running: rnodeconf --autoinstall This will prompt you to plug in your device to USB, and select the virtual COM port it is on. Select the correct model and variant of the hardware you have when prompted, and it will install firmware. Note that as of 2024-08-14, 2E0HKD has noticed that selecting "LilyGO T-Beam", and then "433 MHz (with SX1268 chip)", does in fact select firmware for the SX1262, which works on a T-Beam v1.2 SX1262. (The SX1268 is a very similar chip so it may simply run on identical firmware). Once installed, the device can be put into packet TNC mode with a command like (change for your COM port, works with linux ports like "/dev/ttyUSB0" as well): rnodeconf -T --freq 439912500 --bw 125000 --sf 12 --cr 5 COM8 NOTE: this example is the LoRa APRS frequency, but limit your use of this in the real world so as not to crowd out that frequency with non-APRS traffic. Remember LoRa is spread spectrum and can use a wide bandwidth, although alternative settings can lower this bandwidth requirement. You can now use the COM port for serial KISS (115200 baud was seen to work on Windows). ACKMODE does not seem to be supported at this time (2024-08). This command will have to be run each time the device is plugged in to put it back into TNC mode. It is possible to choose lower bandwidths to fit in narrower channels, but the bitrate drops (or even higher bandwidth and faster!), so creativity in different bandplans is feasible. ===== Other Resources ===== * [[https://unsigned.io/understanding-lora-parameters/|LoRa Bitrate, Bandwidth, and Sensitivity calculator]] * [[https://sidx.org.uk/projects/lora-aprs-setup/|LoRa APRS Setup]] * [[https://github.com/sh123/esp32_loraprs|esp32_loraprs]] - ESP32 based LoRa/FSK KISS Bluetooth/BLE/USB/TCPIP modem, and supports "APRSDroid TNC2 text APRS packet mode" * [[https://github.com/nakhonthai/ESP32APRS_T-TWR|ESP32APRS_T-TWR]] - works in 3-modes: APRS internet gateway, digital repeater, tracker, with built-in TNC and radio transceiver. which is used with the ESP32-S3 LILYGO T-TWR Plus V2.0 board, "Bluetooth TNC2/KISS Mode" * [[https://www.facebook.com/groups/855723265400285/|LoRa Packet Radio (new age of PR)]] Facebook group OARC's own 2E0ITB is working on an embedded AX.25 implementation [[https://github.com/isomer/ax25embed/|ax25embed]], so it is entirely possible we could use this with a custom firmware (on either a LoRa dev board, or a custom micro + LoRa module) and make our own.