Unable to connect WM1302 + RPi 4 Gateway to TTS

Hello,

I have been following this tutorial to connect a Raspberry Pi 4 model B + WM1302 Semtech UDP Packet Forwarder to TTN: LoRaWAN® Gateway Module WM1302 - Seeed Wiki

After following all of the steps, the packet forwarder works as intended and is receiving data from sensors. However, the gateway shows up as disconnected in the TTN console.

Here is a screenshot of my TTN console:

Screen Shot 2022-07-29 at 4.52.53 PM

Here is the output I get in the terminal when I start the packet forwarder:

Screen Shot 2022-07-29 at 4.58.45 PM

Edit:
Here is a screenshot of my global_conf file as well:

Screen Shot 2022-07-29 at 5.09.27 PM

Any help is greatly appreciated.

Regards,
Raymond

Welcome @raymondalvin

Please familiarize yourself on how to post, we can not read log files or code easily posted as pictures. Use the buttons to format your post correctly please.

1 Like

In your config, change the beacon frequency to one legal for your location and disable forward_crc_error and forward_crc_disabled please (TTN will discard those on receipt anyway)

And in the TTN console you need to fix the EUI to the one used by the gateway (check your output which mentions the right one), that will fix the offline issue.

I have changed the beacon frequency to 925000000 and changed forward_crc_error and forward_crc_disabled to false. I also changed the EUI in TTN but it still shows up as disconnected in the console.

Here is the global_conf file:

{
    "SX130x_conf": {
        "com_type": "SPI",
        "com_path": "/dev/spidev0.0",
        "lorawan_public": true,
        "clksrc": 0,
        "antenna_gain": 0, /* antenna gain, in dBi */
        "full_duplex": false,
        "fine_timestamp": {
            "enable": false,
            "mode": "all_sf" /* high_capacity or all_sf */
        },
        "sx1261_conf": {
            "spi_path": "/dev/spidev0.1",
            "rssi_offset": 0, /* dB */
            "spectral_scan": {
                "enable": false,
                "freq_start": 903900000,
                "nb_chan": 8,
                "nb_scan": 2000,
                "pace_s": 10
            },
            "lbt": {
                "enable": false /* LBT for 500 Khz channels is not supported */
            }
        },
        "radio_0": {
            "enable": true,
            "type": "SX1250",
            "freq": 904300000,
            "rssi_offset": -215.4,
            "rssi_tcomp": {"coeff_a": 0, "coeff_b": 0, "coeff_c": 20.41, "coeff_d": 2162.56, "coeff_e": 0},
            "tx_enable": true,
            "tx_freq_min": 923000000,
            "tx_freq_max": 928000000,
            "tx_gain_lut":[
                {"rf_power": 12, "pa_gain": 0, "pwr_idx": 15},
                {"rf_power": 13, "pa_gain": 0, "pwr_idx": 16},
                {"rf_power": 14, "pa_gain": 0, "pwr_idx": 17},
                {"rf_power": 15, "pa_gain": 0, "pwr_idx": 19},
                {"rf_power": 16, "pa_gain": 0, "pwr_idx": 20},
                {"rf_power": 17, "pa_gain": 0, "pwr_idx": 22},
                {"rf_power": 18, "pa_gain": 1, "pwr_idx": 1},
                {"rf_power": 19, "pa_gain": 1, "pwr_idx": 2},
                {"rf_power": 20, "pa_gain": 1, "pwr_idx": 3},
                {"rf_power": 21, "pa_gain": 1, "pwr_idx": 4},
                {"rf_power": 22, "pa_gain": 1, "pwr_idx": 5},
                {"rf_power": 23, "pa_gain": 1, "pwr_idx": 6},
                {"rf_power": 24, "pa_gain": 1, "pwr_idx": 7},
                {"rf_power": 25, "pa_gain": 1, "pwr_idx": 9},
                {"rf_power": 26, "pa_gain": 1, "pwr_idx": 11},
                {"rf_power": 27, "pa_gain": 1, "pwr_idx": 14}
            ]
        },
        "radio_1": {
            "enable": true,
            "type": "SX1250",
            "freq": 905000000,
            "rssi_offset": -215.4,
            "rssi_tcomp": {"coeff_a": 0, "coeff_b": 0, "coeff_c": 20.41, "coeff_d": 2162.56, "coeff_e": 0},
            "tx_enable": false
        },
        "chan_multiSF_All": {"spreading_factor_enable": [ 5, 6, 7, 8, 9, 10, 11, 12 ]},
        "chan_multiSF_0": {"enable": true, "radio": 0, "if": -400000},  /* Freq : 903.9 MHz*/
        "chan_multiSF_1": {"enable": true, "radio": 0, "if": -200000},  /* Freq : 904.1 MHz*/
        "chan_multiSF_2": {"enable": true, "radio": 0, "if":  0},       /* Freq : 904.3 MHz*/
        "chan_multiSF_3": {"enable": true, "radio": 0, "if":  200000},  /* Freq : 904.5 MHz*/
        "chan_multiSF_4": {"enable": true, "radio": 1, "if": -300000},  /* Freq : 904.7 MHz*/
        "chan_multiSF_5": {"enable": true, "radio": 1, "if": -100000},  /* Freq : 904.9 MHz*/
        "chan_multiSF_6": {"enable": true, "radio": 1, "if":  100000},  /* Freq : 905.1 MHz*/
        "chan_multiSF_7": {"enable": true, "radio": 1, "if":  300000},  /* Freq : 905.3 MHz*/
        "chan_Lora_std":  {"enable": true, "radio": 0, "if":  300000, "bandwidth": 500000, "spread_factor": 8,						/* Freq : 904.6 MHz*/
                           "implicit_hdr": false, "implicit_payload_length": 17, "implicit_crc_en": false, "implicit_coderate": 1},
        "chan_FSK":       {"enable": false, "radio": 1, "if":  300000, "bandwidth": 125000, "datarate": 50000}						/* Freq : 868.8 MHz*/
    },

    "gateway_conf": {
        "gateway_ID": "0016c001ff19bafe",
        /* change with default server address/ports */
        "server_address": "nam1.cloud.thethings.network",
        "serv_port_up": 1700,
        "serv_port_down": 1700,
        /* adjust the following parameters for your network */
        "keepalive_interval": 10,
        "stat_interval": 30,
        "push_timeout_ms": 100,
        /* forward only valid packets */
        "forward_crc_valid": true,
        "forward_crc_error": false,
        "forward_crc_disabled": false,
        /* GPS configuration */
        "gps_tty_path": "/dev/ttyS0",
        /* GPS reference coordinates */
        "ref_latitude": 0,
        "ref_longitude": 0,
        "ref_altitude": 0,
        /* Beaconing parameters */
        "beacon_period": 0, /* disable class B beacon */
        "beacon_freq_hz": 925000000,
        "beacon_datarate": 9,
        "beacon_bw_hz": 125000,
        "beacon_power": 14,
        "beacon_infodesc": 0
    },

    "debug_conf": {
        "ref_payload":[
            {"id": "0xCAFE1234"},
            {"id": "0xCAFE2345"}
        ],
        "log_file": "loragw_hal.log"
    }
}

Here is the output when I run the packet forwarder:

