Hi @kayson ,
The Modbus command 0x0F (Writes Multiple Coils) can be used to set one or more coils. Usually it is enough to support only this command to write coils. The current stack implementation has this constraint in the design. If your device supports only command 0x05 (Force Single Coil) the stack should be updated to add this support. If you really need this I can provide instructions or patch to fix this for your project. Again, this is not issue but design decision.
Another way to implement it is to use
mbfunccoils_m.c::eMBMasterReqErrCode
eMBMasterReqWriteCoil( UCHAR ucSndAddr, USHORT usCoilAddr, USHORT usCoilData, LONG lTimeOut )
or change implementation of
esp_err_t mbc_serial_master_send_request(mb_param_request_t* request, void* data_ptr)
function to use the above function when we set just one coil.