feature-requests
feature-requests copied to clipboard
WireGuard Support for ESP32
Describe the problem you have/What new integration you would like
Please help me adding support for WireGuard to ESPHome on ESP32 boards. WireGuard is an extremely simple yet fast and modern VP.
There already seems to be an Arduino library in Platformio for the ESP32.
Please describe your use case for this integration and alternatives you've tried:
I need to have a bidirectional, secure channel between multiple ESPHome/ESP32s at multiple locations and some remote backend server. From these backend servers I want to be able to push e.g. OTA updates centrally to many different NATed locations (where a site2site VPN is not an option). Also I'd like to reach all those different locations from one central HomeAssistant instance. On the ESP side, only traffic to a specific remote subnet (the backend) needs be routed through Wireguard, all remaining network traffic should use the default gateway.
AFAIK there are no VPN alternatives available for ESPhome yet.
Additional context
Basically this is all about being able to directly reach (on IP level) multiple ESPHome boards at different locations/networks behind their NAT routers from some central place / VPN server / backend.
I've already tried to add the library by putting this in my ESPHome yaml config:
platformio_options: { lib_deps: "ciniml/WireGuard-ESP32" }
but I got this error:
Processing my_test (board: esp32dev; framework: arduino; platform: platformio/[email protected])
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
PACKAGES:
- framework-arduinoespressif32 3.10006.210326 (1.0.6)
- tool-esptoolpy 1.30000.201119 (3.0.0)
- toolchain-xtensa32 2.50200.97 (5.2.0)
Dependency Graph
|-- <WireGuard-ESP32> 0.1.2
[......]
Compiling .pioenvs/my_test/libc96/WireGuard-ESP32/crypto/cortex/cortex_m0_mpy121666.s.o
xtensa-esp32-elf-as: unrecognized option '-x'
Compiling .pioenvs/my_test/libc96/WireGuard-ESP32/crypto/cortex/cortex_m0_reduce25519.s.o
xtensa-esp32-elf-as: unrecognized option '-x'
Compiling .pioenvs/my_test/libc96/WireGuard-ESP32/crypto/cortex/mul.s.o
xtensa-esp32-elf-as: unrecognized option '-x'
*** [.pioenvs/my_test/libc96/WireGuard-ESP32/crypto/cortex/cortex_m0_mpy121666.s.o] Error 1
*** [.pioenvs/my_test/libc96/WireGuard-ESP32/crypto/cortex/cortex_m0_reduce25519.s.o] Error 1
*** [.pioenvs/my_test/libc96/WireGuard-ESP32/crypto/cortex/mul.s.o] Error 1
Compiling .pioenvs/my_test/libc96/WireGuard-ESP32/crypto/cortex/scalarmult.c.o
================================================ [FAILED] Took 7.92 seconds ================================================
Any help / hint is much appreciated!
@davey Very cool solution. It is potentially will add ability to communicate with ESPHome
from anywhere. Really impressive. I like idea, maybe it is even good alternative over MQTT.
I know one of embedded developer. Will try to consult with him. Also, will try to google problem to help you.
Faced with same issue. I've even created fresh project to test. Same result. It tries to execute xtensa-esp32-elf-as -x assembler-with-cpp -mlongcalls ...
assembler tool chain (in contrast GNU Assembler) to compile *.s
files, but exactly xtensa-esp32-elf-as
has not the options -x
, -mlongcalls
. (if I understand things correctly)
Here my test project and config:
https://github.com/mrkeuz/wg-esp32-test
Just in case, for prepare config (just with ESPHome
is little hard to pass some parameters to pio
config)
What I found and tried, options:
-
Rename
*.s
⇾*.S
sources as recommended somewhere onPlatformIO
forum. But also not works, errors same as logs below. https://community.platformio.org/t/unknown-assembler-option-when-compiling-main-cpp-and-asm/968/6 -
Remove invalid parameters from assembler options from
ASFLAGS
(solution and logs see below). It helps to step forward, but does not help. I got error sheet from ASM compiler. Seems it need somehow configure assembler-compiler. I'm not fluency embedded developer, so don't know how to prepare it properly.- Links:
- Similar problem with
-x
flag https://github.com/platformio/platformio-core/issues/3513 -
-Wa,option
notation, with this option we can remove flags https://gcc.gnu.org/onlinedocs/gcc/Assembler-Options.html - Xtensa
-mlongcalls
option https://gcc.gnu.org/onlinedocs/gcc/Xtensa-Options.html
- Similar problem with
- Links:
-
Also, I asked question to author, maybe he helps: https://github.com/ciniml/WireGuard-ESP32-Arduino/issues/2
Summary: It is necessary to understand, how configure PlatformIO
assembler tool chain for compile right in way.
Hope it helps somehow.
platformio.ini
:
...
; Removes paramaters from ASFLAGS
build_unflags =
-Wa,-x
-Wa,assembler-with-cpp
-Wa,-mlongcalls
...
Error from assembler after remove unsupported flags:
...
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_mpy121666.S:14: Error: unknown pseudo-op: `.cpu'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_mpy121666.S:15: Error: unknown pseudo-op: `.fpu'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_mpy121666.S:16: Error: unknown pseudo-op: `.eabi_attribute'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_mpy121666.S:17: Error: unknown pseudo-op: `.eabi_attribute'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_mpy121666.S:18: Error: unknown pseudo-op: `.eabi_attribute'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_mpy121666.S:19: Error: unknown pseudo-op: `.eabi_attribute'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_mpy121666.S:20: Error: unknown pseudo-op: `.eabi_attribute'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_mpy121666.S:21: Error: unknown pseudo-op: `.eabi_attribute'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_mpy121666.S:22: Error: unknown pseudo-op: `.eabi_attribute'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_mpy121666.S:23: Error: unknown pseudo-op: `.eabi_attribute'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_mpy121666.S:24: Error: unknown pseudo-op: `.eabi_attribute'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_mpy121666.S:25: Error: unknown pseudo-op: `.code'
cortex_m0_reduce25519.S:33: Error: unknown pseudo-op: `.code'
cortex_m0_reduce25519.S:34: Error: unknown pseudo-op: `.thumb_func'
cortex_m0_reduce25519.S:38: Error: unknown opcode or format name 'push'
cortex_m0_reduce25519.S:39: Error: unknown opcode or format name 'ldr'
cortex_m0_reduce25519.S:40: Error: extra comma
cortex_m0_reduce25519.S:40: Error: syntax error
cortex_m0_reduce25519.S:41: Error: extra comma
cortex_m0_reduce25519.S:41: Error: syntax error
cortex_m0_reduce25519.S:42: Error: extra comma
cortex_m0_reduce25519.S:42: Error: syntax error
cortex_m0_reduce25519.S:43: Error: extra comma
cortex_m0_reduce25519.S:43: Error: syntax error
cortex_m0_reduce25519.S:44: Error: unknown opcode or format name 'uxth'
cortex_m0_reduce25519.S:45: Error: unknown opcode or format name 'mul'
cortex_m0_reduce25519.S:46: Error: unknown opcode or format name 'mul'
cortex_m0_reduce25519.S:47: Error: bad register name: r5
cortex_m0_reduce25519.S:47: Error: junk at end of line, first unrecognized character is `r'
cortex_m0_reduce25519.S:47: Internal error!
Assertion failure in ignore_rest_of_line at /builds/idf/crosstool-NG/.build/src/binutils-2.25.1/gas/read.c line 3694.
Please report this bug.
*** [.pio/build/esp-wrover-kit/libca3/WireGuard-ESP32/crypto/cortex/cortex_m0_mpy121666.S.o] Error 1
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_reduce25519.S: Assembler messages:
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_reduce25519.S:11: Error: unknown pseudo-op: `.cpu'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_reduce25519.S:12: Error: unknown pseudo-op: `.fpu'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_reduce25519.S:13: Error: unknown pseudo-op: `.eabi_attribute'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_reduce25519.S:14: Error: unknown pseudo-op: `.eabi_attribute'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_reduce25519.S:15: Error: unknown pseudo-op: `.eabi_attribute'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_reduce25519.S:16: Error: unknown pseudo-op: `.eabi_attribute'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_reduce25519.S:17: Error: unknown pseudo-op: `.eabi_attribute'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_reduce25519.S:18: Error: unknown pseudo-op: `.eabi_attribute'
-ardui.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_reduce25519.S:19: Error: unknown pseudo-op: `.eabi_attribute'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_reduce25519.S:20: Error: unknown pseudo-op: `.eabi_attribute'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_reduce25519.S:21: Error: unknown pseudo-op: `.eabi_attribute'
.pio/libdeps/esp-wrover-kit/WireGuard-ESP32/src/crypto/cortex/cortex_m0_reduce25519.S:22: Error: unknown pseudo-op: `.code'
ncortex_m0_reduce25519.S:30: Error: unknown pseudo-op: `.code'
oespressif32/tools/sdk/include/coap -I/cortex_m0_reduce25519.S:31: Error: unknown pseudo-op: `.thumb_func'
home/petr/.platformio/cortex_m0_reduce25519.S:35: Error: unknown opcode or format name 'push'
cortex_m0_reduce25519.S:36: Error: extra comma
cortex_m0_reduce25519.S:36: Error: syntax error
cortex_m0_reduce25519.S:37: Error: extra comma
cortex_m0_reduce25519.S:37: Error: syntax error
cortex_m0_reduce25519.S:38: Error: unknown opcode or format name 'uxth'
cortex_m0_reduce25519.S:39: Error: extra comma
cortex_m0_reduce25519.S:39: Error: syntax error
cortex_m0_reduce25519.S:40: Error: unknown opcode or format name 'mul'
cortex_m0_reduce25519.S:41: Error: unknown opcode or format name 'mul'
cortex_m0_reduce25519.S:42: Error: extra comma
cortex_m0_reduce25519.S:42: Error: syntax error
cortex_m0_reduce25519.S:43: Error: extra comma
cortex_m0_reduce25519.S:43: Error: syntax error
cortex_m0_reduce25519.S:44: Error: extra comma
cortex_m0_reduce25519.S:44: Error: syntax error
cortex_m0_reduce25519.S:45: Error: extra comma
cortex_m0_reduce25519.S:45: Error: syntax error
cortex_m0_reduce25519.S:46: Error: bad register name: r4
cortex_m0_reduce25519.S:46: Error: junk at end of line, first unrecognized character is `r'
cortex_m0_reduce25519.S:46: Internal error!
Assertion failure in ignore_rest_of_line at /builds/idf/crosstool-NG/.build/src/binutils-2.25.1/gas/read.c line 3694.
Please report this bug.
...
Solved. By exclude files in src/crypto/cortex
from build.
In the end reveals that src/crypto/cortex
is some platform-specific implementation of cryptography and even not used (call of asm implementation crypto_scalarmult_curve25519
is commented):
- https://github.com/ciniml/WireGuard-ESP32-Arduino/blob/ce65891c207141f9c75dd318a6faa53c6c20444e/src/crypto.h#L20-L21
So it can safety exclude from build. One thing, I don't find easy way to exclude some lib files from build via platformio.ini
flags, it can achieve little tricky via python script (extra_scipts = ...
flag). But I decided just fork project and fix library.
So you can use lib_deps
like
lib_deps = https://github.com/mrkeuz/WireGuard-ESP32-Arduino#a788ab8
Or fork you own repo (just delete src/crypto/cortex
folder). It compiles successfully. But I don't tested exactly wg
in on real hardware.
Hi, will it be added to esphome code? I want to connect esphome sensors from external network to home assistant api. Thanks
EDIT: I added libs_deps: lib_deps = https://github.com/mrkeuz/WireGuard-ESP32-Arduino#a788ab8
to platformio.ini of my esp32 project and it got compiled with some warnings. https://pastebin.com/fPbddrfq
If I flash it how and what commands can I configure it on project yaml? Thanks
I finally got a basic example setup working and would like to share that. 🚀
Thanks a lot for all those who contributed to this - this is great!
This is the content of my ESPhome config yaml (wireguard-test.yaml
):
esphome:
name: "wireguard-test"
platform: esp32
board: esp32dev
arduino_version: latest
platformio_options:
lib_deps: "ciniml/WireGuard-ESP32"
libraries: "WireGuard-ESP32"
includes:
- wireguard-test.wg.h
wifi:
networks:
- { ssid: "wifi-ssid-1", password: "xxxxxxxxxxxx" }
- { ssid: "wifi-ssid-2", password: "yyyyyyyyyyyyy" }
ap: { ssid: "wgtest-SETUP", password: "secretsetup" }
ota:
logger: { level: DEBUG, baud_rate: 115200}
web_server: { port: 80 }
time:
- { platform: sntp, id: "sntp_time", timezone: "Europe/Berlin" }
custom_component:
- lambda: |-
auto wireguard_component = new WireguardComponent();
return {wireguard_component};
This is the content of my Wireguard config (wireguard-test.wg.h
), which is mentioned in the file above:
#include "esphome.h"
#include "WireGuard-ESP32.h"
static WireGuard wg;
class WireguardComponent : public Component {
public:
// make sure we are starting LATE, after WIFI is initialized
float get_setup_priority() const override { return esphome::setup_priority::LATE; }
void setup() override {
ESP_LOGD("custom", "wireguard setup: start ...");
char private_key[] = "XXXXXXXXXXXXXXX="; // private key of the client (ESP)
char public_key[] = "YYYYYYYYYYYYYYYY="; // public key of the server (remote linux VPN server)
IPAddress local_ip(192,168,99,123); // VPN IP for this VPN client
char endpoint_address[] = "vpn.example.com"; // VPN/Wireguard server hostname
int endpoint_port = 51820; // VPN/Wireguard server port
ESP_LOGD("custom", "wireguard setup: delay(5000) ...");
delay( 5000 );
ESP_LOGD("custom", "wireguard setup: begin ...");
wg.begin(
local_ip,
private_key,
endpoint_address,
public_key,
endpoint_port
);
ESP_LOGD("custom", "wireguard setup: end ...");
}
void loop() override {
delay( 1000 );
ESP_LOGD("custom", "wireguard loop ...");
}
};
This is all that is needed on the ESP / EPShome side.
For completeness of this example, this is the essential part on the VPN/Wireguard server side (/etc/wireguard/wg0.conf
on an Ubuntu server):
[Interface]
Address = 192.168.99.1/32
PrivateKey = PPPPPPPPPPPPPPPPPPP
ListenPort = 51820
## wireguard-test
[Peer]
PublicKey = VVVVVVVVVVVVVVVVVV
AllowedIPs = 192.168.99.123/32
I am sure there a a lot things that still need to be improved, e.g. properly waiting for the Wifi being established, making sure we reconnect in case the connection is lost and so on - I just wanted to share the earliest success to everyone waiting for it :-)
Next steps in my opinion would be to make the config more dynamic, e.g. being able to change the settings (server host, port, public and private keys and so on) or even generate a private key on the ESP itself, only showing/providing it's publickey part somewhere...
Thanks for the great work! You can also make it run upon time sync, which simplifies things:
wireguard-test.yaml
esphome:
name: wireguard-test
platform: ESP32
board: esp32dev
libraries: ciniml/WireGuard-ESP32
includes: wg-settings.h
wifi:
networks:
- { ssid: "wifi-ssid-1", password: "xxxxxxxxxxxx" }
ap: { ssid: "wgtest-SETUP", password: "secretsetup" }
ota:
logger: { level: DEBUG, baud_rate: 115200}
web_server: { port: 80 }
time:
- platform: sntp
on_time_sync:
then:
- logger.log: "Starting wireguard..."
- lambda: |
wg.begin(local_ip,private_key,endpoint_address,public_key,endpoint_port);
wg-settings.h
#include <WireGuard-ESP32.h>
static WireGuard wg;
char private_key[] = "XXXXXXXXXXXXXXX="; // private key of the client (ESP)
char public_key[] = "YYYYYYYYYYYYYYYY="; // public key of the server (remote linux VPN server)
IPAddress local_ip(192,168,99,123); // VPN IP for this VPN client
char endpoint_address[] = "vpn.example.com"; // VPN/Wireguard server hostname
int endpoint_port = 51820; // VPN/Wireguard server port
The web server works, it's pretty amazing to have Wireguard running finally thanks a lot :D
However, I haven't been able to connect via OTA nor ESPHome API (adding api:
). We must be missing some internal configuration.
Maybe we need to find a way to set up wireguard before api & ota. Almost there!
OK, got it to work with Home Assistant & OTA! :smile:
We were missing an IP route from the Home Assistant network to the Wireguard network (i.e. packets sent from HASS to the ESPHome node IP were being forwarded to the router, which dropped them). So neither HASS nor OTA could reach the nodes. I've arranged these instructions to make it work:
- Set up the official Wireguard addon with the standard configuration, verify you can connect to HASS from your phone on data.
- Add the following to your Home Assistant's configuration.yaml. It creates a "command" sensor to periodically fetch the Wireguard addon's internal IP, and also configure the correct IP route.
sensor:
- platform: command_line
name: Wireguard addon internal IP # Creates the IP route to support ESPHome devices on Wireguard
command: host_result=$(host a0d7b954-wireguard); addon_ip=${host_result##* }; ip route replace 172.27.66.0/24 via $addon_ip; echo $addon_ip
- Restart HASS, the new text sensor will take a couple minutes to settle into an IP like 172.30.33.2.
- Then note: To add the ESPHome nodes to Home Assistant you need to do it manually by going to
Config->Integrations->Add->ESPHome
and typing the node's specific wireguard IP. Make sure that you have theapi:
line in the yaml for each node. And for the ESPHome dashboard, remember to enablestatus_use_ping
so the nodes are properly detected.
A bit tacky but at least we know it can work! Thanks @davey, @mrkeuz and @ciniml for making this possible! :tada: Finally we can properly have remote ESPHome nodes :D
@CarlosGS fantastic news!
I'm curious, did you try test connections exactly from ESPHome
. I.e. try to connect to MQTT inside wg
LAN. Seems wg
in this case should start before MQTT component, right? And in general, will it be working at all. Just curious, how it works in core.
Honestly, exposed API via wg
is already BIG DEAL and this really cool!
Hopefully sooner or later this will land to mainstream.
@CarlosGS, @davey 🚀🚀🚀
Haven't tried MQTT yet, but it should work. Setup order shouldn't really matter as the Wireguard implementation overrides the default routing interface.
Hopefully sooner or later this will land to mainstream.
Indeed! And ESP8266 is also based on lwip - do you think it could be possible to port it, or does it depend on internal cipher functions of ESP32?
ESP8266 is also based on lwip - do you think it could be possible to port it
Actually, I'm not "core" c/cpp
developer. Just touching home automation a bit. And didn't dive into libraries/compatibility so deeply yet, especially with lwip
.
I think it needs just try. The missing functions can be added and replaced via some #DEFINE
magic. All the more wg
uses modern ciphers and I don't think there will be any hardware restrictions or limitations in this area. Also, as described in original implementation, ciphers implemented in pure c, so don't think that here will be some problems. Just will be working little slowly.
Ah. Finally, found next discussion (see last comment). Seem it already worked on ESP8266
. So just here a question how easily can be integrated into esphome
.
The other item that wasn't working "out of the box" was the API logger. Connecting with the remote logger would make the ESP32 fall into some sort of loop and stop responding.
Found a solution after some debugging: we simply need to remove/comment the ESP_LOG
statements from the wireguard code, it seems they clash with ESPHome's internal logger. Doing that, everything works just fine :tada:
Also, for a complete official component we should consider enabling Wireguard in "OTA safe mode", this way remote nodes would be accessible even in the event of a reboot loop :)
:thinking: It would be great if someone could get ESPHome+Wireguard running on ESP8266, that would really shape an official method to have remote ESPHome nodes. Any news or testing, make sure to post here!
Just FYI.
Found easy instruction how link home-assistant
container to WireGuard (without route
magic):
https://www.pedrolamas.com/2020/11/20/how-to-connect-to-a-wireguard-vpn-server-from-a-docker-container/
Maybe it might be useful for somebody.
Hello everyone, first of all, thanks a lot for your work, it's awesome! I have an addition to the solution from @CarlosGS . Details are in this issue (https://github.com/ciniml/WireGuard-ESP32-Arduino/issues/13). The correct configuration should be like this to avoid reboots every ~10 min:
time:
- platform: sntp
on_time_sync:
then:
- lambda: |
static const char* TAG = "wireguard";
ESP_LOGD(TAG, "Starting...");
if( !wg.is_initialized() ) {
ESP_LOGD(TAG, "Initializing WG interface...");
if( !wg.begin(
local_ip,
private_key,
endpoint_address,
public_key,
endpoint_port) ) {
ESP_LOGD(TAG, "Failed to initialize WG interface.");
}
}
I hope this information will be useful and save someone a few nights of debugging :)
Seem it already worked on
ESP8266
.
i did confirm that esp8266 works fine with the original implementation.
https://github.com/trombik/esp_wireguard
This feature will be added to esphome?
Seem it already worked on
ESP8266
.i did confirm that esp8266 works fine with the original implementation.
https://github.com/trombik/esp_wireguard
Hi, I tried to build that with platformIO but I get error, How did you do it?
Thanks.
.pio/libdeps/woodenbrick/esp_wireguard/src/crypto.c: In function 'crypto_equal': .pio/libdeps/woodenbrick/esp_wireguard/src/crypto.c:18:5: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith] a += 1; ^ .pio/libdeps/woodenbrick/esp_wireguard/src/crypto.c:19:5: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith] b += 1; ^ Compiling .pio/build/woodenbrick/libaf1/esp_wireguard/crypto/cortex/cortex_m0_mpy121666.s.o xtensa-lx106-elf-as: unrecognized option
-x'
*** [.pio/build/woodenbrick/libaf1/esp_wireguard/crypto/cortex/cortex_m0_mpy121666.s.o] Error 1`
as I don't use platformio, I don't know.
@CarlosGS thank you (gracias!). I'm very close to make work oracle cloud+home assistant+wireguard+esphome. Only have and issue (the last?). I've made your magic with the command sensor. With those line wireguard works, but home assistant loses internet connection. any idea? EDIT: I think I get it: sudo sysctl -w net.ipv4.ip_forward=1 echo "net.ipv4.ip_forward = 1" | sudo tee -a /etc/sysctl.conf sudo sysctl -p /etc/sysctl.conf
Hmm, do you mean your Home assistant is running in an external server?
Mine runs in LAN, sorry, I'm not sure what would be needed to make it work like that 🤔
Hmm, do you mean your Home assistant is running in an external server? Mine runs in LAN, sorry, I'm not sure what would be needed to make it work like that 🤔
yes, it's working on an oracle cloud+wireguard (i think it's great). I'd to enable ip forward to make it work (see my previous post).
I'd issues also to install all together with motioneye (+ esp32cam). I think I will have to change cidr address on command sensor:
command: host_result=$(host a0d7b954-wireguard); addon_ip=${host_result##* }; ip route replace 172.27.66.0/12 via $addon_ip; echo $addon_ip
thank you!
Hi, can anyone make a little guide in one document, how novice users like me can get wiregurd working with esp32? Thanks :) I think it can help more people that me ;)
Hi, can anyone make a little guide in one document, how novice users like me can get wiregurd working with esp32? Thanks :) I think it can help more people that me ;)
A quick and ugly guide. enjoy EDIT: see this comment
Hi, can anyone make a little guide in one document, how novice users like me can get wiregurd working with esp32? Thanks :) I think it can help more people that me ;)
A quick and ugly guide. enjoy hass.docx
PSA this attachment is a virus.
Why do you think it's a virus? It's a document describing how to setup wireguard on an esphome device.
As my av picked up the doc is infected. Open it at your peril.Get Outlook for Android
I opened it in LibreOffice and there were no warnings. I don't see any macros. However, an online virus scanner does say it has a problem. https://www.fortiguard.com/encyclopedia/virus/10092628 Use Windows at your peril. :-)
the virus is on your mind. here's an online version to install Home Assistant on the cloud with Wireguard and esphome.
https://docs.google.com/document/d/1qZ69Z8mk8uFgMNyqTZbkIQTE1_aEXn3BoerFWkDh70c/edit?usp=sharing
@fkoteam, it's such a vague scan warning and I'm sure it's a false alarm caused by the funny urls you used in the document. You should probably make those just text and not real links.
tried to port my esp_wireguard
to esphome
. however, platformio
has been troublesome with esp-idf
, and still is. some call it "unpredictable wonky behavior". until almost two-years-old issue https://github.com/platformio/platform-espressif32/issues/453 is fixed, it's not possible. the problem is directory of lib_deps
is not part of EXTRA_COMPONENT_DIRS
, and platformio
does not read Kconfig
of lib_deps
. they chose to implement their own, and failed to do it correctly. like it or not, that's the way it is.
that means you need to add list(APPEND EXTRA_COMPONENT_DIRS path)
to CMakeLists.txt
.
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
list(APPEND EXTRA_COMPONENT_DIRS $ENV{PWD}/.pio/libdeps/wireguard)
project(wireguard)
a workaround is to add a feature to esphome
that modifies CMakeLists.txt
in the top directory. I don't think anyone would bother to implement it.