From d862ad16618ef416ca52dec75daa33b3ccd8b548 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Fri, 14 Jan 2022 23:02:05 +0100 Subject: [PATCH] Fix multicast --- tasmota/support_device_groups.ino | 7 +++++++ tasmota/xdrv_10_scripter.ino | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/tasmota/support_device_groups.ino b/tasmota/support_device_groups.ino index be23234d0..699db3911 100644 --- a/tasmota/support_device_groups.ino +++ b/tasmota/support_device_groups.ino @@ -177,10 +177,17 @@ void DeviceGroupsStart() } // Subscribe to device groups multicasts. +#ifdef ESP8266 if (!device_groups_udp.beginMulticast(WiFi.localIP(), IPAddress(DEVICE_GROUPS_ADDRESS), DEVICE_GROUPS_PORT)) { AddLog(LOG_LEVEL_ERROR, PSTR("DGR: Error subscribing")); return; } +#else + if (!device_groups_udp.beginMulticast(IPAddress(DEVICE_GROUPS_ADDRESS), DEVICE_GROUPS_PORT)) { + AddLog(LOG_LEVEL_ERROR, PSTR("DGR: Error subscribing")); + return; + } +#endif device_groups_up = true; // The WiFi was down but now it's up and device groups is initialized. (Re-)discover devices in diff --git a/tasmota/xdrv_10_scripter.ino b/tasmota/xdrv_10_scripter.ino index 2a78bba70..c9ec5331b 100755 --- a/tasmota/xdrv_10_scripter.ino +++ b/tasmota/xdrv_10_scripter.ino @@ -1020,7 +1020,11 @@ void Script_Init_UDP() { if (!glob_script_mem.udp_flags.udp_used) return; if (glob_script_mem.udp_flags.udp_connected) return; +#ifdef ESP8266 if (glob_script_mem.Script_PortUdp.beginMulticast(WiFi.localIP(), IPAddress(239,255,255,250), SCRIPT_UDP_PORT)) { +#else + if (glob_script_mem.Script_PortUdp.beginMulticast(IPAddress(239,255,255,250), SCRIPT_UDP_PORT)) { +#endif #ifdef SCRIPT_DEBUG_UDP AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UPNP "SCRIPT UDP started")); #endif