IMST Lite Gateway setup

Just to confirm:

  • is you configuration exactly the same as mine (see previous comment) ?
  • Have you tried /etc/init.d/sx1301-reset stop && /etc/init.d/sx1301-reset start (as root user)?

Same config (copy below) and reset (start/stop) runs without error.

raspberrypi:/home/admin# cat /etc/default/chirpstack-concentratord 
# reset the LoRa concentrator on Concentratord start
CONCENTRATOR_RESET="yes"

# reset pin
CONCENTRATOR_RESET_PIN=5

# power enable pin
CONCENTRATOR_POWER_EN_PIN=18

# concentratord version
CONCENTRATORD_VERSION="sx1301"

Mine is also with the Raspberry Pi 1 (I received it recently). I’m not sure why it works for me but not for you.

Maybe there are different revisions of the IMST Lite gateway? (with different reset pins). My convertor board (between the iC880a and the Pi 1) has printed Part: 10066, PCB v6.

Maybe Pictures are easier than writing. My PCB is V1.4 an i have no idea where i can find the printed Part number.


I have asked IMST about the difference between V1.4 and V6 :slight_smile: In case it is mapped to a different reset pin, it would explain the difference in behavior.

Do you know which reset pin was used previously on your gateway?

I asked also for it :sweat_smile: , the will be happy about that.
We should checkout http://www.technoblogy.com/show?1XKI and https://github.com/ttn-zh/ic880a-gateway/tree/spi for the pin layout. With this script everything is working.

Could you try to update /etc/default/concentratord to:

# reset the LoRa concentrator on Concentratord start
CONCENTRATOR_RESET="yes"

# reset pin
CONCENTRATOR_RESET_PIN=25

# power enable pin
CONCENTRATOR_POWER_EN_PIN=18

# concentratord version
CONCENTRATORD_VERSION="sx1301"

Then:

  • re-run the sx1301-reset stop and start command
  • try to start concentratord from the cli

If that works, run monit start chirpstack-concentratord. When restarting the gateway, concentratord should be automatically started on boot.

Nevermind, I didn’t fully read your first link, see:

  • Change the reset pin to 5 by editing the line near the top of the file to:
    SX1301_RESET_BCM_PIN=5

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