ESP8266 node and gateway for TTN


#1

Someone has worked with this board and connected to TTN? .thank You.

https://github.com/hallard/NodeMCU-Gateway

or

https://pcbs.io/share/4Q1Z4


#2

yes and have code on my git repo( https://github.com/dlarue ). I helped a few people through the process and one, Stefaan, blogged about it ( http://talk2lora.blogspot.com/ ).

FYI, this is single channel stuff and configured for 915MHz frequencies(USA).


(Mikael Falkvidd) #3

These threads discuss a similar solution:
https://www.thethingsnetwork.org/forum/t/affordable-esp8266-based-gateway-build-instructions/3837/6

https://www.thethingsnetwork.org/forum/t/how-to-use-the-sensor-node-in-maarten-westenbergs-esp8266-gateway/3885


(Nicolas Schteinschraber) #4

One particular software that I've tried is things4u https://github.com/things4u/ESP-1ch-Gateway and v3: https://github.com/things4u/ESP-1ch-Gateway-v3.0 both work fine with TTN with web based stats, though they are single channel.
I know many used it for 868 but I modified v3 to work with 915 and it does work well too.


#5

What changes did you make to use 915MHz band? I changed the following:

freq = 902300000;
_TTNSERVER "router.us.thethings.network"

Did you use the built in (virtual) Node?

What Node hardware and software are you using i.e. RN2903 or RFM9x? What settings changes did you make to use 915MHz band?

I've tried for a week now and can't see Data on my TTN dashboard. I'm even using an MQTT client to try and get data (example from TTN).


#6

I tried v3.0, needed to change the pinouts and the frequency, it appeared to work (I don't have any nodes yet): compare it with Dougs ( https://github.com/dlarue) github, of version 2.0 for the changes to get it to work with 915Mhz, from what I recall it was a small change in one of the radio related files.
V3.0 does not appear to be finished, what worked seemed similar in functionality to v2.0


(Mark) #7

Following this topic, I got rather excited to build a portable gateway for demonstrations. I installed the ESP-1ch-Gateway-v3.0 code on a RFM96 and a WeMos D1 Mini. After changing the default _SPREADING value from SF9 to SF7 to started to work! Well sort of...

I have a node sending a hello world packet every 15 seconds. With my IC880/RPI gateway, all of the packets arrive as expected. With the ESP-1ch-Gateway, only one of every three packets (~1 packet every 62 seconds) are received in the radio and then propagated to TTN. Is this part of the radio protocol or is there a parameter that I need to reconfigure?

Thanks,

Mark

Here is a log of what I am seeing coming from the node log in addition to what is showing up in the TTN log:

Packet RSSI: -42 RSSI: -100 SNR: 9 Length: 26 -> 40 2C E1 26 68 80 0 0 1 95 65 71 3C 61 F6 AA C0 E2 51 5 6B C1 58 C7 EE 77
RXPK:: {"rxpk":[{"tmst":14348748,"chan":0,"rfch":0,"freq":868.099975,"stat":1,"modu":"LORA","datr":"SF7BW125","codr":"4/5","lsnr":9,"rssi":-42,"size":26,"data":"QCzhJmiAAAABlWVxPGH2qsDiUQVrwVjH7nc="}]}
PKT_PUSH_ACK:: size 4 From 52.169.76.203, port 1700, token: CF2D

Packet RSSI: -43 RSSI: -101 SNR: 9 Length: 26 -> 40 2C E1 26 68 80 3 0 1 85 88 DF 1B E7 9F 52 62 A0 6C 74 6C 16 66 85 38 26
RXPK:: {"rxpk":[{"tmst":77743091,"chan":0,"rfch":0,"freq":868.099975,"stat":1,"modu":"LORA","datr":"SF7BW125","codr":"4/5","lsnr":9,"rssi":-43,"size":26,"data":"QCzhJmiAAwABhYjfG+efUmKgbHRsFmaFOCY="}]}
PKT_PUSH_ACK:: size 4 From 52.169.76.203, port 1700, token: A768

Packet RSSI: -44 RSSI: -100 SNR: 9 Length: 26 -> 40 2C E1 26 68 80 6 0 1 29 A2 15 3A 59 EC 89 DE F6 55 C9 D E0 2C 65 86 4D
RXPK:: {"rxpk":[{"tmst":142704342,"chan":0,"rfch":0,"freq":868.099975,"stat":1,"modu":"LORA","datr":"SF7BW125","codr":"4/5","lsnr":9,"rssi":-44,"size":26,"data":"QCzhJmiABgABKaIVOlnsid72VckN4Cxlhk0="}]}
PKT_PUSH_ACK:: size 4 From 52.169.76.203, port 1700, token: 967A

Packet RSSI: -49 RSSI: -100 SNR: 10 Length: 26 -> 40 2C E1 26 68 80 9 0 1 40 53 71 9C 87 BE 6E FA 8B E1 3A CB 87 7 A2 A8 C
RXPK:: {"rxpk":[{"tmst":207418727,"chan":0,"rfch":0,"freq":868.099975,"stat":1,"modu":"LORA","datr":"SF7BW125","codr":"4/5","lsnr":10,"rssi":-49,"size":26,"data":"QCzhJmiACQABQFNxnIe+bvqL4TrLhweiqAw="}]}
PKT_PUSH_ACK:: size 4 From 52.169.76.203, port 1700, token: 2815

payload time frame RSSI frequency
48656C6C6F2C20776F726C6421 00:52:36 18 -39 868.09900
48656C6C6F2C20776F726C6421 00:51:32 15 -43 868.09900
48656C6C6F2C20776F726C6421 00:50:30 12 -42 868.09900
48656C6C6F2C20776F726C6421 00:49:26 9 -44 868.09900
48656C6C6F2C20776F726C6421 00:48:22 6 -41 868.09900
48656C6C6F2C20776F726C6421 00:47:18 3 -41 868.09900
48656C6C6F2C20776F726C6421 00:46:14 0 -42 868.09900


(Hylke Visser) #8

That is because LoRaWAN is a spread-spectrum protocol. According to the specification, all devices must implement three default channels. Single-channel gateways obviously don't do this (and are therefore not LoRaWAN-compatible), so they will inevitably miss messages.

From the LoRaWAN spec:

It is possible to manually disable all but one channel in the device (node). Then your single-channel gateway will receive all messages, but then your device is not spread-spectrum anymore, and will probably have to comply with other regulations (good luck with that).

Conclusion: if you have a IC880/RPI, use it :slight_smile:


#9

IC880 for f=915 Mhz?. Thank you.


#10

Thank you all for the information. I will try to implement a node and a gateway. I'll i nformando.

1) Someone has processed the information collected in databases with nodejs, Python, c ?.

2) Someone has making Private LoRaWAN network ?.

