SX1303 915M LoRaWAN Gateway Module+HAT for Raspberry Pi (CE09113)

This is a placeholder topic for “SX1303 915M LoRaWAN Gateway Module+HAT for Raspberry Pi” comments.

SX130x 868M/915M LoRaWAN Gateway Module/HAT for Raspberry Pi, L76K Module(HAT only), Standard Mini-PCIe Socket, Long range Transmission, Large Capacity,…

Read more

1 Like

Could this module potentially be configured to work with a Chirpstack LNS running on the same Raspberry Pi or is it a strict TTS setup?

Hi Ben,

It looks like the hardware is physically capable of running a Chirpstack network as it’s referenced in the manufacturer’s product wiki however the documentation and provided sample code is based on a setup using The Things Network. You would likely have a lot of custom configuration ahead of you.

2 Likes

Thanks Trent, more weekends than I have time for at the moment I reckon!

Did anyone successfully get the data from lora module ? i only got GPS data but not lora data from my lora transmitter. I wrote simple readline command using pySerial python library.

my python code:
image

Only gps data showing:

My lora transmitter looks like this:

from machine import UART, Pin
from utime import sleep_ms, ticks_ms

sleep_ms(1000)
uart = UART(1, baudrate=9600, tx=Pin(4), rx=Pin(5), timeout=1000)

def receive_uart():
    '''Polls the uart until all data is dequeued'''
    rxData=bytes()
    while uart.any()>0:
        rxData += uart.read(1)
        sleep_ms(2)
    return rxData.decode('utf-8')

def send_AT(command):
    '''Wraps the "command" string with AT+ and \r\n'''
    buffer = 'AT' + command + '\r\n'
    uart.write(buffer)
#     sleep_ms(300)
    uart.readline()

def echo():
    while uart.any() > 0:
        rxData = uart.readline()
        print(rxData.decode('utf-8'))

send_AT('+MODE=TEST')
send_AT('+TEST=RFCFG,915,SF7')


last_transmit = 0
transmit_period = 500

while True:
    now = ticks_ms()
    if now - last_transmit > transmit_period:
        last_transmit = now
        send_AT('+TEST=TXLRPKT,"00 00 01 00 00 af 80 07 02 00 00 39"\n')  # send test data
    
    echo() # show debug data from LoRa-E5 module
    
    sleep_ms(600)

1 Like

Hi Gunawan,

How were you intending to use this HAT? As a TTN gateway or just raw LoRa?

Have you taken a look at the Waveshare guide to see if it works in the intended configuration?

Could you send us a picture of how you have everything hooked up?

Here is the scenarios: I want those two small transmitter sending data to the raspi 4 with lora hat.
I don’t want to use TTN, just raw data, because i am planning to push the data from raspi 4 to company server via mqtt only. No third party services.

regards,

Gunawan

1 Like

Hi Gunawan,

Looks like more in-depth instructions can be found here:

The L76 GNSS chip is actually separate, so that might explain why you’re not getting messages from the “concentrator” in the same serial feed:

I was looking at the sx1302 git repo and noticed that there wasn’t an AU915 configuration file.
Does anyone know where i can get one or more about the packet_forwarder configuration to modify an existing config file?

Cheers

Hi Steven,

While I haven’t worked with LoRaWAN or this board before, I did find some other forum chatter about this:

And a github link to some config files that mention the frontend chip in this HAT, perhaps you can splice something together?

Hi James,
I also queried waveshare and they supplied me with the AU915 config file.
AU915FSB1.zip (1.3 KB)

I have attached it for the benefit of others searching for the same thing…

5 Likes

Hi Steven,

Thank you very much for sharing!

2 Likes

9 posts were split to a new topic: LoRa from Scratch - a dive into the workings of LoRaWAN

Hey all,

