Pylon EnumerateDevices() not finding Basler GigE cameras

I hit a problem recently whereby CTlFactory::EnumerateDevices() would not find my connected Balser cameras while Pylon Viewer would find and connect to them OK.  On investigation I discovered that if WiFi was enabled on the host, then the GigE Vision Device discovery broadcast messages would not be sent over GigE to the cameras.  With WiFi disabled the cameras would be found but when it is enabled they wouldn’t be found!

After a good bit of googling I discovered that I should call IGigETransportLayer::EnumerateAllDevices() rather than the usual CTlFactory::EnumerateDevices(), here is some code that demonstrates the switch:


#include <pylon/gige/GigETransportLayer.h>
auto& factory = CTlFactory::GetInstance();
// This does not always work so we use EnumerateAllDevices() below instead..
// factory.EnumerateDevices();
auto* transport_layer = (IGigETransportLayer*)factory.CreateTl(Pylon::BaslerGigEDeviceClass);