Wireguard on ESP32-C3 with Tasmota 15.0.1: wgconnect fails #23877
|
Tasmota firmware 15.0.1 compiled with #define USE_WIREGUARD (and the appropriate MCU configured):
Seems to already have been confirmed in this discussion. Is this an issue with Arduino Core for ESP32-C3? |
Replies: 5 comments 7 replies
|
Here is an exception with its stack trace from an ESP32-C3, when trying to invoke wgconnect (the same code compiled for and run on an ESP32 does not produce such an exception): |
|
No luck! What I did:
|
|
Thanks a lot everybody, solution confirmed for release 15.0.1
I tried to apply the same workaround to rel. 15.1.0 and rel. 15.2.0 but it
doesn't work, in these cases the restart exception message is different:
16:57:00.700 RSL: INFO3 =
{"Info3":{"RestartReason":{"Exception":1,"Reason":"Instruction access
fault","EPC":"a5a5a5a4","EXCVADDR":"a5a5a5a4","CallChain":["420c7ac6","42234d45","41504922","41303a37","42234d45"]},"BootCount":82}}
As of now I'll stick to rel15.0.1, to me a working WG means a lot because I
can safely reach my tasmota devices when I'm out of my private network.
Thanks again.
Fabrizio
…On Mon, 29 Dec 2025 at 18:38, GEAG ***@***.***> wrote:
SensorsIot <https://github.com/SensorsIot> has provided a workaround
<trombik/esp_wireguard#59> to avoid these
exceptions with the ESP C series.
Here is a possible integration into Tasmota's
lib/lib_ssl/esp_wireguard-Tasmota/src/esp_wireguard.cpp of the above
solution:
#ifdef CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6
// Create netif with zero IP to avoid crash
const ip_addr_t zero_ip = IPADDR4_INIT_BYTES(0, 0, 0, 0);
const ip_addr_t zero_mask = IPADDR4_INIT_BYTES(0, 0, 0, 0);
wg_netif = netif_add(
&wg_netif_struct,
ip_2_ip4(&zero_ip),
ip_2_ip4(&zero_mask),
ip_2_ip4(&gateway),
&wg, &wireguardif_init,
&ip_input);
// Set real IP via direct assignment (netif_set_addr also crashes)
ip4_addr_copy(wg_netif->ip_addr.u_addr.ip4, *ip_2_ip4(&config->address2));
ip4_addr_copy(wg_netif->netmask.u_addr.ip4, *ip_2_ip4(&config->netmask2));
ip4_addr_copy(wg_netif->gw.u_addr.ip4, *ip_2_ip4(&gateway));
#else // NOT ( CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6)
wg_netif = netif_add(
&wg_netif_struct,
ip_2_ip4(&config->address2),
ip_2_ip4(&config->netmask2),
ip_2_ip4(&gateway),
&wg, &wireguardif_init,
&ip_input);
#endif
wgConnect didn't cash anymore on a ESP32C3 with Tasmota 15.0.1.
—
Reply to this email directly, view it on GitHub
<#23877 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BLFBPTAE54GSRY2FJ2APXJD4EFRHXAVCNFSM6AAAAACFZC7VY2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTKMZWHEYDCNQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
|
A firmware update over a Wireguard connection and the Tasmota webUI has not been successful. The device didn't reconnect on the WG VPN. The reason seams to be, that WG VPN is not available in safeboot-mode (that's ok). But fortunately, the MQTT/TLS connection is still available, which makes the device recoverable by sending the "restart 3" command over MQTT to the device. |
It is now fixed in #24356