Thank you.


(Somsak) #11

I used ESP-1ch-Gateway-v4.0 and my gateway (WeMOS D1 mini V2) is hang from time to time.
Is it stable with this config?


#12

My Lua gateway doesn't hang :wink: It runs for weeks without problems...

Edit: I've also seen it recover from wifi loss... I don't know exactly how it managed to do that, but I suspect it just restarts on some error and reestablishes the wifi connection then...


(Sandgroper) #13

There is a problem with the ESP gateway code. If the wifi network the ESP8266 associates with drops out, the code does not recover when the access point comes back on-line.


(Somsak) #14

@JBraam
Thank you. Good work for your Lua gateway. As I am a new user for Lua, I have to spend sometimes to learn at
very beginning. Your Lua Gateway will be my first program.
During my dicision period which DIY mutiple gateway hardware I will order, I will try to read more about Lua.

Somsak


(Somsak) #15

@Sandgroper
I have two of ESP gateways run parallely. The other is on ESP-12F WeMos D1 WiFi uno based ESP8266. Both hang from time to time while my RPI have been working well for the past three weeks. Anyway, RPI does not support downlink.


(Arjan) #16

A bit off topic, and maybe my Raspberry Pi single channel gateway is a bit outdated, but it surely stops when WiFi goes down. (Or maybe when the internet connection of the WiFi has a hick up.) I start it using the following, to ensure it restarts whenever that happens:

while true; do date; sudo ./single_chan_pkt_fwd; sleep 2; done;

(The sleep is there to allow me to stop it by hitting Ctrl+C twice; the date provides some logging.)


(Somsak) #17

@arjanvanb

I think my RPI does not need a shell script so far.
It runs more stable by using systemctl. I installed as what the README tell me.
The restart process will be monitored as define in [Service].

[Service]
Type=simple
WorkingDirectory=/home/pi/single_chan_pkt_fwd/
ExecStart=/home/pi/single_chan_pkt_fwd/single_chan_pkt_fwd
Restart=on-failure
RestartSec=5