LoraWan gateway part 2:1CH gateway V6 with helteclora32 platformIO
https://github.com/things4u/ESP-1ch-Gateway is a very updated library, this is one of those TTN 1ch forwarders, the most updated as today(2020/09/22). The writer is making the V6 on PlatformIO.
One good thing is that in platformIO the project files will include all the libraries in the project. So that you don't need to take care of the dependency of libs. I used to use arduino, when making larger projects, you will use a lot of libs, it's not a big problem when you start the project and make it work. But as time gose by, libs would be updated or renewed and get yourself into troubles of compatibility between libraries. and it's not done yet, some times when arduino board profiles make large change, some libs can fail...especially on newer boards, such esp32/8266...
With PlatformIO, we get ride of the compatibility problem, since you include the need libs with correct version into the project, I'm not sure if the board definitions of platfromIO have impact on libs, but at least you can already get ride of the libs problem.
with sthing4u V6 on platform IO, the first board I try is
heltec lora32 433Mhz version I purchase few years ago.
I tried following board setting and pin out(used and defined in loraModem.h) in the ini file:
heltec_wifi_lora_32_V2 with pin_out=5, board keep on reseting
heltec_wifi_lora_32_V2 with pin_out=4, board keep on reseting
heltec_wifi_lora_32 with pin_out=4, works...
terminal output
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun 8 2016 00:22:57
rst:0x10 (RTCWDT_RTC_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6364
entry 0x400806b8
E (1381) SPIFFS: mount failed, -10025
[E][SPIFFS.cpp:72] begin(): Mounting SPIFFS failed! Error: -1
SPIFFS.begin: not found, formatting
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
ets Jun 8 2016 00:22:57
rst:0x10 (RTCWDT_RTC_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6364
entry 0x400806b8
SPIFFS begin
Do Asserts
readConfig ERR:: file=/gwayConfig.txt does not exist ..
readConfig:: Error reading config file
setup:: readGwayCfg: ERROR readGwayCfg Failed
MAC: 24:0a:c4:83:2f:58, len=17
0:0:2. WlanConnect SSID=H&M
WlanStatus:: CONNECTED ssid=H&M
Host=esp32-832f58 WiFi Connected to H&M on IP=192.168.0.25
Local UDP port=1700
UDP Connection successful
Gateway ID: 240ac4ffffffff456, Listening at SF7 on 433.18 MHz.
resolveHost:: OK=nl.pool.ntp.org IP=5.79.75.37
Time set=Wed 23-09-2020 10:24:05
resolveHost:: OK=router.eu.thethings.network IP=52.169.76.203
setupOta:: Started
Ready IP address: 192.168.0.25
WARNING:: readSeen, history file not exists /gwaySeen.txt
WWW Server started on port 80
WARNING:: writeSeen, file not exists=/gwaySeen.txt
OLED_ADDR=0x3C
--- Setup() ended, Starting loop() ---
v readUdp:: NTP msg rcvd
[E][WebServer.cpp:617] _handleRequest(): request handler not found
register to TTN with the gateway ID shown form the debug message...
TTGO board
Build for other frquency plan
Then go to loraModem.h and add your frequency plan. The frequency table has to match to gateway config frequency plan. https://github.com/TheThingsNetwork/gateway-conf
below is my setup for AS2 and AS1.
the colons are seperated into 2 part, the fist part is the uplink ones, 2nd part is the down link ones. each set has description on frequency, bandwidth, spread factor(start of SF, and end of SF range).
for example, for AS1, the first roll reads:
{ 923200000, 125, 7, 12, 923200000, 125, 7, 12},
means 923.2Mhz is used for uplink with BW=125, spread factor 7 to 12
same config as down link.
Note that in TTN frequency plan there is a FSK channel, I did not list it.
With my TTGO , it works fine.
but the OLED display is inverted on my TTGO, so I went to oLED.ino comment out few flips and it works fine.
I have a Pi gateway runs on AS1 plan, and this TTGO 1CH gateway runs on AS2.
I currently has a AS1 plan device running on OTAA, from time to time, the AS2 TTGO gets data as well, since there are few frequencies in common.
留言
張貼留言