Skip to content

Class-B: Beacon locking

This doc describes the process of locking a Class-B arduino device to a beaconing signal issued from the basic station and reading the GPS coordinates transmitted by that beacon.

Network Server

The LoRaWAN network server (LoraWanNetworkSrvModule) doesn't need any special configuration beyond the usual required launch settings.

Basic Station / Concentrator

For this setup, we use a concentrator with a GPS antenna attached.

Note: The GPS data can be faked by the concentrator in the case when no GPS antenna is available. This has not yet been tested. See Class B Beaconing Settings, Creating a FIFO and GPS NMEA data for more information.

Modify station.conf (see this GH issue for more context about the following settings):

1. Add "pps": true under SX1301_conf. 2. Add "pps": "fuzzy" under station_conf. 3. [Optional] Set "log_level": "XDEBUG" for extra detailed logs.

When the basic station is run, we expect a few things to happen:

  1. Beaconing starts and is immediately suspended awaiting synchronization from the network server.

    [S2E:INFO] Beaconing every 2m8s on 869.525MHz(1) @ DR3 (frame layout 2/8/17)
    [S2E:INFO] Beaconing suspend - missing GPS data: time
    
  2. A timesync message is sent from the basic station to the network server.

    [AIO:XDEB] [3|WS] > {"msgtype":"timesync","txtime":1023024197}
    
  3. A timesync response message is received from the network server.

    [AIO:XDEB] [3|WS] < {"txtime":1023024197,"gpstime":1350820883268000,"msgtype":"timesync"}
    
  4. Beaconing resumes:

    [S2E:INFO] Beaconing resumed - recovered GPS data: time
    

Multiple things may go wrong during this process. Check this page for some common issues and troubleshooting tips.

Arduino

To test that the beacon can be locked by an arduino device, flash the following code onto your Seeeduino LoRaWAN.

void setup()
{
    Serial1.begin(9600);
    SerialUSB.begin(115200);
}

void loop()
{
    while(Serial1.available())
    {
        SerialUSB.write(Serial1.read());
    }
    while(SerialUSB.available())
    {
        Serial1.write(SerialUSB.read());
    }
}

Open the serial monitor and check the version.

AT+VER

We recommend upgrading the firmware, some of the following might fail for older versions.

Switch to Class mode (See section 4.25.5 here)

AT+CLASS=B

Wait until the +BEACON: LOCKED message is receieved. Then retrieve the beacon info:

AT+BEACON=INFO

Which should return the longitude and latitude in the last 2 parameters +BEACON: INFO, 000000, 000000, 8.469193, 47.39558


Last update: 2022-11-02
Created: 2022-11-02