US915
*** Packet Forwarder ***
Version: 2.1.0
*** SX1302 HAL library version info ***
Version: 2.1.0;
***
INFO: Little endian host
INFO: found configuration file global_conf.json.sx1250.US915, parsing it
INFO: global_conf.json.sx1250.US915 does contain a JSON object named SX130x_conf, parsing SX1302 parameters
INFO: com_type SPI, com_path /dev/spidev0.0, lorawan_public 1, clksrc 0, full_duplex 0
INFO: antenna_gain 0 dBi
INFO: Configuring legacy timestamp
INFO: Configuring Tx Gain LUT for rf_chain 0 with 16 indexes for sx1250
INFO: radio 0 enabled (type SX1250), center frequency 904300000, RSSI offset -215.399994, tx enabled 1, single input mode 0
INFO: radio 1 enabled (type SX1250), center frequency 905000000, RSSI offset -215.399994, tx enabled 0, single input mode 0
INFO: Lora multi-SF channel 0>  radio 0, IF -400000 Hz, 125 kHz bw, SF 5 to 12
INFO: Lora multi-SF channel 1>  radio 0, IF -200000 Hz, 125 kHz bw, SF 5 to 12
INFO: Lora multi-SF channel 2>  radio 0, IF 0 Hz, 125 kHz bw, SF 5 to 12
INFO: Lora multi-SF channel 3>  radio 0, IF 200000 Hz, 125 kHz bw, SF 5 to 12
INFO: Lora multi-SF channel 4>  radio 1, IF -300000 Hz, 125 kHz bw, SF 5 to 12
INFO: Lora multi-SF channel 5>  radio 1, IF -100000 Hz, 125 kHz bw, SF 5 to 12
INFO: Lora multi-SF channel 6>  radio 1, IF 100000 Hz, 125 kHz bw, SF 5 to 12
INFO: Lora multi-SF channel 7>  radio 1, IF 300000 Hz, 125 kHz bw, SF 5 to 12
INFO: Lora std channel> radio 0, IF 300000 Hz, 500000 Hz bw, SF 8, Explicit header
INFO: FSK channel 8 disabled
INFO: global_conf.json.sx1250.US915 does contain a JSON object named gateway_conf, parsing gateway parameters
INFO: gateway MAC address is configured to 0016C001FF19BAFE
INFO: server hostname or IP address is configured to "nam1.cloud.thethings.network"
INFO: upstream port is configured to "1700"
INFO: downstream port is configured to "1700"
INFO: downstream keep-alive interval is configured to 10 seconds
INFO: statistics display interval is configured to 30 seconds
INFO: upstream PUSH_DATA time-out is configured to 100 ms
INFO: packets received with a valid CRC will be forwarded
INFO: packets received with a CRC error will NOT be forwarded
INFO: packets received with no CRC will NOT be forwarded
INFO: GPS serial port path is configured to "/dev/ttyS0"
INFO: Reference latitude is configured to 0.000000 deg
INFO: Reference longitude is configured to 0.000000 deg
INFO: Reference altitude is configured to 0 meters
INFO: Beaconing period is configured to 0 seconds
INFO: Beaconing signal will be emitted at 925000000 Hz
INFO: Beaconing datarate is set to SF9
INFO: Beaconing modulation bandwidth is set to 125000Hz
INFO: Beaconing TX power is set to 14dBm
INFO: Beaconing information descriptor is set to 0
INFO: global_conf.json.sx1250.US915 does contain a JSON object named debug_conf, parsing debug parameters
INFO: got 2 debug reference payload
INFO: reference payload ID 0 is 0xCAFE1234
INFO: reference payload ID 1 is 0xCAFE2345
INFO: setting debug log file name to loragw_hal.log
INFO: [main] TTY port /dev/ttyS0 open for GPS synchronization
CoreCell reset through GPIO17...
SX1261 reset through GPIO17...
CoreCell power enable through GPIO18...
CoreCell ADC reset through GPIO13...
Opening SPI communication interface
Note: chip version is 0x10 (v1.0)
INFO: using legacy timestamp
INFO: LoRa Service modem: configuring preamble size to 8 symbols
ARB: dual demodulation disabled for all SF
INFO: found temperature sensor on port 0x39
INFO: [main] concentrator started, packet can now be received
INFO: concentrator EUI: 0x0016c001ff19bafe
INFO: [down] PULL_ACK received in 27 ms
INFO: [down] PULL_ACK received in 27 ms
INFO: [down] PULL_ACK received in 25 ms

##### 2022-07-30 16:54:33 GMT #####
### [UPSTREAM] ###
# RF packets received by concentrator: 0
# CRC_OK: 0.00%, CRC_FAIL: 0.00%, NO_CRC: 0.00%
# RF packets forwarded: 0 (0 bytes)
# PUSH_DATA datagrams sent: 0 (0 bytes)
# PUSH_DATA acknowledged: 0.00%
### [DOWNSTREAM] ###
# PULL_DATA sent: 3 (100.00% acknowledged)
# PULL_RESP(onse) datagrams received: 0 (0 bytes)
# RF packets sent to concentrator: 0 (0 bytes)
# TX errors: 0
### SX1302 Status ###
# SX1302 counter (INST): 30740704
# SX1302 counter (PPS):  0
# BEACON queued: 0
# BEACON sent so far: 0
# BEACON rejected: 0
### [JIT] ###
src/jitqueue.c:440:jit_print_queue(): INFO: [jit] queue is empty
#--------
src/jitqueue.c:440:jit_print_queue(): INFO: [jit] queue is empty
### [GPS] ###
# Invalid time reference (age: 1659200073 sec)
# no valid GPS coordinates available yet
### Concentrator temperature: 27 C ###
##### END #####

