Hey,
I recently bought a Dragino PG1302 concetrator with the accompnying hat for the Raspberry Pi 4. I’ve been trying to to run it as a lora gateway and connect it to TTN via the Lora Basics protocol. I have used the following method as described in the docs to get to compile the Lora Basics binary and get it running:
git clone https://github.com/lorabasics/basicstation.git
cd basicstation/
make platform=rpi variant=std
And then in my ~/TTN
dir, I have the various configuration files, the API key, and letsencrypt cert:
tc.key
tc.trust # obtained with curl https://letsencrypt.org/certs/isrgrootx1.pem.txt -o tc.trust
tc.uri # wss://au1.cloud.thethings.network:8887
station.conf
The contents of my station.conf
is as follows:
{
"radio_conf": { /* Actual channel plan is controlled by the server */
"lorawan_public": true, /* is default */
"clksrc": 0,
"device": "/dev/spidev0.0",
"pps": true, /* default SPI device is platform specific */
"antenna_gain": 10, /* antenna gain, in dBi */
"full_duplex": false,
"radio_0": {
/* freq/enable provided by LNS - only hardware-specific settings are listed here */
"type": "SX1250",
"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
},
"radio_1": {
"type": "SX1250",
"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_X, chan_Lora_std, chan_FSK provided by LNS */
},
"station_conf": {
"log_file": "stderr",
"log_level": "INFO",
"log_size": 10e6,
"log_rotate": 3
}
}
and start the binary in the TTN
dir like so:
~/basicstation/build-rpi-std/bin/station
However there the gateway does not start . It looks like the entire station.conf just gets ignored due to a json parsing issue ast atated in the logs. It seems wierd that SX1250 is not a valid value for the type
field.
2024-02-18 05:10:24.789 [SYS:INFO] Logging : stderr (maxsize=10000000, rotate=3)
2024-02-18 05:10:24.789 [SYS:INFO] Station Ver : 2.0.6(rpi/std) 2024-02-17 04:26:48
2024-02-18 05:10:24.789 [SYS:INFO] Package Ver : (null)
2024-02-18 05:10:24.789 [SYS:INFO] mbedTLS Ver : 2.28.0
2024-02-18 05:10:24.789 [SYS:INFO] proto EUI : 0:d83a:dd21:46a2 (/sys/class/net/eth0/address)
2024-02-18 05:10:24.789 [SYS:INFO] prefix EUI : ::1 (builtin)
2024-02-18 05:10:24.789 [SYS:INFO] Station EUI : d83a:ddff:fe21:46a2
2024-02-18 05:10:24.789 [SYS:INFO] Station home: ./ (builtin)
2024-02-18 05:10:24.789 [SYS:INFO] Station temp: /var/tmp/ (builtin)
2024-02-18 05:10:24.789 [SYS:WARN] Station in NO-CUPS mode
2024-02-18 05:10:24.991 [TCE:INFO] Starting TC engine
2024-02-18 05:10:24.993 [AIO:INFO] ./tc.trust:
cert. version : 3
serial number : 82:10:CF:B0:D2:40:E3:59:44:63:E0:BB:63:82:8B:00
issuer name : C=US, O=Internet Security Research Group, CN=ISRG Root X1
subject name : C=US, O=Internet Security Research Group, CN=ISRG Root X1
issued on : 2015-06-04 11:04:38
expires on : 2035-06-04 11:04:38
signed using : RSA with SHA-256
RSA key size : 4096 bits
basic constraints : CA=true
key usage : Key Cert Sign, CRL Sig2024-02-18 05:10:24.993 [TCE:INFO] Connecting to INFOS: wss://au1.cloud.thethings.network:8887
2024-02-18 05:10:26.092 [TCE:INFO] Infos: d83a:ddff:fe21:46a2 muxs-::0 wss://au1.cloud.thethings.network:8887/traffic/eui-D83ADDFFFE2146A2
2024-02-18 05:10:26.092 [AIO:DEBU] [3] ws_close reason=1000
2024-02-18 05:10:26.092 [AIO:ERRO] Recv failed: SSL - The peer notified us that the connection is going to be closed
2024-02-18 05:10:26.092 [AIO:DEBU] [3] WS connection shutdown...
2024-02-18 05:10:26.094 [AIO:INFO] ./tc.trust:
cert. version : 3
serial number : 82:10:CF:B0:D2:40:E3:59:44:63:E0:BB:63:82:8B:00
issuer name : C=US, O=Internet Security Research Group, CN=ISRG Root X1
subject name : C=US, O=Internet Security Research Group, CN=ISRG Root X1
issued on : 2015-06-04 11:04:38
expires on : 2035-06-04 11:04:38
signed using : RSA with SHA-256
RSA key size : 4096 bits
basic constraints : CA=true
key usage : Key Cert Sign, CRL Sig2024-02-18 05:10:26.094 [TCE:VERB] Connecting to MUXS...
2024-02-18 05:10:27.324 [TCE:VERB] Connected to MUXS.
2024-02-18 05:10:27.399 [RAL:WARN] Ignoring unsupported/unknown field: full_duplex
2024-02-18 05:10:27.399 [JSN:ERRO] @.SX1302_conf.radio_0.type: Illegal value for field "type": SX1250
2024-02-18 05:10:27.399 [RAL:ERRO] Parsing of JSON failed - 'station.conf' ignored
2024-02-18 05:10:27.399 [RAL:ERRO] ral_config failed with status 0x01
2024-02-18 05:10:27.399 [any:ERRO] Closing connection to muxs - error in s2e_onMsg
2024-02-18 05:10:27.399 [AIO:DEBU] [3] ws_close reason=1000
2024-02-18 05:10:27.399 [AIO:DEBU] Echoing close - reason=1000
2024-02-18 05:10:27.445 [AIO:DEBU] [3|WS] Server sent close: reason=1000
2024-02-18 05:10:27.445 [AIO:DEBU] [3] WS connection shutdown...
2024-02-18 05:10:27.446 [TCE:VERB] Connection to MUXS closed in state -1
2024-02-18 05:10:27.446 [TCE:INFO] INFOS reconnect backoff 10s (retry 1)
So why is “SX1250” not a valid field? It is what is in basically all the other configs I see online for gateways using the SX1302/1303 chips and is apparently what is used in the PG1302 module. If anyone can help with this, it would be greatly appreciated.