42 |
43 |
44 | Dependencies
45 | ------------
46 |
47 | - [gBase64][7] library by Adam Rudd is now integrated in the project, no need to install
48 | - [Time][5] library Arduino [documentation][6]
49 | - [NeoPixelBus][4] library is you're using [WeMos Lora][3] Shield as gateway
50 |
51 | Connections
52 | -----------
53 | See [things4u][8] in the [hardware][9] section for building and connection instructions
54 | See [WeMos-Lora][3] github if you're using WeMos Lora Shield as gateway
55 |
56 |
57 | Configuration
58 | -------------
59 |
60 | Defaults:
61 |
62 | - LoRa: SF7 at 868.1 Mhz
63 | - Server: 54.229.214.112, port 1700 (The Things Network: croft.thethings.girovito.nl)
64 | or directly croft.thethings.girovito.nl
65 |
66 | Edit .h file (ESP-sc-gway.h) to change configuration (look for: "Configure these values!").
67 |
68 | Please set location, email and description.
69 |
70 | License
71 | -------
72 | The source files in this repository are made available under the Eclipse
73 | Public License v1.0, except for the base64 implementation, that has been
74 | copied from the Semtech Packet Forwader.
75 |
76 |
77 | [2]: https://hallard.me
78 | [3]: https://github.com/hallard/WeMos-Lora
79 | [4]: https://github.com/Makuna/NeoPixelBus
80 | [5]: https://github.com/PaulStoffregen/Time
81 | [6]: http://playground.arduino.cc/code/time
82 | [7]: https://github.com/adamvr/arduino-base64
83 | [8]: http://things4u.github.io
84 | [9]: http://things4u.github.io/HardwareGuide/hardware_guide.html
85 |
--------------------------------------------------------------------------------
/ESP-sc-gway/README.md:
--------------------------------------------------------------------------------
1 | Single Channel LoRaWAN Gateway
2 | ==============================
3 | This repository contains a proof-of-concept implementation of a single
4 | channel LoRaWAN gateway. It has been tested on the Wemos D1 Mini, using a
5 | Semtech SX1276 transceiver (HopeRF RFM95W).
6 |
7 | The code is for testing and development purposes only, and is not meant
8 | for production usage.
9 |
10 | Engine is based on code base of Single Channel gateway for RaspberryPI
11 | which is developed by Thomas Telkamp. Code was ported and extended to run
12 | on ESP 8266 mcu and provide RTC, Webserver and DNS services.
13 |
14 | Maintained by Maarten Westenberg (mw12554@hotmail.com)
15 |
16 | Features
17 | --------
18 | - listen on configurable frequency and spreading factor
19 | - SF7 to SF12
20 | - status updates
21 | - can forward to two servers
22 | - DNS support for server lookup
23 | - NTP Support for time sync with internet time servers
24 | - Webserver support (default port 8080)
25 | - OTA Updates
26 | - Access Point Mode (for OTA)
27 |
28 | Not (yet) supported:
29 | - PACKET_PUSH_ACK processing
30 | - SF7BW250 modulation
31 | - FSK modulation
32 | - downstream messages (tx)
33 |
34 | Added features if you're using [WeMos-Lora][3] Shield as gateway
35 | - 2 On board RGB LED for visual
36 | - 1 SSD1306 I2C OLED connector
37 | - 1 On board push button
38 |
39 | Assembled WeMos-Lora Shield
40 |
41 |
42 |
43 |
44 |
45 | Dependencies
46 | ------------
47 |
48 | - [gBase64][7] library by Adam Rudd is now integrated in the project, no need to install
49 | - [Time][5] library Arduino [documentation][6]
50 | - [NeoPixelBus][4] library is you're using [WeMos Lora][3] Shield as gateway
51 |
52 | Connections
53 | -----------
54 | See [things4u][8] in the [hardware][9] section for building and connection instructions
55 | See [WeMos-Lora][3] github if you're using WeMos Lora Shield as gateway
56 |
57 |
58 | Configuration
59 | -------------
60 |
61 | Defaults:
62 |
63 | - LoRa: SF7 at 868.1 Mhz
64 | - Server: 54.229.214.112, port 1700 (The Things Network: croft.thethings.girovito.nl)
65 | or directly croft.thethings.girovito.nl
66 |
67 | Edit .h file (ESP-sc-gway.h) to change configuration (look for: "Configure these values!").
68 |
69 | Please set location, email and description.
70 |
71 | License
72 | -------
73 | The source files in this repository are made available under the Eclipse
74 | Public License v1.0, except for the base64 implementation, that has been
75 | copied from the Semtech Packet Forwader.
76 |
77 |
78 | [2]: https://hallard.me
79 | [3]: https://github.com/hallard/WeMos-Lora
80 | [4]: https://github.com/Makuna/NeoPixelBus
81 | [5]: https://github.com/PaulStoffregen/Time
82 | [6]: http://playground.arduino.cc/code/time
83 | [7]: https://github.com/adamvr/arduino-base64
84 | [8]: http://things4u.github.io
85 | [9]: http://things4u.github.io/HardwareGuide/hardware_guide.html
86 |
--------------------------------------------------------------------------------
/ESP-sc-gway/gBase64.cpp:
--------------------------------------------------------------------------------
1 | #include "gBase64.h"
2 | //#include | Parameter | "; 1046 | response += "Value | "; 1047 | response += "
|---|---|
| IP Address | "; response += printIP((IPAddress)WiFi.localIP()); response += " |
| IP Gateway | "; response += printIP((IPAddress)WiFi.gatewayIP()); response += " |
| NTP Server | "; response += NTP_TIMESERVER; response += " |
| LoRa Router | "; response += _TTNSERVER; response += " |
| LoRa Router IP | "; response += printIP((IPAddress)ttnServer); response += " |
| Parameter | "; 1059 | response += "Value | "; 1060 | response += "
|---|---|
| Free heap | "; response += ESP.getFreeHeap(); response += " |
| ESP Chip ID | "; response += ESP.getChipId(); response += " |
| Parameter | "; 1069 | response += "Value | "; 1070 | response += "
|---|---|
| Frequency | "; response += freq; response += " |
| Spreading Factor | "; response += sf; response += " |
| Gateway ID | "; 1074 | response += String(MAC_array[0], HEX); // The MAC array is always returned in lowercase 1075 | response += String(MAC_array[1], HEX); 1076 | response += String(MAC_array[2], HEX); 1077 | response += "ffff"; 1078 | response += String(MAC_array[3], HEX); 1079 | response += String(MAC_array[4], HEX); 1080 | response += String(MAC_array[5], HEX); 1081 | response += " |
| Counter | "; 1089 | response += "Value | "; 1090 | response += "
|---|---|
| Packages Received | "; response += cp_nb_rx_rcv; response += " |
| Packages OK | "; response += cp_nb_rx_ok; response += " |
| Packages Forwarded | "; response += cp_up_pkt_fwd; response += " |
|   |