2 Configuration
sh123 edytuje tę stronę 2022-12-19 11:14:59 +02:00

LoRa library configuration

  • If you are not using SX1278 module then modify module declaration in config.h find and replace SX1278 with your module name. Read more about supported modules at RadioLib Wiki.
  • If you are using SX126X module then un-comment USE_SX126X define and replace MODULE_NAME with your module name if using module other than SX1268

Software configuration

  • go to esp32_loraprs.ino and make next changes based on your requirements in initializeConfig()
  • if you are planning to use different esp32 pinouts then modify config.h
    • lora module SS, CFG_LORA_PIN_SS, GPIO_5
    • lora module RST, CFG_LORA_PIN_RST, GPIO_26
    • lora module DIO0, CFG_LORA_PIN_DIO0, GPIO_14
  • if you are planning to experiment with different bandwidths/spread factors then modify values in initializeConfig(), with current parameters APRS packet time on air is around 1-2 seconds @ 292bps/36Bps, to decode with as lower level as possible with reasonable speed (comparable to 300bps HF APRS), use https://github.com/tanupoo/lorawan_toa or https://www.rfwireless-world.com/calculators/LoRa-Data-Rate-Calculator.html to make further calculations
    • lora bandwidth cfg.LoraBw, 125 kHz (also tested with 20.6 KHz and SF9 with frequency correction)
    • lora spread factor cfg.LoraSf, 12 (should decode down to -20dB, chosen with the goal for minimum signal decode)
    • lora coding rate cfg.LoraCodingRate, 7
    • lora output power cfg.LoraPower, 20 (max 20 dBm ~ 100mW, change to lower value if needed)
    • sync word cfg.LoraSync, 0x34
  • consider minimum decode level based on on BW + SF and required throughput alt text
  • uses LoRa built-in checksum calculation to drop broken packets

Frequency drift and calibration

  • note, that there a is significant frequency drift on temperature changes for different modules, especially on 868 MHz, drift seems to be acceptable on 433 MHz, so it could be used for bandwidths, which are less than 125 MHz, but it needs testing for each module
    • you need to use external TCXO if you are planning to use modules for narrow bandwidths less than 125 kHz
    • or calibrate clients based on server frequency drift report by changing cfg.LoraFreq, for example, let client and server run for an 30-60 minutes and if server reports err: -1500, then set client frequency to about 1000 kHz less, e.g. instead of 433.775 set it to 433.774, this will give couple of additional dB
    • alternatively automatic calibration could be done on server or client side by enabling automatic frequency correction by setting cfg.EnableAutoFreqCorrection to true, might be suitable for experiments where only one client is operating or if server broadcast messages, so clients can correct their frequency. Use it either on client side to tune all clients to server frequency if TX is enabled on iGate side or to tune server to single client for test purposes

APRS iGate configuration

  • other useful options are
    • cfg.EnableSignalReport set to true to enable signal report, it will be added as a comment to APRS-IS submitted location
    • cfg.EnablePersistentAprsConnection set to false to avoid keeping connection open to APRS-IS
    • cfg.EnableRfToIs set to true to forward RF traffic to APRS-IS
    • cfg.EnableIsToRf set to true to forward APRS-IS traffic to RF, see also cfg.AprsFilter for traffic filtering
    • cfg.EnableRepeater set to true to enable packet repeater
    • cfg.EnableBeacon set to true to enable periodic beacons specified in cfg.AprsRawBeacon with period specified in cfg.AprsRawBeaconPeriodMinutes into RF and APRS-IS if cfg.EnableRfToIs is enabled
    • cfg.LoraUseIsr set to true to enable LoRa incoming packet handling using interrupts in continous RX mode suitable for speech data, otherwise set to false for single packet polling mode

BLE support

  • iOS does not support serial over Bluetooth and requires BLE support, this enables APRS applications such as official aprs.fi to work with the modem
  • to enable BLE support set cfg.BtEnableBle to true

USB serial support

  • Enable USB serial support by setting cfg.UsbSerialEnable/CFG_USB_SERIAL_ENABLE to true
  • When USB serial is enable Bluetooth and TCP/IP KISS server will be disabled

KISS over TCP/IP

  • Enable KISS over TCP/IP server by setting KissEnableTcpIp/CFG_KISS_TCP_IP to true
  • Bluetooth is NOT going to be disabled if enabled by setting name in cfg.BtName/CFG_BT_NAME
  • Default port is 8001
  • Additionally, it is possible to run modem in WiFi AP mode by setting to cfg.WifiEnableAp/CFG_WIFI_ENABLE_AP to true in this case cfgWifiSsid/CFG_WIFI_SSID and cfg.WifiKey/CFG_WIFI_KEY will be used.

APRSDroid configuration

  • when setting up APRSDroid, use "TNC (KISS)" connection protocol in Connection Preferences -> Connection Protocol

alt text

  • Use TNC (plaintext TNC2) for interoperability with text based LoRa APRS trackers, which do NOT use AX25, set cfg.EnableTextPackets/CFG_TEXT_PACKETS to true to enable this modem mode of operation. If you need compatibility with https://www.lora-aprs.info/ then also set cfg.EnableTextPackets3/CFG_TEXT_PACKETS_3 to true.

alt text