Esphome media player with wireguard

Hi all,

I have configured a mediaplayer on an esp32 device, and this works pretty good. However, after I installed wireguard and trying to use the device out of the house, the esp crashes when I’m trying to play local media. As soon as the device is connected within the house again, everything works perfectly.

Other items connected to the esp work fine over wireguard, like lights, a display and an input button. It is just the local media which crashes the device.

When trying to play the media, I can see the media URL in the logging of esphome looking like this:

Media URL: http://192.168.1.9:8123/media/local/file.mp3?authSig=eyJhbGc<>Kb7H4Ay_L2jo661YM

This looks exactly the same as it does when playing media locally from within the house, however, it is not working (and crashing the device) remotely. I read that an esp based media player might crash if it cannot access the media, however, I think the connection is there. Everything else seems to work perfectly.

After the crash, it came with below reset reason.

Anyone has an idea what might cause the crash and how to make local media play work through wireguard?