Closed hallard closed 6 years ago
1) The MP forwarder does not reset the concentrator. Use the same command sequence used for the poly forwarder to reset. (Should be in the reset_lgw.sh script)
2) There are known issues with all packet forwarders on the RPi3 due to SPI timing not being correct. In my experience if the startup fails it usually works after a few attempts (with reset in between). If it continuously fails you can try the spi_speed branch (requires spi_speed branch of lora_gateway as well!) and specify the SPI speed on the command-line when starting the packet forwarder. To fix the SPI timings check this thread on the TTN forum
Jac
Thanks for this helpfull information, I was not aware about SPI because to be honest I never had this problem and I'm using RPI3 (at least on 4 gateways) with my fork of your old packed forwarder.
Good to know that reset is not done by your packet forwarder.
What is strange is that I've got 3 packet forwarder on this RPI3, 2 works fine (TTN new official, and old poly) only this one has issue with Concentrator.
Anyway funny that SPI is wrong, I had same problem with console uart (my plate board has FTDI) and I already set core_freq=250
and set_turbo=1
and problem still exist.
May be I missed something in build process, I'll get a chance with spi speed branch one day ;-)
Anyway, thanks for helping me.
This forwarder is the only one of the three using the newest lora libraries from Semtech. May-be that one is more particular?
good catch, do you think I can test it with old lora lib ?
so strange got compiled spi_speed branch of libloragw and mp_packet tried all (with reset in between of course)
./mp_pkt_fwd -s 8000000
./mp_pkt_fwd -s 5000000
./mp_pkt_fwd -s 4000000
./mp_pkt_fwd -s 1000000
none worked ;-( Anyway I wanted to know CPU usage of your new packet forwarder ? on my RPI3 old is 1% and TTN offcial is 10% (too much for my taste), hoping your in between ;-)
Old lora lib has different API. Will not work without some work. Could you try resin with https://github.com/jpmeijers/ttn-resin-gateway-rpi to see if that works?
Top inside resin container shows ~ 1% for forwarder.
Yeah, I would like to, not sure to understand what resin is in fact, something like docker ?
Check resin.io : Resin.io brings the benefits of Linux containers to the IoT. Develop iteratively, deploy safely, and manage at scale.
Need to try this ;-) Ok I done something interesting, gone to IMST LoraLite gateway (not a RPI3) rebuild your packet forwarder same thing unable to start concentrator, I think I missed something in build process ;-)
Have you configured it for use with 'native' spi and the correct device in lora_gateway/libloragw/library.cfg? Or are you accidentally trying to use the USB version? (SPI does not require libmpsse so if you need that you know you're not building for the right hardware)
For building on an RPi, you could use https://github.com/jpmeijers/ttn-resin-gateway-rpi/blob/master/dev/build.sh That version is for iC880a and works with RAK831 as well.
Thanks for the information
I think I'm in no luck with MP packet forwarder
I just tried from another GW, an official IMST Gateway Lite (ic880a + Rpi B+) so not a PI3
I launched build script build.sh
from dev folder of resin.io, build fine and just changed install folder to
/opt/ttn-gateway/resin.io
to avoid any conflict with original poly packet forwarder
Since resin.io script install wiringPi I've done reset script and changed pin to GPIO5 to be sure
#!/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
launched
root@ttn-gw07(rw):/opt/ttn-gateway/resin.io# ../reset.sh
Accessing concentrator reset pin through GPIO5...
root@ttn-gw07(rw):/opt/ttn-gateway/resin.io# ./mp_pkt_fwd
*** Multi Protocol Packet Forwarder for Lora Gateway ***
Version: 3.0.0
*** Lora concentrator HAL library version info ***
Version: 5.0.1; Options: native;
***
INFO: Little endian host
INFO: found global configuration file global_conf.json, parsing it
...
INFO: [main] Starting the concentrator
ERROR: Failed to load fw 1
ERROR: Version of calibration firmware not expected, actual:0 expected:2
ERROR: [main] failed to start the concentrator
root@ttn-gw07(rw):/opt/ttn-gateway/resin.io#
and of course launching original poly packet forwarder starts the concentrator fine
root@ttn-gw07(rw):/opt/ttn-gateway/bin# ../reset.sh
Accessing concentrator reset pin through GPIO5...
root@ttn-gw07(rw):/opt/ttn-gateway/bin# ./poly_pkt_fwd
*** Poly Packet Forwarder for Lora Gateway ***
Version: 2.1.0
*** Lora concentrator HAL library version info ***
Version: 3.1.0; Options: native;
***
INFO: Little endian host
INFO: found global configuration file global_conf.json, parsing it
...
INFO: [main] concentrator started, radio packets can now be received.
INFO: [down] Thread activated for all server router.eu.thethings.network
INFO: [up] Thread activated for all servers.
INFO: [down] for server router.eu.thethings.network PULL_ACK received in 48 ms
I'm totally lost, building on my own or with resin.io on 2 different targets (RPI3 and RPI2 B+) with each is own ic880a board never succeeded to have it working.
Please check the global_config.json you are using, what is the clock source set to?
Jac you got it !!! I changed clock source, it was default setup for multitech not for other. I changed to setup clock source to 1 and now it works. Worth mentioning this on resin.io build script :-)
/* "clksrc": 1, radio_1 provides clock to concentrator for most devices except MultiTech */
"clksrc": 0, /* radio_0 provides clock to concentrator for MultiTech */
to
"clksrc": 1, /* radio_1 provides clock to concentrator for most devices except MultiTech */
/* "clksrc": 0, radio_0 provides clock to concentrator for MultiTech */
Works on IMST Lite GW, I'll try on PI3 now
Thank you for your help
The full resin.io setup uses a python script to download the latest configuration at startup. By just using the build script you are not 'enjoying' the full experience :wink: and hence encountered this issue.
Hi kersing I've build from scratch on my PI3 with IMST IC880a board on raspbian etcher.
When I launch old packet forwarder all is working fine.
Now I reset the concentrator with reset script and I launch new mp packet forwarder failed to start concentrator
Ok now try to launch old packet forwarder that was working just before
humm, seems concentrator config has been changed, let's restart with a reset before
works fine, so I suspect there is a problem with reset pin and I don't know were to setup it in the new packet forwarder when building it on target ?
Any idea of this problem, maybe it's not reset relatated?
Thanks for your help
For information official TTN binary packet forwarder starts fine also after a reset of the concentrator