Single Channel Packet Forwarder part 1 [Deprecated]

The downlink freq does not have to be configured: the network will send a txpk message containing all information (including the frequency and the precise timing) of the message that the gateway has to transmit.

btw: the gateway will only listen on a single channel at the moment, default only CHN[0] will be used…

Hello,

I setup a single channel gateway with Rasperry Pi HopeRF, using Dragino Lora/GPS Hat, everything works fine but I can’t see gateway status using rest service. https://www.thethingsnetwork.org/api/v0/gateways/b827ebffff0b3881/

I can’t find the problem ?

Gateway output;

root@raspberrypi:~/lorawan/single_chan_pkt_fwd # ./single_chan_pkt_fwd
wiringPiSetup
wiringPiSTPISetup
SetupLoRa
SX1276 detected, starting.
Gateway ID: b8:27:eb:ff:ff:0b:38:81
Listening at SF7 on 868.100000 Mhz.

stat update: {“stat”:{“time”:"2016-09-19 20:15:13 ",“lati”:41.02222,“long”:28.94264,“alti”:10,“rxnb”:0,“rxok”:0,“rxfw”:0,“ackr”:0.0,“dwnb”:0,“txnb”:0,“pfrm”:“Istanbul LoRaWAN",“mail”:"lorawanistanbul@gmail.com”,“desc”:“Istanbul LoRaWAN community experimental GW”}}
Packet RSSI: -64, RSSI: -118, SNR: 9, Length: 29
rxpk update: {“rxpk”:[{“tmst”:1974247665,“chan”:0,“rfch”:0,“freq”:868.100000,“stat”:1,“modu”:“LORA”,“datr”:“SF7BW125”,“codr”:“4/5”,“lsnr”:9,“rssi”:-64,“size”:29,“data”:“QOJ3troAAAAB7PbE0ki960F5iGSTdSGXb9TPGN0=”}]}
stat update: {“stat”:{“time”:"2016-09-19 20:15:43 ",“lati”:41.02222,“long”:28.94264,“alti”:10,“rxnb”:1,“rxok”:1,“rxfw”:0,“ackr”:0.0,“dwnb”:0,“txnb”:0,“pfrm”:“Istanbul LoRaWAN",“mail”:"lorawanistanbul@gmail.com”,“desc”:“Istanbul LoRaWAN community experimental GW”}}
stat update: {“stat”:{“time”:"2016-09-19 20:16:13 ",“lati”:41.02222,“long”:28.94264,“alti”:10,“rxnb”:0,“rxok”:0,“rxfw”:0,“ackr”:0.0,“dwnb”:0,“txnb”:0,“pfrm”:“Istanbul LoRaWAN",“mail”:"lorawanistanbul@gmail.com”,“desc”:“Istanbul LoRaWAN community experimental GW”}}
stat update: {“stat”:{“time”:"2016-09-19 20:16:43 ",“lati”:41.02222,“long”:28.94264,“alti”:10,“rxnb”:0,“rxok”:0,“rxfw”:0,“ackr”:0.0,“dwnb”:0,“txnb”:0,“pfrm”:“Istanbul LoRaWAN",“mail”:"lorawanistanbul@gmail.com”,“desc”:“Istanbul LoRaWAN community experimental GW”}}
stat update: {“stat”:{“time”:"2016-09-19 20:17:13 ",“lati”:41.02222,“long”:28.94264,“alti”:10,“rxnb”:0,“rxok”:0,“rxfw”:0,“ackr”:0.0,“dwnb”:0,“txnb”:0,“pfrm”:“Istanbul LoRaWAN",“mail”:"lorawanistanbul@gmail.com”,“desc”:“Istanbul LoRaWAN community experimental GW”}}
stat update: {“stat”:{“time”:"2016-09-19 20:17:43 ",“lati”:41.02222,“long”:28.94264,“alti”:10,“rxnb”:0,“rxok”:0,“rxfw”:0,“ackr”:0.0,“dwnb”:0,“txnb”:0,“pfrm”:“Istanbul LoRaWAN",“mail”:"lorawanistanbul@gmail.com”,“desc”:“Istanbul LoRaWAN community experimental GW”}}
stat update: {“stat”:{“time”:"2016-09-19 20:18:13 ",“lati”:41.02222,“long”:28.94264,“alti”:10,“rxnb”:0,“rxok”:0,“rxfw”:0,“ackr”:0.0,“dwnb”:0,“txnb”:0,“pfrm”:“Istanbul LoRaWAN",“mail”:"lorawanistanbul@gmail.com”,“desc”:“Istanbul LoRaWAN community experimental GW”}}
Packet RSSI: -65, RSSI: -118, SNR: 9, Length: 29
rxpk update: {“rxpk”:[{“tmst”:2143566014,“chan”:0,“rfch”:0,“freq”:868.100000,“stat”:1,“modu”:“LORA”,“datr”:“SF7BW125”,“codr”:“4/5”,“lsnr”:9,“rssi”:-65,“size”:29,“data”:“QOJ3troABgABKEo+pL7nr8i3Q70HnLRWBYCiv9o=”}]}

That v0 API is obsolete. Don’t use it anymore.
Check if your gateway is listed here: http://staging.thethingsnetwork.org/gatewaystatus/
And if you configured lat/long, check here also: http://ha-23.eradus.eu/croft.html

GW is running but I cant see it on http://staging.thethingsnetwork.org/gatewaystatus/

I solved the problem by changing interface and the internet connection. I think it was network problem.

Dear all.

