mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-26 04:06:34 +00:00
Fix multicast
This commit is contained in:
parent
fffcf1c2df
commit
d862ad1661
@ -177,10 +177,17 @@ void DeviceGroupsStart()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Subscribe to device groups multicasts.
|
// Subscribe to device groups multicasts.
|
||||||
|
#ifdef ESP8266
|
||||||
if (!device_groups_udp.beginMulticast(WiFi.localIP(), IPAddress(DEVICE_GROUPS_ADDRESS), DEVICE_GROUPS_PORT)) {
|
if (!device_groups_udp.beginMulticast(WiFi.localIP(), IPAddress(DEVICE_GROUPS_ADDRESS), DEVICE_GROUPS_PORT)) {
|
||||||
AddLog(LOG_LEVEL_ERROR, PSTR("DGR: Error subscribing"));
|
AddLog(LOG_LEVEL_ERROR, PSTR("DGR: Error subscribing"));
|
||||||
return;
|
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;
|
device_groups_up = true;
|
||||||
|
|
||||||
// The WiFi was down but now it's up and device groups is initialized. (Re-)discover devices in
|
// The WiFi was down but now it's up and device groups is initialized. (Re-)discover devices in
|
||||||
|
@ -1020,7 +1020,11 @@ void Script_Init_UDP() {
|
|||||||
if (!glob_script_mem.udp_flags.udp_used) return;
|
if (!glob_script_mem.udp_flags.udp_used) return;
|
||||||
if (glob_script_mem.udp_flags.udp_connected) 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)) {
|
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
|
#ifdef SCRIPT_DEBUG_UDP
|
||||||
AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UPNP "SCRIPT UDP started"));
|
AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UPNP "SCRIPT UDP started"));
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user