Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write doesn't work anymore #25

Closed
bmpalmeida opened this issue Oct 31, 2023 · 6 comments
Closed

Write doesn't work anymore #25

bmpalmeida opened this issue Oct 31, 2023 · 6 comments

Comments

@bmpalmeida
Copy link

Hello,

I was using the spiciermodbus2mqtt from some time, and was always working.

I updated the other day the raspbian to bookworm, and update the spiciermodbus2mqtt to the latest version (i'm not completely sure which version i was at) and now i cannot write anymore.

Any ideas of what could go wrong?

MQTT LOG:Received PUBLISH (d0, q0, r1, m0), 'mc6_music_teste/mc6/set/SetTemperature', ... (3 bytes)
Writing to device mc6, Slave-ID=16 at Reference=64 using function code 6 FAILED! (Devices responded with errorcode IllegalFunction. Maybe bad configuration?)

@mbs38
Copy link
Owner

mbs38 commented Oct 31, 2023

Can you post your configuration for that please?

@bmpalmeida
Copy link
Author

"type","topic","col2","col3","col4","col5","col6"

poll,mc6,16,0,22,holding_register,15
ref,RoomTemp,0,r
ref,FloorTemp,1,r
ref,Humidity,2,r
ref,4FCUHeatValveStatus,3,r
ref,4FCUCoolValveStatus,4,r
ref,2FCUValveStatus,5,r
ref,HighFanStatus,6,r
ref,MedFanStatus,7,r
ref,LowFanStatus,8,r
ref,HeatingOutputStatus,9,r
ref,HWHeatStatus,10,r
ref,HWHotWaterStatus,11,r
ref,TouchLock,12,r
ref,WindowOpenFunction,13,r
ref,HolidayFunction,14,r
ref,HoldingFunction,15,r
ref,BoostFunction,16,r
ref,FloorOverheat,17,r
ref,DeviceType,18,r
ref,AuxiliaryHeat,19,r
ref,FanType,20,r
ref,SystemEorr,21,r

poll,mc6,16,60,27,holding_register,15
ref,TemperatureFormat,60,rw
ref,Status,61,rw
ref,SystemMode,62,rw
ref,FanSpeed,63,rw
ref,SetTemperature,64,rw
ref,Away,65,rw
ref,AwayTemperature,66,rw
ref,HoldEndTimeHi,67,rw
ref,HoldEndTimeLow,68,rw
ref,HoldingTemperature,69,rw
ref,HolidayStartTimeHi,70,rw
ref,HolidayStartTimeLow,71,rw
ref,HolidayEndTimeHi,72,rw
ref,HolidayEndTimeLow,73,rw
ref,OptimumStart,74,rw
ref,BoostEndTimeHi,75,rw
ref,BoostEndTimeLow,76,rw
ref,Boost,77,rw
ref,TouchPanelLock,78,rw
ref,LockPin1,79,rw
ref,LockPin2,80,rw
ref,LockPin3,81,rw
ref,LockPin4,82,rw
ref,MaxSetTempLimit,83,rw
ref,MinSetTempLimit,84,rw
ref,FloorTempLimit,85,rw
ref,ScheduleMode,86,rw

@bmpalmeida
Copy link
Author

I'm having errors on 61, 62, 63, 64.

Only writing, reading works good as always

@mbs38
Copy link
Owner

mbs38 commented Oct 31, 2023

Well it seems like your device does not support function code 6 (preset single register). Unfortunately Modbus is very often not thoroughly implemented. I have seen a couple of devices that do not support function code 16 (write multiple registers) when writing only one register. Since that seemed to be common I changed spiciermodbus2mqtt to always use function 6 when writing only one register: 687b9a9

A device that only supports function code 16 that is a new quirk. I will add a a command line option to exclude specific function codes.

@bmpalmeida
Copy link
Author

Wow,

Indeed modbus implementations are a mess.

I roll back temporarily to version 0.65 and it's working.

Thanks so much for the debug, and for the project, is being working very well.

@mbs38
Copy link
Owner

mbs38 commented Oct 31, 2023

Please use the command line option --avoid-fc6
Fixed with 6e0e6b5

@mbs38 mbs38 closed this as completed Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants