Single Channel Gateway part 3


#1

Pi Zero RFM95 Single Channel Gateway 460x446
Example hardware: Raspberry Pi Zero + RFM95 hat + Wifi dongle

For previous parts of this topic see:
Single Channel Gateway part 1
Single Channel Gateway part 2

List of single channel gateway implementations

Below is a list of actual, up-to-date RFM9x / SX127x-based single channel gateway implementations:
(List was last updated on: 2017-12-05)

For Raspberry Pi

  • https://github.com/hallard/single_chan_pkt_fwd
    Supports ABP activation, single frequency and single spreading factor. Configuration via separate configuration file (configuration changes do not require recompilation but require the software to be re-started). (Written in C++.)

For ESP8266

  • https://github.com/things4u/ESP-1ch-Gateway-v5.0
    Supports ABP and OTAA activation, downstream messages(?), single frequency with multiple spreading factors, Web interface, WifiManager, OTA, I2C OLED display and ‘use gateway as a node’. Configuration is (partially) hard-coded (some configuration changes require recompilation while others can be changed via web interface, if enabled). (Written in C++.)

  • https://github.com/JaapBraam/LoRaWanGateway
    Supports ABP and OTAA activation, downstream messages and single frequency with multiple spreading factors. Configuration via separate file (but file also contains code). (Written in Lua.)

For ESP32

  • https://github.com/kersing/ESP-1ch-Gateway-v5.0
    This fork of ‘things4u ESP-1ch-Gateway-v5.0’ for ESP8266 has added support for ESP32 and (Heltec) Wifi LoRa 32 modules.
    Supports the same features as things4u’s implementation but currently does not support WifiManager and OTA. (Written in C++.)

  • https://github.com/pycom/pycom-libraries/tree/master/examples/lorawan-nano-gateway for the LoPy (ESP32 board running MicroPython interpreter).
    Supports ABP and OTAA activation, downstream messages, single frequency (not clear if multiple spreading factors are supported), configuration via separate configuration file that can be uploaded via USB or FTP. Lacks description / instructions / readme. (Written in MicroPython.)
    .

NOTES:

  • Don’t forget: each implementation requires that you configure the software with your own gateway parameters (and your own LoRa module wiring pin numbers) before compiling and/or running the software.
  • Hallard’s Raspberry Pi version installs flawlessly (but supports the least features).
    The other implementations may require some tweaking.

Single Channel Gateway part 2
Big ESP32 + SX127x topic part 2
Need help compiling the 1 Ch Gateway on a Heltec
Trying to create a node with a Cytron Shield-LoRa-RFM on Arduino Uno
How to connect Utrecht E&A exhibition KISS LoRa to TTN?
Big ESP32 + SX127x topic part 3
WeMos D1 mini RFM95W
Dragino v1.4 GW Message Count Problem
Big ESP32 + SX127x topic part 3
ESP8266 RFM95 Gateway
Can't gateway, that uses rfm95w module and Raspberry, send down message to end-node?
Downlink , send nodes from singlechannel gateway to lmic
Always Getaway stay "Not connected"
How put my gateway in console gateway TNN
Arduino LMIC: cannot receive downlink messages
TTN enabled SCGW possible with E45-TTL-100?
Big ESP32 + SX127x topic part 2
Temporary expansion of an area using SCGs, Yes or No?
Big ESP32 + SX127x topic part 2
(Somsak) #4

This is mine with Pi0w.


(Somsak) #5

ESP32(WeMos D1 Mini) + RFM95w + Oled



(Clarisse) #6

I have the Heltec and can’t get it to compile. Everything from wpa.h seems to be broken or missing.


(Clarisse) #7

I have the Heltec Lora Oled board and can not seem to get the 1 channel gateway compiled for the life of me. It seems like anything to do with dependencies in wpa.h are failing. I have installed the tool chain from both Espressif and Heltec and both seem to be missing things like c_types.h and the rest of the includes. So looking though the various distributions I found some of the files in the esp idf github and finally got to the point where the compiler was starting to wine about various redefinitions and undefined enums.

I am presuming I have my libraries installed wrong. I can load things like the display test and other things just fine but the gateway stuff seems to continue to evade me. I don’t happen to have an esp8266 with a lora module or I would use that. Any help would be greatly appreciated.

I am using the Arduino 1.8 ide.


(Verkehrsrot) #8

Better use PlatformIO on Visual Studio Code as IDE. It managed libraries much better than the Arduino IDE. I had no problems to compile the single channel gateway an run it on the Heltec.


(Clarisse) #9

Thank you I have it installed I will try tomorrow to compile.


(Clarisse) #10

In file included from E:\Users\ehren.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:188:0,
from e:\users\ehren\appdata\local\temp\tmpcsm4zv:1:
E:\Users\ehren.platformio\packages\framework-arduinoespressif32\variants\heltec_wifi_lora_32/pins_arduino.h:28:22: note: ‘const uint8_t SCK’ previously defined here
static const uint8_t SCK = 5;
^
In file included from d:\arduino\wpa.h:20:0,
from src\ESP-sc-gway.h:250,
from E:/Users/ehren/Documents/PlatformIO/Projects/180122-084201-heltec_wifi_lora_32/src/ESP-sc-gway.ino:30:
e:\Users\ehren\Documents\GitHub\arduino-esp32\Arduino\variants\generic\common.h:52:22: error: redefinition of 'const uint8_t A0’
static const uint8_t A0 = PIN_A0;
^
In file included from E:\Users\ehren.platformio\packages\framework-arduinoespressif32\cores\esp32/Arduino.h:188:0,
from e:\users\ehren\appdata\local\temp\tmpcsm4zv:1:
E:\Users\ehren.platformio\packages\framework-arduinoespressif32\variants\heltec_wifi_lora_32/pins_arduino.h:30:22: note: ‘const uint8_t A0’ previously defined here
static const uint8_t A0 = 36;
^
In file included from d:\arduino\wpa.h:23:0,
from src\ESP-sc-gway.h:250,
from E:/Users/ehren/Documents/PlatformIO/Projects/180122-084201-heltec_wifi_lora_32/src/ESP-sc-gway.ino:30:
d:\arduino\wpa_common.h:180:3: error: conflicting declaration ‘wpa_ptk STRUCT_PACKED’
} STRUCT_PACKED;
^
d:\arduino\wpa_common.h:163:3: note: previous declaration as ‘wpa_eapol_key STRUCT_PACKED’
} STRUCT_PACKED;
^
d:\arduino\wpa_common.h:209:3: error: conflicting declaration ‘wpa_ie_hdr STRUCT_PACKED’
} STRUCT_PACKED;
} STRUCT_PACKED;
^
d:\arduino\wpa_common.h:163:3: note: previous declaration as ‘wpa_eapol_key STRUCT_PACKED’
} STRUCT_PACKED;
^
d:\arduino\wpa_common.h:240:3: error: conflicting declaration ‘rsn_ie_hdr STRUCT_PACKED’
} STRUCT_PACKED;
^
d:\arduino\wpa_common.h:163:3: note: previous declaration as ‘wpa_eapol_key STRUCT_PACKED’
} STRUCT_PACKED;
^
d:\arduino\wpa_common.h:260:2: error: ‘be16’ does not name a type
be16 mui;
^
d:\arduino\wpa_common.h:261:2: error: ‘be16’ does not name a type
be16 error_type;
^
d:\arduino\wpa_common.h:262:3: error: conflicting declaration ‘rsn_error_kde STRUCT_PACKED’
} STRUCT_PACKED;
^
d:\arduino\wpa_common.h:163:3: note: previous declaration as ‘wpa_eapol_key STRUCT_PACKED’
} STRUCT_PACKED;
^
In file included from src\ESP-sc-gway.h:250:0,
from E:/Users/ehren/Documents/PlatformIO/Projects/180122-084201-heltec_wifi_lora_32/src/ESP-sc-gway.ino:30:
d:\arduino\wpa.h:40:13: error: ‘ETH_ALEN’ was not declared in this scope
u8 addr[ETH_ALEN];
^
d:\arduino\wpa.h:85:17: error: ‘ETH_ALEN’ was not declared in this scope
u8 own_addr[ETH_ALEN];
^
d:\arduino\wpa.h:87:14: error: ‘ETH_ALEN’ was not declared in this scope
u8 bssid[ETH_ALEN];
^
d:\arduino\wpa.h:107:33: error: use of enum ‘wpa_alg’ without previous declaration
void (*install_ppkey) (enum wpa_alg alg, uint8 *addr, int key_idx, int set_tx,
^
d:\arduino\wpa.h:116:15: error: ‘ETH_ALEN’ was not declared in this scope
u8 h_dest[ETH_ALEN];
^
d:\arduino\wpa.h:117:17: error: ‘ETH_ALEN’ was not declared in this scope
u8 h_source[ETH_ALEN];
^
d:\arduino\wpa.h:118:5: error: ‘be16’ does not name a type
be16 h_proto;
^
d:\arduino\wpa.h:119:3: error: conflicting declaration ‘l2_ethhdr STRUCT_PACKED’
} STRUCT_PACKED;
^
In file included from d:\arduino\wpa.h:23:0,
from src\ESP-sc-gway.h:250,
from E:/Users/ehren/Documents/PlatformIO/Projects/180122-084201-heltec_wifi_lora_32/src/ESP-sc-gway.ino:30:
d:\arduino\wpa_common.h:163:3: note: previous declaration as ‘wpa_eapol_key STRUCT_PACKED’
}} STRUCT_PACKED;
^
In file included from src\ESP-sc-gway.h:250:0,
from E:/Users/ehren/Documents/PlatformIO/Projects/180122-084201-heltec_wifi_lora_32/src/ESP-sc-gway.ino:30:
d:\arduino\wpa.h:190:28: error: use of enum ‘wpa_states’ without previous declaration
void wpa_sm_set_state(enum wpa_states state);
^
Compiling .pioenvs\heltec_wifi_lora_32\FrameworkArduino\esp32-hal-misc.o
Compiling .pioenvs\heltec_wifi_lora_32\FrameworkArduino\esp32-hal-sigmadelta.o
Compiling .pioenvs\heltec_wifi_lora_32\FrameworkArduino\esp32-hal-spi.o
Compiling .pioenvs\heltec_wifi_lora_32\FrameworkArduino\esp32-hal-time.o
E:/Users/ehren/Documents/PlatformIO/Projects/180122-084201-heltec_wifi_lora_32/src/ESP-sc-gway.ino: In function ‘int WlanConnect(int)’:
E:/Users/ehren/Documents/PlatformIO/Projects/180122-084201-heltec_wifi_lora_32/src/ESP-sc-gway.ino:522:37: error: ‘wpa’ was not declared in this scope
for (int j=wpa_index; j< (sizeof(wpa)/sizeof(wpa[0])) ; j++) {
^
Compiling .pioenvs\heltec_wifi_lora_32\FrameworkArduino\esp32-hal-timer.o
*** [.pioenvs\heltec_wifi_lora_32\src\ESP-sc-gway.ino.o] Error 1
Compiling .pioenvs\heltec_wifi_lora_32\FrameworkArduino\esp32-hal-touch.o


#11

It is not very useful to dump a long list of output this way and without any accompanying questions or remarks.

The more specific (and better prepared) your questions are the better others can help (and are willing) to try answer them.


(Clarisse) #12

I think I have found that all of the problems that I had involved how the libraries were installed. What I posted were mainly examples where the compiler was telling me that either things were being redefined or where never defined.

I am new to this development environment and was and am somewhat confused about setup of vs code, platform io and the 1 ch gateway source tree.The directions for the source tree are easy to understand but the rest was not intuitive for me.


(Somsak) #13

Did you success to compile?


(Clarisse) #14

No, actually, it seems to have a ton of problems. I get a lot of message from the compiler suggesting that things are being redefined. I am not sure I have the right libraries or may have duplicates. I clearly am missing something.


(Ryan Walmsley) #15

Hi,

While I have setup a multi channel gateway where I live as the range doesn’t still quite reach where I wanted. While I’m looking at improving it I still doubt it’d reach the few locations I want it to.

There has been some discussion about Single Channel Gateways and weather they should be used for the fact that then nodes programmed for use by them are fixed to the same frequency, And while the multi channel gateways have come down a lot you can build a SCG for around £10 for a ESP8266, RFM95 & PCB.

I was wondering if say I was able to get a few setup, what the procedure is seeing that they aren’t supported by Lora Wan. Should we register them in TTN Console etc?


#16

If you want to use it with TTN then yes, you will have to add it as a gateway to the console.


(Ryan Walmsley) #17

Just finished assembling this, A PCB that houses both the ESP8266 and RFM95 module on one PCB. Awaiting USB Connectors.

Designed to be a slightly more compact solution to plug into a USB Power socket on a phone charger.

Just need to figure out the software fully on it and do a few tests.

EDIT: All fully working using the V5 ESP Firmware. Should be ideal for a few development cases. I might have some spare boards and kits up for sale soon.


(Ryan Walmsley) #18

Update, Working great! Still awaiting the USB connectors.

SF auto switching seems to work perfectly fine. I’ll get the Eagle BRD File up on github Monday if anyone wants to get their own made. Around £10 for 3 PCBs from either OSH Park or Aisler Total build cost per unit around £10. (£3 PCB, £4 Hope RF, £1.50 ESP, £1.50 Misc)


(Fblanc92) #19

Hello people. I’ve implemented the single channel gateway with a SX1276 (specifically Dragino Lora Bee).
Right now the Raspberry shows the following receptions (attached). In the capture I receive a packet with a working node that contains the word “PONG” but I’m not seeing exactly that. Another thing is the node is sending this packet every 3 seconds but the gateway receives every 15 minutes or more.

I don’t really know if this is the correct functioning.

Please sorry my not-experience about all this but I’d really appreciate your help.


(Ryan Walmsley) #20

@fblanc92 , Single channel gateways are not “proper” gateways, most SCGs run on “Channel 0” or 868.1Mhz. A LoRa Wan compliant gateway can listen on 3 channels with most listening on all 8 for full compatibility.

At the same time nodes can transmit on any of the 8 channels, of which your gateway can only receive on the one channel.

As of this if your node is deciding to transmit on other frequencies more often then your gateway won’t be recieving them.

As of now there’s currently no way I know that allows a single channel gateway to listen on all 8 channels. However for development only you can force your node to transmit on only 868.1 Mhz. It’s only recommended that you do this while developing / don’t have coverage with a full gateway.

How to do this will depend on what you’re using as your node.


(Fblanc92) #21

Ryanteck thank you so much for your clear explanation.
The SCG implementation is only for demonstration of a simple protocol implementation.

I’m transmitting at 868MHz actually because is the allowed frequency by the fabricant library (Semtech), with a 500Khz bandwidth, using SF7 and coding rate 4/5.

I’m trying to find the way to transmit at least a char sequence because the coded result is not usefull at all for me (I did it with two end devices, and I want one of them to become a gateway with a RPI).

For what you said to me the key is on the end device, so I’ll keep working on that.

Thank you, again.


(Arjan) #22

If you’re sending text (don’t) then your packet should be about 17 bytes: 13 bytes LoRaWAN overhead, plus 4 characters. What you’re showing are a whopping 126 and 40 bytes. So chances are those are not your node’s packets.

(Too bad you posted a screenshot of the terminal output, which does not allow us to copy the payload for further investigation/help. Please post text next time.)