I’ve downloaded the AU915FSB1, and updated it. There’s only a two things that don’t work, so I’m reaching out hoping that there is someone in this group that’s got it up and running correctly, and are willing to share their configuration.

  1. I haven’t been able to configure the GPS correctly.
  2. Uploads to the things network work correctly, but my downloads appear to fail.

Any help would be appreciated
Kind Regards,
Pete Smith

I suspect the downloads will be linked to the lack of GPS working.
There are very tight timings when the node will check for a download message and the upstream components should tell the gateway when to send the downlink message.

Its been a while, but from memory I had an issue with the GPS as well, I think I tweaks the source code to get it working.

if you run the gateway “lora_pkt_fwd” from the command line, do you see any messages re the gps ?

OK I found the gps fix I made in mine.

In file : loragw_gps.c
About Line *** 535,541 ****
          memcpy(parser_buf, serial_buff, buff_size);
          parser_buf[buff_size] = '\0';
          nb_fields = str_chop(parser_buf, buff_size, ',', str_index, ARRAY_SIZE(str_index));
!         if (nb_fields != 13) {
              DEBUG_MSG("Warning: invalid RMC sentence (number of fields)\n");
              return IGNORED;
          }
--- 535,541 ----
          memcpy(parser_buf, serial_buff, buff_size);
          parser_buf[buff_size] = '\0';
          nb_fields = str_chop(parser_buf, buff_size, ',', str_index, ARRAY_SIZE(str_index));
!         if ((nb_fields != 13) && (nb_fields != 14)) {
              DEBUG_MSG("Warning: invalid RMC sentence (number of fields)\n");
              return IGNORED;
          }

i.e. I found in my setup the GPS packets we needed to allow had 14 Fields, but the code was dropping out if it only had 13. So I add the check to keep it valid if 13 OR 14 fields.

1 Like

Thank you so much for your reply!

Unfortunately, the fix you suggested didn’t resolve my issue, though I appreciate all your help.

When I first run ./lora_pkt_fwd -c global_conf.json.sx1250.AU915, I receive this output:
image

After the initial run, I get this output:

I also checked cat /dev/ttyS0 and got the following result:
image

Over at The Things Network, I’m receiving this error, for the app:

Here are additional errors from the gateway:

Any help would be greatly appreciated as I’m building this for my students at TAFE.

Kind regards,
Pete Smith

The gps data looks like it has errors
Your image…
image
In the gps packets it should have a fixed format of
$<id/name>, < data>,*
But you have some incorrect data in there that does not match that

Edit:
Was the gps TTY output collected while the forwarder was running ? the weird output could be caused by more then one program reading ttyS0 at the same time; so if the gateway was running, try stopping that and re test the raw gps output.

Hey, thanks again!

Here are the changes I’ve made:

  • Disabled Bluetooth in /boot/config.txt.
  • Moved the GPS from /dev/ttyS0 to /dev/ttyAMA0.

This is the output when I run cat /dev/ttyAMA0:


Does this look better?

By the way, this is the content of my global_conf.json.sx1250.AU915 file:

