Hi all
I realized a gateway with Raspberry PI3 and Dragino Hat v1.4 in which I verified
the possibility to send downstream message to the node
I summarize all the steps in this topic
Original reference links ( where I took the suggestion )
forum/t/dragino-problems-and-solutions-topic
After assembling the Dragino Hat in the Raspberry, install the code
/bokse001/dual_chan_pkt_fwd
IMPORTANT NOTE:
This code was developed to use it with a gateway equipped with two RFM85s,
in our case we use only one RFM95 for which it is necessary
to make some modifications to the code after installation
PREREQUISITES
. Installation command git
sudo apt-get install git
. SPI needs to be enabled on the Raspberry Pi
. Installation wiringpi (GPIO access library )
sudo apt-get install wiringpi
INSTALLATION
cd /home/pi
git clone -b dual_chan_pkt_fwd_up_down https://github.com/bokse001/dual_chan_pkt_fwd
cd dual_chan_pkt_fwd
Modify configuration global_conf.json
Pins for Dragino hat are:
"pin_nss": 6,
"pin_dio0": 7,
"pin_nss_2": 6,
"pin_dio0_2": 7,
"pin_rst": 3,
The other pins can remain untouched.
Change the LoraModem.c file, comment out line 552
// Die("Unrecognized transceiver");
Complete the installation with command
make
sudo make install
The last command ,activates the gateway as a service ( start automatically ) each time the Raspberry is started
NOTE:
The global_conf.json file, is read every time the service is started,
after each change it is sufficient to restart the service
For the test I used a sensor with the code ttn-abp.ino taken from the examples folder of matthijskooijman/arduino-lmic subsequently modified, to transmit, only on channel 868100000
The default installation on the raspberry, / bokse001 / dual_chan_pkt_fwd
receive the messages only on channel 868300000, so I modified the global_conf.json file
by inverting the values of the two freq and freq_2 fields
from
{ “freq”: 868100000,
“freq_2”: 868300000,
…
to
{ “freq”: 868300000,
“freq_2”: 868100000,
…
Finally,
in the sensor code, to receive the DownStream message,
I added the following line of code, inside the setup () function, before do_send (& sendjob);
// Let LMIC offset for +/- 10% clock error
LMIC_setClockError (MAX_CLOCK_ERROR * 10/100);
AS I VERIFIED SENDING THE MESAGE TO THE NODE
For the test i used the TTN Console, send bytes message 00 01 02
From Application Data Console
In the node I received