Someone with problem when trying change the SF?
I do set the new SF on main.cpp, make clean, make all, and restart the lora service but it appears that SF don’t change. The gateway keep receiving packet with SF7 and don’t receive the packets with the new SF.
I’m using Raspberry Pi and transceiver Modtronix inAIR98.

I made a gateway yesterday based on the Wemos D1 mini (ESP8266) and the small shield board of @Charles (they can be ordered from pcbs.io for $5.30 per 4 including shipping).

You have to change the ESP-sc-gway20.ino file so that dio0 is referring to D8/GPIO15 and solder a small wire at the backside of the shield board to make that physical connection. dio1 and dio2 are not used. Done…

2 Likes

Nice :slight_smile:

Just curious you soldered a wire instead of D2, right ?

Just did not have a small diode available so indeed I soldered a wire. Seems to be working without problem. Maybe for next gateways I will use D2.

Just curious also: Does the board work as a LMIC node without dio1 connected to a separate pin?

if you just need DIO0 a wire is fine, but as soon as you need DIO0 and DIO1 (LMIC for example) you need to

  • Choice 1 : solder D2 and D3, so yes it will works with LMIC with only one GPIO

  • Choice 2 : direct 2 GPIO connection, no diode,

    • wire from DIO0 to GPIO15 (as you did)
    • and for example DIO1 to GPIO4
    • and depends on you needs (FSK or not) for example DIO2 to GPIO5

And of course In both cases, you need to change pin definition in your LMIC sketch

1 Like

Very elegant solution in software! I use my own LMIC version also so I’ll have to build a separate version too if I use these boards for sensor nodes.

@platenspeler

You can use lmic Without dio’s. Only ss and spi is needed

In Matthijs Kooijman lib with LMIC_UNUSED and a esp…

See:

I’m a bit lost @Charles :slight_smile:

I build your version 1.0 PCB Gateway but it does not seem the function well.
After trying several settings i am able to receive packets but when i look at the gateway status it shows:
5CCF7FFFFF81C496 Uplink:N/A Downlink: active Last Seen: now

Statistics screen:
Packages Received 24
Packages OK 24
Packages Forwarded 0

The ESP-sc-gway20.ino file RFM-ESP settings looks like this >

// SX1276 - ESP8266 connections
int ssPin = 16; // GPIO15, D8, 15
int dio0 = 15; // GPIO5, D1, 5
int dio1 = 0; // GPIO4, D2, 4
int dio2 = 0; // GPIO3, !! NOT CONNECTED IN THIS VERSION, 3
int RST = 0; // GPIO16, D0, not connected, 0

DIO0 seems te be already connected with GPIO15 on the PCB.
So, the only thing I have to do is change the .ino file and solder a wire DIO1 - GPIO4? Right?

After a long time of experimenting, it turns out that the RSSI values during CAD in LORA mode are not very reliable.

When I perform a CAD on 868.1Mhz, I also get high RSSI values when a message is sent on 868.3Mhz. So I cannot use the LORA RSSI to detect a signal on a specific frequency, which I need for a channel hopping scheme…

So I will dust of my FSK RSSI detector code that hopefully will be able to separate the channels better…

1 Like

@PH3V
To be honest I didn’t tested well as SC Lora GW so I can’t really tell you, where is the source code you try ?

Anyway, you are correct, on V1.0 board, only DIO0 is connected to GPIO15

So you can connect DIO1 to GPIO4 for example so code should be like that (better to use NOT_A_PIN or 0xFF instead of 0 because 0 is GPIO0)

#ifndef NOT_A_PIN
#define NOT_A_PIN 0xFF
#endif
// SX1276 - ESP8266 connections
int ssPin = 16;
int dio0 = 15;
int dio1 = 4;
int dio2 = NOT_A_PIN;  //  NOT CONNECTED IN THIS VERSION, 3
int RST = NOT_A_PIN; // not connected, 0

In principle even dio1 does not need to be connected, only dio0 for the code you are using.

Can you explain the issue you have? From what the webserver outputs, your 1-ch gateway seems to be working fine. The forwarded field is for downlink messages from server to node, and that is normally 0 for sensor traffic.

Guys, can we use single channel Gateway for sending Ack/downlink messages from TTN to end node? Any help …as I am planning to build one here using this http://www.mobilefish.com/developer/lorawan/lorawan_quickguide_build_lora_gateway.html… and code is here https://github.com/tftelkamp/single_chan_pkt_fwd.git ( where it says Downlink not yet tested)

No, Thomas has not built it in his version of the single channel gateway for RaspberryPI.

If you use https://github.com/things4u/ESP-1ch-Gateway-v2.0 for the ESP8266 it is possible to send downlink messages in SF7 and SF8.

You will have to add these functions yourself if you want to stick to using the Raspberry.

Maarten

Btw: I think using a Raspberry for single channel gateway is too expensive given the alternative(s) based on the ESP8266…

1 Like

Some minutes ago I have added a new version of the Single Channel Gateway for ESP8266 on my github. The new version is 3.0 (and it is in beta status).
https://github.com/things4u/ESP-1ch-Gateway-v3.0

Major new function is the WiFiManager support so you’ll be able to assign the SSID/password to the gateway using your mobile phone :slight_smile:

Still working on some other stuff, so I will probably post some updates to this code over the coming days/weeks. Use at you own risk.

Maarten

3 Likes

The LoRaWanGateway running on an ESP8266 supports uplinks on all SF’s, OTAA and downlinks and sending on all frequencies and SF’s. It runs reliable for weeks now…

The project can be found on GitHub - JaapBraam/LoRaWanGateway: A LoRaWan Gateway in LUA

1 Like