Skip to content

Instantly share code, notes, and snippets.

@yon2004
Last active July 26, 2026 06:50
Show Gist options
  • Select an option

  • Save yon2004/4ddf47ac079a6e8335be5d8bc9eaed7a to your computer and use it in GitHub Desktop.

Select an option

Save yon2004/4ddf47ac079a6e8335be5d8bc9eaed7a to your computer and use it in GitHub Desktop.
[Unit]
Description=Lora BasicStation
After=syslog.target network.target
[Service]
SuccessExitStatus=143
#User=appuser
#Group=appgroup
Type=simple
WorkingDirectory=/opt/basicstation/bin/
ExecStart=/opt/basicstation/bin/station
ExecStop=/bin/kill -15 $MAINPID
[Install]
WantedBy=multi-user.target
#!/bin/bash
# GPIO pin used to reset the LoRaGo Port concentrator
SX1301_RESET_PIN=25
CHIP=gpiochip0
reset() {
echo "LoRaGoPort reset through GPIO$SX1301_RESET_PIN..."
sudo gpioset --chip "$CHIP" --hold-period=100ms --toggle=100,0 "$SX1301_RESET_PIN=1"
}
term() {
echo "Releasing GPIO$SX1301_RESET_PIN..."
sudo gpioset --chip "$CHIP" --hold-period=100ms --toggle=100,0 "$SX1301_RESET_PIN=1"
}
case "$1" in
start)
reset
;;
stop)
term
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac
exit 0
sudo cp -r basicstation/build-rpi-std/* /opt/basicstation/
sudo nano /etc/systemd/system/basicstation.service
sudo systemctl daemon-reload
sudo systemctl enable basicstation.service
sudo systemctl start basicstation.service
{
/* If slave-X.conf present this acts as default settings */
"SX1301_conf": { /* Actual channel plan is controlled by server */
"lorawan_public": true, /* is default */
"clksrc": 1, /* radio_1 provides clock to concentrator */
/* path to the SPI device, un-comment if not specified on the command line e.g., RADIODEV=/dev/spidev0.0 */
"device": "/dev/spidev0.0",
/* freq/enable provided by LNS - only HW specific settings listed here */
"radio_0": {
"type": "SX1257",
"rssi_offset": -166.0,
"tx_enable": true,
"antenna_gain": 0
},
"radio_1": {
"type": "SX1257",
"rssi_offset": -166.0,
"tx_enable": false
}
/* chan_multiSF_X, chan_Lora_std, chan_FSK provided by LNS */
},
"station_conf": {
"log_file": "stderr",
"log_level": "NOTICE", /* XDEBUG,DEBUG,VERBOSE,INFO,NOTICE,WARNING,ERROR,CRITICAL */
"log_size": 10000000,
"log_rotate": 3,
"CUPS_RESYNC_INTV": "1s",
"routerid": "aaaaaafffeaaaaaa",
"radio_init": "./reset_lgw.sh start",
"RADIO_INIT_WAIT": "1s",
"gps": "/dev/Serial0",
"pps": "gps"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment