Octanis 1 Field Basestation

This system is comprised of a Raspberry Pi connected to a LoRaWAN Shield and the dGPS Base station. An operator can connect to the system via Ethernet, after which they will be assigned an IP address by the Raspberry Pi. The operator then opens APM Planner, which will start receiving MAVLink packages automatically. The operator can also use APM Planner to send commands to the rover. Theses commands will be relayed by the Field Base Station using a “MAVLink to MQTT Bridge” which we still have to code.

dGPS is connected to the Raspi via USB. The Raspi forwards the serial port over tcp.

Raspberry Pi 1 running:

  • Linklabs LoRa Gateway Service (packet_forwarder)
  • Brocaar's loraserver & lora-gateway-bridge (in /opt/brocaar), which require:
    • Redis (sudo apt-get install redis-server)
    • Postgresql (sudo apt-get install postgresql)
    • Mosquitto (sudo apt-get install mosquitto)
    • packet_forwarder
    • socat (for ucenter over TCP)
  • MAVLink to MQTT bridge
  • DHCP Server (TODO, as last task only)

How to run manually (only necessary if Monit didn't do it's job):

  • If running for the first time, create a new postgres user and db for loraserver:
    • $ sudo su - postgres
      $ psql template1
      template1=# CREATE USER linklabs WITH PASSWORD 'linklabs';
      template1=# CREATE DATABASE loraserver;
      template1=# GRANT ALL PRIVILEGES ON DATABASE loraserver to linklabs;
      template1=# \q
      $ exit
  • If all prerequisites are installed, lora-gateway-bridge can be run with no arguments.
  • Then you can run
 ./loraserver --net-id 747474 --band EU_863_870 --postgres-dsn "postgres://linklabs:linklabs@localhost/loraserver?sslmode=disable" --db-automigrate

Setting up nodes

  • On the RN2483:
    • mac get deveui → write down somewhere
    • mac set appeui 70b3d57ed0000172 → Octanis 1 App on the Field Station
    • mac set appkey 01020304050607080910111213141516 → arbitrary key (must be same as on loraserver!)
    • mac join otaa → join the network, loraserver on Field Station will accept if OK
      • as a response, RN2483 will output ok and then after a few seconds accepted

Subscribing to nodes

  • mosquitto_sub -h -t “application/70b3d57ed0000172/node/+/rx” -v more here
  • mosquitto_pub -h -t “application/70b3d57ed0000172/node/f03d291000000046/tx” -m '{“reference”:“mavlink”,“devEUI”:“f03d291000000046”,“fPort”:1,“confirmed”: false,“data”:“3q2+796tvu8=”}' -q 0 → base64 encoded data (plaintext) - more here

Setting up LinkLabs Concentrator

  • Add kernel.sysrq=0 to /etc/sysctl.conf
  • Run sudo systemctl mask serial-getty@ttyAMA0.service

Example of received data from mosquitto_sub. Data is base64 encoded MAVLink HEARTBEAT.


Connecting APM Planner / Mission Planner to Field Base Station

  1. In APM Planner / Mission Planner setup a new UDP Link on Port 14550
  2. Make sure the bridge and the status_reporter is running on the Field Station (monit)

Debugging: viewing received APM Planner 2 MAVLink packets with mavproxy

  • mavproxy.py –master=
  • In APM Planner 2 don't forgot to add a “Remote Communication Link” UDP
  • Then use mavsearch.py mav.tlog to look for MAVLink messages in the binary log

Temperature & Battery

  • After 50min of use (surveying in + waiting for incoming LoRa tx): 4.01V → 3.9V, 41°C → 70°C RPi CPU temperature.
  • orb/fieldbasestation.txt
  • Last modified: 6 years ago
  • by sam