====== LoRaWAN Gateway auf dem Raspberry Pi 3 ====== ===== Hardware ===== * [[https://www.raspberrypi.com/products/raspberry-pi-3-model-b-plus/|Raspberry Pi 3 B+]] * [[https://www.seeedstudio.com/WM1302-Pi-Hat-p-4897.html|WM1302 Raspberry Pi Hat]] * [[https://www.seeedstudio.com/UF-L-SMA-K-1-13-120mm-p-5046.html|SMA to I-PEX Antenna Cable - 120mm]] * [[https://www.berrybase.de/waveshare-lpwa-lora-antenne-868mhz-5dbi-vertikal-sma-male-ip65-magnetfuss-50-ohm-10w|Waveshare LPWA Lora Antenne, 868MHz, 5dBi, vertikal, SMA Male, IP65, Magnetfuß, 50 Ohm, 10W]] * [[https://www.seeedstudio.com/WM1302-LoRaWAN-Gateway-Module-USB-EU868-p-4892.html|Wio-WM1302 Long Range Gateway Module(USB) - EU868]] * [[https://www.seeedstudio.com/WM1302-LoRaWAN-Gateway-Module-SPI-EU868-p-4889.html|Wio-WM1302 Long Range Gateway Module(SPI) - EU868]] * [[https://wiki.seeedstudio.com/WM1302_module/|Seeed Studio Wiki zum LoRaWAN® Gateway Modul WM1302]] * [[https://github.com/Lora-net/sx1302_hal/issues/116|Issue with GPS Synchronization in LoRa Packet Forwarder-waveshare SX1302 pi Hat #116|Issue with GPS Synchronization in LoRa Packet Forwarder-waveshare SX1302 pi Hat #116]] ===== Installation ===== Die Installation erfolgt nach WIKI. sudo apt update sudo apt install -y git cd ~ git clone https://github.com/Lora-net/sx1302_hal # cd ~/sx1302_hal make ==== Bugfix für GPS Synchronisation ==== libloragw/src/loragw_gps.c: 832 if (nb_fields != 13) { # Change that to: 832 if ( (nb_fields != 13) && (nb_fields != 14) ) { # This change will accept NMEA G?RMC messages with 13 or 14 fields, not only those with 13 as before. The L76K receiver apparently defaults to sending 14-field-messages. ==== Bugfix für "Transmit downlink data packets" ==== Siehe Seeed Studio Wiki FAQ: "Why my devices can not join the network server even if all the settings are correct?" mcedit /sx1302_hal/packet_forwarder/src/jitqueue.c # change TX_JIT_DELAY from 40000 to 120000 ##define TX_JIT_DELAY 40000 /* Pre-delay to program packet for TX in microseconds */ #define TX_JIT_DELAY 120000 /* Pre-delay to program packet for TX in microseconds */ ==== SystemD Service ==== Den LoRaWAN Packet Forwarder als Systemd Service starten: sudo touch /etc/systemd/system/loragateway.service sudo mcedit /etc/systemd/system/loragateway.service [Unit] Description=WM1302 LoRaWAN Gateway Service After=network-online.target Wants=network-online.target [Service] Type=simple User=root WorkingDirectory=/home/christoph/sx1302_hal/packet_forwarder #ExecStartPre=/bin/sh -c '/home/pi/sx1302_hal/tools/reset_lgw.sh start' ExecStart=/home/christoph/sx1302_hal/packet_forwarder/lora_pkt_fwd -c /home/christoph/sx1302_hal/packet_forwarder/global_conf.json.sx1250.EU868.USB > /dev/null 2>&1 Restart=on-failure RestartSec=10 [Install] WantedBy=multi-user.target ==== Geräte-ID (Concentrator EUI) auslesen ==== ./sx1302_hal/util_chip_id/chip_id -u -d /dev/ttyACM0 Opening USB communication interface INFO: Configuring TTY INFO: Flushing TTY INFO: Setting TTY in blocking mode INFO: Connect to MCU INFO: Concentrator MCU version is V01.00.00 INFO: MCU status: sys_time:85510 temperature:40.4oC Note: chip version is 0x10 (v1.0) INFO: using legacy timestamp ARB: dual demodulation disabled for all SF INFO: concentrator EUI: 0x<16-stellige-EUI> Closing USB communication interface