JSON up: {"stat":{"time":"2022-07-30 16:54:33 GMT","rxnb":0,"rxok":0,"rxfw":0,"ackr":0.0,"dwnb":0,"txnb":0,"temp":26.6}}
INFO: [up] PUSH_ACK received in 23 ms
INFO: [down] PULL_ACK received in 23 ms
INFO: [down] PULL_ACK received in 24 ms
INFO: [down] PULL_ACK received in 27 ms

Here is a screenshot of my TTN console:
Screen Shot 2022-07-30 at 9.54.22 AM

Again, thanks for the help!

Next step is to activate a node and check if its data is forwarded. The status is not always up to date.

I have a Tektelic Smart Room Sensor PIR connected to the packet forwarder. Here is the output in the terminal when the packet forwarder receives data from the sensor:

INFO: Received pkt from mote: 10000000 (fcnt=32730)



JSON up: {"rxpk":[{"jver":1,"tmst":484234622,"chan":0,"rfch":0,"freq":903.900000,"mid": 8,"stat":1,"modu":"LORA","datr":"SF10BW125","codr":"4/5","rssis":-50,"lsnr":12.8,"foff":2188,"rssi":-50,"size":23,"data":"AAAAABCA2n9kHXcAAADaf2TAVLMrRyQ="}]}

INFO: [up] PUSH_ACK received in 24 ms



INFO: Received pkt from mote: 10000000 (fcnt=32730)



JSON up: {"rxpk":[{"jver":1,"tmst":490946506,"chan":8,"rfch":0,"freq":904.600000,"mid":16,"stat":1,"modu":"LORA","datr":"SF8BW500","codr":"4/5","rssis":-50,"lsnr":15.5,"foff":2225,"rssi":-49,"size":23,"data":"AAAAABCA2n9kHXcAAADaf2SU5nvim5M="}]}

INFO: [up] PUSH_ACK received in 20 ms

INFO: [down] PULL_ACK received in 45 ms

INFO: [down] PULL_ACK received in 37 ms

I have added the sensor to TTN inside of an application but its status does not update and no activity is shown:

Screen Shot 2022-08-02 at 9.10.21 PM

I still have no activity for the gateway and it shows up as disconnected:

Screen Shot 2022-08-02 at 9.16.22 PM

Thank you.

If I have your gateway ID correct – raspberrypigateway6 – seems like it have never connected to TTN

https://mapper.packetbroker.net/api/v2/gateways/netID=000013,tenantID=ttn,id=raspberrypigateway6

Yes, it has always shown as disconnected.

Is your firewall settings?

Can you run the following ping and see your network response?

The nam cluster is in CA

Here are the ping results:

Screen Shot 2022-08-03 at 4.34.40 PM 1

Screen Shot 2022-08-03 at 4.36.59 PM

Screen Shot 2022-08-03 at 4.40.00 PM

I live in CA so the first two latency tests make sense but the last one seems to be off. Every time I run it I get totally different results.

You did confirm the server you pointing your gateway to is correct? (I assumed you did do this first)

Yes, the gateway is pointing to the correct server (nam1).

Is gateway_ID correct?

That is the correct Gateway EUI. The Gateway ID is raspberrypigateway6.

I don’t know the sketch you used, as I have never used it. Do you have a link to it?

Have you checked if it is not case sensitive?

Hello Johan,

I don’t exactly know what you mean by which sketch I have used. I have messaged you with the link to my account and login details so you can take a look.

Thanks.

Like the rest of us here, @Johan_Scheepers is a volunteer and not obliged to act on your login which, frankly, sharing your login when you could have just made him a collaborator is not a good idea.

As for ‘which sketch’ - that would relate to the device you have - which perhaps uncovers some prior learning that you need to fill in so you understand the background of all of the many moving parts of LoRaWAN. Suffice to say your login won’t give anyone access to the sketch - but if you message me your bank details that will certainly help :wink:

I know this is an old post but did you ever figure out this issue? I’m having the same problem with this setup.

what same problem do you have?

descried you problem please and what do you see in the gateway console

what is the gateway eui?

I appreciate the reply. I ended up recreating the gateway on TTS and everything is now working. I must have missed something. Thanks again!