IMST Lite Gateway setup

No I’am changing it to 5 in the script, look on the first link.

You could actually try to reset the sx1301 with:

#! /bin/bash

# Reset iC880a PIN
SX1301_RESET_BCM_PIN=5
echo "$SX1301_RESET_BCM_PIN"  > /sys/class/gpio/export 
echo "out" > /sys/class/gpio/gpio$SX1301_RESET_BCM_PIN/direction 
echo "0"   > /sys/class/gpio/gpio$SX1301_RESET_BCM_PIN/value 
sleep 0.1  
echo "1"   > /sys/class/gpio/gpio$SX1301_RESET_BCM_PIN/value 
sleep 0.1  
echo "0"   > /sys/class/gpio/gpio$SX1301_RESET_BCM_PIN/value
sleep 0.1
echo "$SX1301_RESET_BCM_PIN"  > /sys/class/gpio/unexport 

I see there are some minor differences compared to /etc/init.d/sx1301-reset (which is based on https://github.com/Lora-net/lora_gateway/blob/master/reset_lgw.sh).

after some research i find out that my spi sends only zeros, tommorrow I will try with different rpi.

to check spi working properly:

wget https://raw.githubusercontent.com/torvalds/linux/master/tools/spi/spidev_test.c

compile it:
gcc -o spidev_test spidev_test.c
and run it:
./spidev_test -D /dev/spidev0.0 -v

@overdull Die you have something new about it? Which revision of the gateway do you have?

I have the same revision of gateway as you. I managed do get it work, I install fresh version of raspbian and istall packet forrwarder and lora_gateway from github and only chirp-gateway-bridge because thats all I need, and then use this script to power up gateway.

SX1301_RESET_BCM_PIN=5
echo "$SX1301_RESET_BCM_PIN"  > /sys/class/gpio/export 
echo "out" > /sys/class/gpio/gpio$SX1301_RESET_BCM_PIN/direction 
echo "0"   > /sys/class/gpio/gpio$SX1301_RESET_BCM_PIN/value 
sleep 0.1  
echo "1"   > /sys/class/gpio/gpio$SX1301_RESET_BCM_PIN/value 
sleep 0.1  
echo "0"   > /sys/class/gpio/gpio$SX1301_RESET_BCM_PIN/value
sleep 0.1 
./lora_pkt_fwd

first few times I get same error ver:0 expected:2
but after few tries it starts

You used BasicStation or Semtech UDP Packet Forwarder as packet forrwarder?

I used semtech. This is guthub project i used

to install it just cd to folder and run make

I make the same thing, but i getting the old error.

ERROR: Failed to load fw 1
ERROR: Version of calibration firmware not expected, actual:0 expected:2
ERROR: [main] failed to start the concentrator

I’m running the rest script and after that the forwarder.

i got this error few times before it eventually starts

Try it a few times like this?

#!/bin/bash

for i in {0..100}
do
   sleep 10
   echo "RESET"
   cd /home/pi
   ./reset.sh
   echo "FWD"
   cd /home/pi/packet_forwarder/lora_pkt_fwd
   ./lora_pkt_fwd 
done

Big news fist script is working, second not.

I installed wiringpi and run this script and it’s directly working.

#!/bin/sh
RESET_PIN=5
echo "Accessing concentrator reset pin through GPIO$RESET_PIN..."
WAIT_GPIO() {
    sleep 0.1
}
gpio -g mode $RESET_PIN out ; WAIT_GPIO
gpio -g write  $RESET_PIN 0 ; WAIT_GPIO
gpio -g write  $RESET_PIN 1 ; WAIT_GPIO
gpio -g write  $RESET_PIN 0 ; WAIT_GPIO

Not working script:

#! /bin/bash

# Reset iC880a PIN
SX1301_RESET_BCM_PIN=5
echo "$SX1301_RESET_BCM_PIN"  > /sys/class/gpio/export 
echo "out" > /sys/class/gpio/gpio$SX1301_RESET_BCM_PIN/direction 
echo "0"   > /sys/class/gpio/gpio$SX1301_RESET_BCM_PIN/value 
sleep 0.1  
echo "1"   > /sys/class/gpio/gpio$SX1301_RESET_BCM_PIN/value 
sleep 0.1  
echo "0"   > /sys/class/gpio/gpio$SX1301_RESET_BCM_PIN/value
sleep 0.1
echo "$SX1301_RESET_BCM_PIN"  > /sys/class/gpio/unexport 

Now the big question, why?

Hi Martin,

I’m late to this thread but current dealing with a similar but different issue. However, on your point about the two scripts. Could it be because in the first script you are using WiringPi, for which “5” has a different meaning to the second script’s “5”? In the second script, it is referring to Pi’s GPIO_5". In the first, WiringPi’s definition of “5” is abstracted from the hardware, and depends on the platform. On a model B or B+ Pi, .WiringPi’s “5” is actually GPIO_24.

Regards,

Mike

I’m having the same problem here, thing is, the “/etc/init.d/sx1301-reset” file does not exist, I’m using the latest chirpstack OS, and the pin is set correctly and the “chirpstack-concentratord” only has the CONCENTRATORD_VERSION in it and it seems correct, yesterday, I had the same problem but it booted correctly after doing all the steps you put in except the sx1301-reset and it was OK in monit but now it says it does not exist, and i also had an error at the end when I tried to start the concentrator from the CLI so I got this:
2021-07-30 10:32:32,594 INFO [libconcentratord::reset] Configuring reset pin, pin: 22
2021-07-30 10:32:32,595 INFO [chirpstack_concentratord_sx1301::cmd::root] Starting Concentratord SX1301 (version: 3.2.0, docs: Introduction - ChirpStack open-source LoRaWAN<sup>®</sup> Network Server)
2021-07-30 10:32:32,595 INFO [libconcentratord::reset] Triggering concentrator reset
2021-07-30 10:32:32,795 INFO [chirpstack_concentratord_sx1301::concentrator] Setting spi device path, spidev_path: /dev/spidev0.0
2021-07-30 10:32:32,795 INFO [chirpstack_concentratord_sx1301::concentrator] Setting board configuration, lorawan_public: true, clock_source: 1
2021-07-30 10:32:32,795 INFO [chirpstack_concentratord_sx1301::concentrator] Setting up concentrator radios
2021-07-30 10:32:32,795 INFO [chirpstack_concentratord_sx1301::concentrator] Configuring radio, radio: 0, enabled: true, center_freq: 867500000, type: SX1257
2021-07-30 10:32:32,795 INFO [chirpstack_concentratord_sx1301::concentrator] Configuring radio, radio: 1, enabled: true, center_freq: 868500000, type: SX1257
2021-07-30 10:32:32,796 INFO [chirpstack_concentratord_sx1301::concentrator] Setting up concentrator channels
2021-07-30 10:32:32,796 INFO [chirpstack_concentratord_sx1301::concentrator] Configuring multi-SF LoRa channel, channel: 0, enabled: true, freq: 868100000, rf_chain: 1, if_freq: -400000
2021-07-30 10:32:32,796 INFO [chirpstack_concentratord_sx1301::concentrator] Configuring multi-SF LoRa channel, channel: 1, enabled: true, freq: 868300000, rf_chain: 1, if_freq: -200000
2021-07-30 10:32:32,796 INFO [chirpstack_concentratord_sx1301::concentrator] Configuring multi-SF LoRa channel, channel: 2, enabled: true, freq: 868500000, rf_chain: 1, if_freq: 0
2021-07-30 10:32:32,796 INFO [chirpstack_concentratord_sx1301::concentrator] Configuring multi-SF LoRa channel, channel: 3, enabled: true, freq: 867100000, rf_chain: 0, if_freq: -400000
2021-07-30 10:32:32,796 INFO [chirpstack_concentratord_sx1301::concentrator] Configuring multi-SF LoRa channel, channel: 4, enabled: true, freq: 867300000, rf_chain: 0, if_freq: -200000
2021-07-30 10:32:32,796 INFO [chirpstack_concentratord_sx1301::concentrator] Configuring multi-SF LoRa channel, channel: 5, enabled: true, freq: 867500000, rf_chain: 0, if_freq: 0
2021-07-30 10:32:32,796 INFO [chirpstack_concentratord_sx1301::concentrator] Configuring multi-SF LoRa channel, channel: 6, enabled: true, freq: 867700000, rf_chain: 0, if_freq: 200000
2021-07-30 10:32:32,796 INFO [chirpstack_concentratord_sx1301::concentrator] Configuring multi-SF LoRa channel, channel: 7, enabled: true, freq: 867900000, rf_chain: 0, if_freq: 400000
2021-07-30 10:32:32,797 INFO [chirpstack_concentratord_sx1301::concentrator] Configuring Std LoRa channel, enabled: true, freq: 868300000, rf_chain: 1, if_freq: -200000
2021-07-30 10:32:32,797 INFO [chirpstack_concentratord_sx1301::concentrator] Configuring FSK channel, enabled: true, freq: 868800000, rf_chain: 1, if_freq: 300000
2021-07-30 10:32:32,797 INFO [chirpstack_concentratord_sx1301::concentrator] Starting the concentrator
thread ‘main’ panicked at ‘called Result::unwrap() on an Err value: “lgw_start failed”’, chirpstack-concentratord-sx1301/src/main.rs:108:80
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace