Dynamically Assign Serial Port to Use?

I've been doing some testing with maker edition using an ESP32 and ATmega with the Arduino IDE. I'm reading modbus variables from them using the serial port they make when connected to my computer, but occasionally that port changes.

I'm pretty sure I already know the answer to this, but in the hope that someone has found a clever workaround for this, is there a way to set the serial port used for the device from within a client instead of in the gateway's web interface for that device?

You can destroy and re-create the device, and provide the appropriate settings in the system.device.addDevice() call.

1 Like

That is quite clever, thanks!