Skip to content

Commit

Permalink
Working with test setup
Browse files Browse the repository at this point in the history
  • Loading branch information
tobalr committed Feb 9, 2019
1 parent cbcd47c commit 8a9bcd1
Show file tree
Hide file tree
Showing 17 changed files with 78 additions and 56 deletions.
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

# Created by https://www.gitignore.io/api/platformio,visualstudiocode
# Edit at https://www.gitignore.io/?templates=platformio,visualstudiocode

### PlatformIO ###
.pioenvs
.piolibdeps
.clang_complete
.gcc-flags.json

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

### VisualStudioCode Patch ###
# Ignore all local history of files
.history

# End of https://www.gitignore.io/api/platformio,visualstudiocode
6 changes: 6 additions & 0 deletions ESP-Now_GW/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.pio
.pioenvs
.piolibdeps
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
7 changes: 7 additions & 0 deletions ESP-Now_GW/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
]
}
6 changes: 6 additions & 0 deletions ESP-Now_GW/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"terminal.integrated.env.linux": {
"PATH": "/home/tobalr/.platformio/penv/bin:/home/tobalr/.platformio/penv:/home/tobalr/bin:/home/tobalr/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/tobalr/Android/Sdk/platform-tools:/home/tobalr/Android/Sdk/tools:/home/tobalr/Android/Sdk/ndk-bundle",
"PLATFORMIO_CALLER": "vscode"
}
}
6 changes: 5 additions & 1 deletion ESP-Now_GW/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ platform = espressif8266
;; platform = https://github.com/platformio/platform-espressif8266.git#feature/stage
board = nodemcuv2
framework = arduino
build_flags = -lespnow
monitor_speed = 115200
upload_speed = 921600
lib_deps =
[email protected]

3 changes: 2 additions & 1 deletion ESP-Now_GW/src/espnow_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ uint8_t wifi_mac[] = { 0x02, 0x60, 0x0D, 0xF0, 0x0D, 0x02 };
* YOU MUST ADD your node MAC addresses here (up to 20 of
* them), to have ESP-Now function reliably.
*/
uint8_t cont01_mac[] = { 0x18, 0xFE, 0x34, 0xD4, 0x2E, 0x51 }; // Yellow Dev test node.

uint8_t cont01_mac[] = { 0x5C, 0xCF, 0x7F, 0xAC, 0x72, 0x88 }; // test.
uint8_t cont02_mac[] = { 0x02, 0xFE, 0xED, 0xBE, 0xEF, 0x04 }; // Change me!
uint8_t cont03_mac[] = { 0x02, 0xFE, 0xED, 0xBE, 0xEF, 0x05 }; // Change me!
uint8_t cont04_mac[] = { 0x02, 0xFE, 0xED, 0xBE, 0xEF, 0x06 }; // Change me!
Expand Down
10 changes: 5 additions & 5 deletions ESP-Now_GW/src/espnow_gw.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ uint8_t eth_MAC[] = { 0x02, 0xF0, 0x0D, 0xBE, 0xEF, 0x01 };
* on your LAN. These values must match YOUR SPECIFIC LAN. The "eth_IP"
* is the IP address for this gateway's ETHERNET port.
*/
IPAddress eth_IP(192, 168, 1, 11); // CHANGE THIS to something relevant for YOUR LAN.
IPAddress eth_MASK(255, 255, 255, 0); // Subnet mask.
IPAddress eth_DNS(192, 168, 1, 1); // DNS server.
IPAddress eth_GW(192, 168, 1, 1); // Gateway (router).
IPAddress mq_server(192, 168, 1, 100); // CHANGE THIS to point at YOUR MQTT broker.
IPAddress eth_IP(192, 168, 1, 68); // CHANGE THIS to something relevant for YOUR LAN.
IPAddress eth_MASK(255, 255, 255, 0); // Subnet mask.
IPAddress eth_DNS(192, 168, 1, 33); // DNS server.
IPAddress eth_GW(192, 168, 1, 1); // Gateway (router).
IPAddress mq_server(192, 168, 1, 34); // CHANGE THIS to point at YOUR MQTT broker.

EthernetClient ethClient; // ETHERNET - The gateway wire to the local network.
PubSubClient client(ethClient); // ETHERNET - The MQTT process is attached to the wire, -not- WiFi.
Expand Down
2 changes: 1 addition & 1 deletion ESP-Now_GW/src/espnow_gw.ino
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ void reconnect() {
while (!client.connected()) {
Serial.print("Attempting MQTT connection...");
// Attempt to connect
if (client.connect("arduinoClient")) {
if (client.connect("espNowGw","test","123456")) {
Serial.println("connected");
// Once connected, publish an announcement...
client.publish("outTopic", "Hello world!");
Expand Down
6 changes: 6 additions & 0 deletions ESP-Now_Node-airquality/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.pio
.pioenvs
.piolibdeps
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
7 changes: 7 additions & 0 deletions ESP-Now_Node-airquality/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
]
}
6 changes: 6 additions & 0 deletions ESP-Now_Node-airquality/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"terminal.integrated.env.linux": {
"PATH": "/home/tobalr/.platformio/penv/bin:/home/tobalr/.platformio/penv:/home/tobalr/bin:/home/tobalr/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/tobalr/Android/Sdk/platform-tools:/home/tobalr/Android/Sdk/tools:/home/tobalr/Android/Sdk/ndk-bundle",
"PLATFORMIO_CALLER": "vscode"
}
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ platform = espressif8266
;;platform = https://github.com/platformio/platform-espressif8266.git#feature/stage
board = esp12e
framework = arduino
build_flags = -lespnow
monitor_speed = 115200
upload_speed = 921600
lib_deps =
[email protected]
1 change: 1 addition & 0 deletions ESP-Now_Node-airquality/src/espnow_common.h
File renamed without changes.
47 changes: 0 additions & 47 deletions ESP-Now_Node/src/espnow_common.h

This file was deleted.

0 comments on commit 8a9bcd1

Please sign in to comment.