Questions about BEACON STATE LOST

Problem with Class B in LoRaWAN1.0.3 SDK.

This problem has been bothering me for a long time. I hope you can give me some advice . I used AU915. I don’t know if the problem is with the gateway or the server Settings or the End-device.

image
image

Do you have any specific questions?
Have you made progress since first post?

Thank you for your response. I have read the relevant data and it seems that nothing has changed when the Settings of frequency and DR Are default. Not much progress. Is this problem related to the GPS of the gateway?

GPS is normally required for a gateway to transmit beacons.

Do you have a gateway?
Does it have GPS?
Is it configured to emit beacons?

Yes I have the gateway, I also read the SRV_MAC_DEVICE_TIME_ANS return the time is also normal.

            gpsEpochTime.Seconds = ( uint32_t )payload[macIndex++];
            gpsEpochTime.Seconds |= ( uint32_t )payload[macIndex++] << 8;
            gpsEpochTime.Seconds |= ( uint32_t )payload[macIndex++] << 16;
            gpsEpochTime.Seconds |= ( uint32_t )payload[macIndex++] << 24;
            gpsEpochTime.SubSeconds = payload[macIndex++];

          // Convert the fractional second received in ms
          // round( pow( 0.5, 8.0 ) * 1000 ) = 3.90625
          gpsEpochTime.SubSeconds = ( int16_t )( ( ( int32_t )gpsEpochTime.SubSeconds * 1000 ) >> 8 );

          // Copy received GPS Epoch time into system time
         sysTime = gpsEpochTime;
	     printf("sysTime:%lld",sysTime);
  • Is the time here coming from the gateway or the server?

MAC commands are authored by the network server. DeviceTimeAns is a MAC command.

So first of all, I need to make sure that the GPS of the gateway is working, right?

Yes. Gateway logs should be clear is GPS and beacons are functioning.

  • I looked at the gateway log. Here’s the screenshot.
    image

Nice screenshot.

What do you see is or isn’t happening?
Is the gateway configured to use GPS and emit beacons?

It seems that the GPS doesn’t work, I asked the gateway staff, I re-upgraded the firmware of the gateway, but it still seems to have the same effect. This is a screenshot of the new gateway log.

image

image

image

Also make sure the gateway is configured to transmit beacons. TTN provided configs do not switch it on (and by default it is off).

I do not seem to find the switch of bencon transmission in the gateway configuration interface.

It is a keyword : value pair in the local_conf.json or global_conf.json file.

This is the global conf.json I downloaded from TTN.

