Skip to content

[Bug]: App binds to wrong network interface on systems with virtual/secondary adapters (Multi-homing UDP issue) #400

@jakubgt

Description

@jakubgt

Firefly Luciferin version

v2.25.6

Glow Worm Luciferin version

v5.23.6

Firmware type

FULL

What is the stream method?

WiFi Stream

How to reproduce

Ethernet stream version

I encountered an issue where glow worm was unable to send data to the luciferin app on Windows. Both devices are on the same subnet (192.168.1.x), and I could ping the ESP32 directly from Windows without issue.

I have a secondary network adapter active on my PC (a UsbNcm host device creating a 192.168.128.x subnet) from USB tethering a phone. Checking my firewall logs, I noticed Firefly Luciferin was attempting to route its UDP traffic out through this secondary adapter instead of my primary Ethernet connection.

Disabling the secondary adapter in Windows completely resolved the issue, and the ESP32 was instantly recognized.

Fixing this would involve to enumerate all active local network interface objects and send UDP discovery/stream packets out on all active subnets simultaneously.

ESP32 had a static IP enabled by the gateway and windows app had output device set at the static IP. Both devices were on same vlan at the time.

Fiefly Luciferin config file

---
wirelessStream: true
fullFirmware: true
mqttEnable: false
outputDevice: "-"
staticGlowWormIp: "192.168.1.241"
baudRate: "115200"
runtimeLogLevel: "INFO"
audioChannels: "2 channels"
audioDevice: "Default audio output (Native)"
audioLoopbackGain: 0.0
autoDetectBlackBars: true
bottomLeftLed: 13
bottomRightLed: 13
bottomRowLed: 63
brightness: 255
brightnessLimiter: 1.0
captureMethod: "DDUPL_DX12"
checkForUpdates: true
colorChooser: "255,82,0,255"
colorMode: 2
configVersion: "2.25.6"
defaultLedMatrix: "FullScreen"
desiredFramerate: "60"
effect: "Bias light"
enableLDR: false
luminosityThreshold: 0
nightLightLvl: 1
nightLight: "Disabled"
smoothingType: "Smoothing Lvl 3"
frameInsertionTarget: 30
smoothingTargetFramerate: 60
emaAlpha: 0.2
gamma: 2.2
gapTypeSide: "0%"
gapTypeTopBottom: "8%"
grabberAreaTopBottom: "8%"
grabberSide: "8%"
groupBy: 1
language: "English"
ldrInterval: 0
ldrMin: 0
ldrTurnOff: false
ledStartOffset: 63
leftLed: 32
monitorNumber: 0
mqttDiscoveryTopic: "homeassistant"
mqttPwd: ""
mqttServer: "tcp://192.168.1.3:1883"
mqttTopic: "glowwormluciferin"
mqttUsername: ""
multiMonitor: 1
multiScreenSingleDevice: false
nightModeBrightness: "0%"
nightModeFrom: "22:00"
nightModeTo: "08:00"
numberOfCPUThreads: 1
orientation: "Anticlockwise"
osScaling: 100
powerSaving: "30 minutes"
rightLed: 31
sampleRate: 0
screenResX: 3840
screenResY: 2160
splitBottomMargin: "0%"
splitBottomRow: true
startWithSystem: true
streamType: "UDP stream"
syncCheck: true
theme: "Dark orange"
threadPriority: "HIGH"
timeout: 5
toggleLed: true
topLed: 55
whiteTemperature: 65
satellites: {}
algo: "Average color"
hueMap:
  BLUE:
    hue: 0.0
    saturation: 0.0
    lightness: 0.0
  GREY:
    hue: 0.0
    saturation: 0.0
    lightness: 0.0
  MAGENTA:
    hue: 0.0
    saturation: 0.0
    lightness: 0.0
  CYAN:
    hue: 0.0
    saturation: 0.0
    lightness: 0.0
  RED:
    hue: 0.0
    saturation: 0.0
    lightness: 0.0
  YELLOW:
    hue: 0.0
    saturation: 0.0
    lightness: 0.0
  GREEN:
    hue: 0.0
    saturation: 0.0
    lightness: 0.0
  MASTER:
    hue: 0.0
    saturation: 0.0
    lightness: 0.0
screenCastRestoreToken: null
simdAvx: 0
trayPreference: "AUTO"
udpTrafficClass: 46
gpuThreshold: 0
cpuThreshold: 0
profileProcesses: []
checkFullScreen: false
resamplingFactor: 4
ledMatrix:
  FullScreen:

Relevant log output

[INFO] Initializing network adapters...
[INFO] Found interface: Mellanox ConnectX-4 (192.168.1.x)
[INFO] Found interface: UsbNcm Host Device (192.168.128.11)
[INFO] Binding UDP socket for broadcast to 192.168.128.11
[ERROR/WARN] Failed to discover devices / Sending payload to 192.168.128.11

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions