openhab / openhab1-addons

Add-ons for openHAB 1.x
Eclipse Public License 2.0
3.43k stars 1.7k forks source link

[Modbus] Request for baud rates over 115200 #5066

Open xeax opened 7 years ago

xeax commented 7 years ago

Only low baudrate allowed, maximum is 115200 for now.

But why? USB-Serial adapters allow much higher baud rates.

May be allowing any baudrate (may be with some special key) will be possible?

PS: For 16MHz controller only 38400 allowed baud rate will have low error rate. 115200 will generate -3.5% error, and 57600 will generate +2.1% error.

Expected Behavior

Allow setting any baudrate (may be with some special key)

Current Behavior

Maximum 115200 baudrate allowed

Possible Solution

Fix baud rate checking in net/wimpi/modbus/util/SerialParameterValidator.java i.e. by adding higher rates, such as 250000, 500000, 1000000, etc

Context

High baud rates allows more modbus devices or higher polling frequency

ssalonen commented 7 years ago

I think this makes lot of sense.

@xeax would you be willing to make a pull request?

Best Sami