{
  "SX1301_conf": {
    "lorawan_public": true,
    "clksrc": 1,
    "antenna_gain": 0,
    "radio_0": {
      "enable": true,
      "type": "SX1257",
      "freq": 917200000,
      "rssi_offset": -166,
      "tx_enable": true,
      "tx_freq_min": 915000000,
      "tx_freq_max": 928000000
    },
    "radio_1": {
      "enable": true,
      "type": "SX1257",
      "freq": 917900000,
      "rssi_offset": -166,
      "tx_enable": false
    },
    "chan_multiSF_0": {
      "enable": true,
      "radio": 0,
      "if": -400000
    },
    "chan_multiSF_1": {
      "enable": true,
      "radio": 0,
      "if": -200000
    },
    "chan_multiSF_2": {
      "enable": true,
      "radio": 0,
      "if": 0
    },
    "chan_multiSF_3": {
      "enable": true,
      "radio": 0,
      "if": 200000
    },
    "chan_multiSF_4": {
      "enable": true,
      "radio": 1,
      "if": -300000
    },
    "chan_multiSF_5": {
      "enable": true,
      "radio": 1,
      "if": -100000
    },
    "chan_multiSF_6": {
      "enable": true,
      "radio": 1,
      "if": 100000
    },
    "chan_multiSF_7": {
      "enable": true,
      "radio": 1,
      "if": 300000
    },
    "chan_Lora_std": {
      "enable": true,
      "radio": 0,
      "if": 300000,
      "bandwidth": 500000,
      "spread_factor": 8
    },
    "chan_FSK": {
      "enable": false
    },
    "tx_lut_0": {
      "pa_gain": 0,
      "mix_gain": 8,
      "rf_power": -6,
      "dig_gain": 0
    },
    "tx_lut_1": {
      "pa_gain": 0,
      "mix_gain": 10,
      "rf_power": -3,
      "dig_gain": 0
    },
    "tx_lut_2": {
      "pa_gain": 0,
      "mix_gain": 12,
      "rf_power": 0,
      "dig_gain": 0
    },
    "tx_lut_3": {
      "pa_gain": 1,
      "mix_gain": 8,
      "rf_power": 3,
      "dig_gain": 0
    },
    "tx_lut_4": {
      "pa_gain": 1,
      "mix_gain": 10,
      "rf_power": 6,
      "dig_gain": 0
    },
    "tx_lut_5": {
      "pa_gain": 1,
      "mix_gain": 12,
      "rf_power": 10,
      "dig_gain": 0
    },
    "tx_lut_6": {
      "pa_gain": 1,
      "mix_gain": 13,
      "rf_power": 11,
      "dig_gain": 0
    },
    "tx_lut_7": {
      "pa_gain": 2,
      "mix_gain": 9,
      "rf_power": 12,
      "dig_gain": 0
    },
    "tx_lut_8": {
      "pa_gain": 1,
      "mix_gain": 15,
      "rf_power": 13,
      "dig_gain": 0
    },
    "tx_lut_9": {
      "pa_gain": 2,
      "mix_gain": 10,
      "rf_power": 14,
      "dig_gain": 0
    },
    "tx_lut_10": {
      "pa_gain": 2,
      "mix_gain": 11,
      "rf_power": 16,
      "dig_gain": 0
    },
    "tx_lut_11": {
      "pa_gain": 3,
      "mix_gain": 9,
      "rf_power": 20,
      "dig_gain": 0
    },
    "tx_lut_12": {
      "pa_gain": 3,
      "mix_gain": 10,
      "rf_power": 23,
      "dig_gain": 0
    },
    "tx_lut_13": {
      "pa_gain": 3,
      "mix_gain": 11,
      "rf_power": 25,
      "dig_gain": 0
    },
    "tx_lut_14": {
      "pa_gain": 3,
      "mix_gain": 12,
      "rf_power": 26,
      "dig_gain": 0
    },
    "tx_lut_15": {
      "pa_gain": 3,
      "mix_gain": 14,
      "rf_power": 27,
      "dig_gain": 0
    }
  },
  "gateway_conf": {
    "gateway_ID": "",
    "server_address": "au1.cloud.thethings.network",
    "serv_port_up": 1700,
    "serv_port_down": 1700,
    "servers": [
      {
        "gateway_ID": "",
        "server_address": "au1.cloud.thethings.network",
        "serv_port_up": 1700,
        "serv_port_down": 1700,
        "serv_enabled": true
      }
    ]
  }
}

Do you see anything regarding beacons in that file? Probably not as I wrote yesterday. So you need to modify it to enable beacons.

Did you turn on beacon global_conf.json? I can compare. Now the problem is that I can’t seem to find the gateway beacon switch.

You could try googling, took me 5 minutes to find example global_conf.json files with beacon settings. Try something like “beacon”: true, in the gateway_conf part. If that doesn’t work there are other settings to try, check for instance the example at packet_forwarder/global_conf.json.US902.beacon at master · Lora-net/packet_forwarder · GitHub for beacon related settings.

Thank you very much, this lets me know it’s not the End-device code’s fault. I can’t use Google because of restrictions, so I have limited access to information. Thanks again.

This is the gateway’s generate-config.sh file for beacon Settings. After I changed it, nothing seems to have changed.


	###Beacon Related
	json_add_int "beacon_period" "32"
	json_add_int "beacon_freq_hz" "923300000"
    json_add_int "beacon_freq_nb" "8"
    json_add_int "beacon_freq_step" "600000"     
	json_add_int "beacon_datarate" "8"
	json_add_int "beacon_bw_hz" "125000"	
	json_add_int "beacon_power" "14"
	json_add_int "beacon_infodesc" "0"	
	json_add_int	"time_interval" "`uci -q get gateway.general.stat`"