{
    "SX130x_conf": {
        "com_type": "SPI",
        "com_path": "/dev/spidev0.0",
        "lorawan_public": true,
        "clksrc": 1,
        "antenna_gain": 5, /* 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": 867100000,
                "nb_chan": 8,
                "nb_scan": 2000,
                "pace_s": 10
            },
            "lbt": {
                "enable": false,
                "rssi_target": -70, /* dBm */
                "channels":[ /* 16 channels maximum */
                    { "freq_hz": 867100000, "bandwidth": 125000, "scan_time_us": 128,  "transmit_time_ms": 400 },
                    { "freq_hz": 867300000, "bandwidth": 125000, "scan_time_us": 128,  "transmit_time_ms": 400 },
                    { "freq_hz": 867500000, "bandwidth": 125000, "scan_time_us": 128,  "transmit_time_ms": 400 },
                    { "freq_hz": 867700000, "bandwidth": 125000, "scan_time_us": 128,  "transmit_time_ms": 400 },
                    { "freq_hz": 867900000, "bandwidth": 125000, "scan_time_us": 128,  "transmit_time_ms": 400 },
                    { "freq_hz": 868100000, "bandwidth": 125000, "scan_time_us": 128,  "transmit_time_ms": 400 },
                    { "freq_hz": 868300000, "bandwidth": 125000, "scan_time_us": 128,  "transmit_time_ms": 400 },
                    { "freq_hz": 868500000, "bandwidth": 125000, "scan_time_us": 128,  "transmit_time_ms": 400 },
                    { "freq_hz": 869525000, "bandwidth": 125000, "scan_time_us": 5000, "transmit_time_ms": 4000 },
                    { "freq_hz": 868300000, "bandwidth": 250000, "scan_time_us": 128,  "transmit_time_ms": 400 }
                ]
            }
        },
        "radio_0": {
            "enable": true,
            "type": "SX1250",
            "freq": 917200000,
            "rssi_offset": -166,
            "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": 915000000,
            "tx_freq_max": 928000000,
            "tx_gain_lut":[
                {"rf_power": -6, "pa_gain": 0, "pwr_idx": 15},
                {"rf_power": -3, "pa_gain": 0, "pwr_idx": 16},
                {"rf_power": 0, "pa_gain": 0, "pwr_idx": 17},
                {"rf_power": 3, "pa_gain": 1, "pwr_idx": 19},
                {"rf_power": 6, "pa_gain": 1, "pwr_idx": 20},
                {"rf_power": 10, "pa_gain": 1, "pwr_idx": 22},
                {"rf_power": 11, "pa_gain": 1, "pwr_idx": 1},
                {"rf_power": 12, "pa_gain": 2, "pwr_idx": 2},
                {"rf_power": 13, "pa_gain": 1, "pwr_idx": 3},
                {"rf_power": 14, "pa_gain": 2, "pwr_idx": 4},
                {"rf_power": 16, "pa_gain": 2, "pwr_idx": 5},
                {"rf_power": 20, "pa_gain": 3, "pwr_idx": 6},
                {"rf_power": 23, "pa_gain": 3, "pwr_idx": 7},
                {"rf_power": 25, "pa_gain": 3, "pwr_idx": 9},
                {"rf_power": 26, "pa_gain": 3, "pwr_idx": 11},
                {"rf_power": 27, "pa_gain": 1, "pwr_idx": 14}
            ]
        },
        "radio_1": {
            "enable": true,
            "type": "SX1250",
            "freq": 917900000,
            "rssi_offset": -166,
            "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},
        "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}
    },

    "gateway_conf": {
        "gateway_ID": "0016C001F15D658F",
        /* change with default server address/ports */
        "server_address": "au1.cloud.thethings.network",
        "serv_port_up": 1700,
        "serv_port_down": 1700,
        /* adjust the following parameters for your network */
        "keepalive_interval": 10,
        "stat_interval": 60,
        "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/ttyAMA0",
        /* GPS reference coordinates */
        "ref_latitude": 0.0,
        "ref_longitude": 0.0,
        "ref_altitude": 0,
                "servers": [
                  {
                        "gateway_ID": "0016C001F15D658F",
                        "server_address": "au1.cloud.thethings.network",
                        "serv_port_up": 1700,
                        "serv_port_down": 1700,
                        "serv_enabled": true
                  }
                ]
    },

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

Kind regards,
Pete Smith

1 Like

Could try setting clock src to 0

“SX130x_conf”: {
“com_type”: “SPI”,
“com_path”: “/dev/spidev0.0”,
“lorawan_public”: true,
“clksrc”: 1,                                       <--- Change to 0
“antenna_gain”: 5, /* antenna gain, in dBi /
“full_duplex”: false,
“fine_timestamp”: {
“enable”: false,
“mode”: “all_sf” / high_capacity or all_sf /

Not 100% sure on that but I think that referees to the radio to use. My setup has it at 0

Still looking at the reset of the config

1 Like