Hi, I’m not sure if this will work but it’s worth to try
I modify a ModbusMaster lib a little, namely I added a new method:
void ModbusMaster::update_slv_addr(uint8_t u8MBSlave) {
_u8MBSlave = u8MBSlave;
}
I don’t have any modbus dev at the moment so I can’t tested it but is compiling fine over photon v2.0.1 and the code is borowed from this topic
full code can be found here:
https://go.particle.io/shared_apps/6078e72f346dc30016695e6b
hope will help