Getting "CRC Error" and "EOF Error" in modbus

I am trying to add a flashing / blinking lights when Smoke Detection happen.
I am working on that, If you have any ideas , Please provide me

https://community.openhab.org/search?q=flashing%20lights

Thanks for the info.
I am facing other issue.

After adding code in rules to automate the detecting the smoke and alarm process.
I am observing, Alarm is turning ON (sporadically) some time without any hardware event.
I am trying to find which one is causing this problem.
Previously, I have added a button to turn ON/ OFF alarm manually, I have removed that too.
Can you please help me to fix this issue ?

.rules1

rule "Reseting Smoke Detector Rules"
when
    Time cron  "0 0/1 * 1/1 * ? *"
then
    //var flag 
    if (SmokeDetector03_Switch.state == OFF) 
    {
        logDebug("Reseting Smoke Detector Rules", "SmokeDetector03_Switch.state is off ")
        return;
    }
    logDebug("Reseting Smoke Detector Rules", "Inside reseting SmokeDetector")
    sendCommand(ResetSmokeDetector03, OFF)
    //sendCommand(FireAlarm_Switch, ON)
end



rule "SmokeDetectore trigerrs FireAlarm"
when 
    Item SmokeDetector03_Switch changed 
then
    if (SmokeDetector03_Switch.state == OFF)
    {
        logDebug("SmokeDetectore trigerrs FireAlarm", "Returning")
        return;
    }

    if ((SmokeDetector03_Switch.state == ON)){
    //var newState = ON
    //FireAlarm_Switch.sendCommand(newState)
    sendCommand(FireAlarm_Switch, ON)
    logDebug("SmokeDetectore trigerrs FireAlarm", "Send command to FireAlaram")
    }
end


rule "MaualCallPoint triggers FireAlram"
when 
    Item  Manual_Switch changed
then
    if ( Manual_Switch.state == OFF)
    {
        logDebug("MaualCallPoint triggers FireAlram", "Exiting")
        return;
    }
    if ( Manual_Switch.state == ON){
        sendCommand(FireAlarm_Switch, ON)
    logDebug("MaualCallPoint triggers FireAlram", "Entering")
    }
end 

.rules2

rule "Reseting Smoke Detector Rules_124"
when
    Time cron  "0 0/1 * 1/1 * ? *"
then
    //var flag 
    if ((SmokeDetector01_Switch.state == OFF)  && (SmokeDetector02_Switch.state == OFF) && (SmokeDetector04_Switch.state == OFF) )
    {
        logDebug("Reseting Smoke Detector Rules_124", "SmokeDetector_Switch.state 124 is off ")
        return;
    }
    logDebug("Reseting Smoke Detector Rules_124", "Inside reseting SmokeDetector 124")

    if (SmokeDetector01_Switch.state == ON)
    {
        logDebug("Reseting Smoke Detector Rules_124", "Inside reseting SmokeDetector 1")
    
        sendCommand(ResetSmokeDetector01, OFF)
    
    }

    if (SmokeDetector02_Switch.state == ON) {
        logDebug("Reseting Smoke Detector Rules_124", "Inside reseting SmokeDetector 2")
        sendCommand(ResetSmokeDetector02, OFF)
    }

    if (SmokeDetector04_Switch.state == ON) {
        logDebug("Reseting Smoke Detector Rules_124", "Inside reseting SmokeDetector 4")
        sendCommand(ResetSmokeDetector04, OFF)
    }
    
end



rule "SmokeDetectore trigerrs FireAlarm_124"
when 
    Item SmokeDetector01_Switch changed or
    Item SmokeDetector02_Switch changed or
    Item SmokeDetector04_Switch changed 
then
    if ((SmokeDetector01_Switch.state == OFF) && (SmokeDetector02_Switch.state == OFF) && (SmokeDetector04_Switch.state == OFF))
    {
        logDebug("SmokeDetectore trigerrs FireAlarm_124", "Returning 124")
        return;
    }

    if ((SmokeDetector01_Switch.state == ON)){
    
    sendCommand(FireAlarm_Switch, ON)
    logDebug("SmokeDetectore trigerrs FireAlarm_124", "Sending command to FireAlaram from SmokeDetector 1")

    }
    if ((SmokeDetector02_Switch.state == ON)){
    
    sendCommand(FireAlarm_Switch, ON)
    logDebug("SmokeDetectore trigerrs FireAlarm_124", "Sending command to FireAlaram from SmokeDetector 2")

    }

    if ((SmokeDetector04_Switch.state == ON)){
    
    sendCommand(FireAlarm_Switch, ON)
    logDebug("SmokeDetectore trigerrs FireAlarm_124", "Sending command to FireAlaram from SmokeDetector 4")

    }
end


Log comparison of MCP automatic ON and OFF event.

Hi Rossko,

I am getting this issue sporadically,

2019-04-09 15:20:51.248 [DEBUG] [ntime.internal.engine.RuleEngineImpl] - Executing rule 'MaualCallPoint triggers FireAlram'
2019-04-09 15:20:51.248 [DEBUG] [rt.modbus.internal.ModbusManagerImpl] - Modbus operation ended, timing info: {total: 220 ms, connection: 187, transaction=24, callback=9} [operation ID 363261ae-40dd-476e-b82c-a08ca93ff620]
2019-04-09 15:20:51.248 [DEBUG] [rt.modbus.internal.ModbusManagerImpl] - Execution of scheduled (200ms) poll task BasicPollTaskImpl@18fefb30[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@6d91bb9a[slaveId=4,functionCode=READ_INPUT_REGISTERS,start=8,length=2,maxTries=3],endpoint=ModbusSerialSlaveEndpoint@6cebdc44[portName=/dev/ttyACM0],callback=org.openhab.binding.modbus.internal.handler.ModbusPollerThingHandlerImpl$ReadCallbackDelegator@818e012] finished at 1554803451248. Was started at millis: 1554803451028 (=duration of 220 millis)
2019-04-09 15:20:51.250 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'MaualCallPoint triggers FireAlram': An error occurred during the script execution: Could not invoke method: org.eclipse.smarthome.model.script.actions.LogAction.logDebug(java.lang.String,java.lang.String,java.lang.Object[]) on instance: null
2019-04-09 15:20:51.278 [DEBUG] [rt.modbus.internal.ModbusManagerImpl] - Executing scheduled (100ms) poll task BasicPollTaskImpl@1a03f7c1[request=ModbusPollerThingHandlerImpl.ModbusPollerReadRequest@20c3714

When Manual Call point event occurs, Alarm is not called because of this.

I am waiting for the input.
Is it because of HW or configuration ?

I think that’s a dumb idea. At periodic intervals, you reset the detector if it is set. Why? Your other rules may still be processing a sensor event, or may not even have started processing it yet.
Do you think it might be better to start off a timer when you see a sensor set, that will reset it some fixed time later?

The logDebug in you rule failed because something was null. Cannot see any reason for that in the version of the rule you have shown us. Make sure you do not have two rules with the same name rule "MaualCallPoint triggers FireAlram"

I want to automate the process. You want to me to check every 3 minutes instead of 1 minute.
When can I reset the detector after a sensor is set?.
Please give me solution to correct my rules.

I don’t want you to do anything.
I’m advising you to really think about what you want to do.

Resetting every sensor every minute or whatever seems odd. A sensor might stay set for 1 minute or 1 millisecond, depending when it got set in relation to your fixed-time cron rule.

If, for example, you really wanted to reset a sensor a minute after it gets set?
You would add a timer section to the set-triggered rule that rings bells or whatever.
The timer is set to run 1 minute from now and reset the sensor.

openHAB is an event-driven system; it is generally best to make X happen in response to Z event, rather than being clock-driven .

Actually, My smoke detector is not reset in one write. Because, Smoke will stay there for few minutes. Eventhough , I sent reset command, smoke detector will reset and again smoke detector sensor will set because of smoke presence. Smoke disappearing time is not constant , it is varying one.

Can I change my rules like this way,

when
    Time cron  "0 0/1 * 1/1 * ? *" 
                 AND
    Item SmokeDetector03_Switch changed

then

Understood. I would imagine you still wouldn’t want to attempt a reset within 1mS of a “set” though, and your current cron-based rule trigger will do that sometimes.

Nope. That would be two events that never happen at the exact same instant. Rule triggers are always events.

So, What ever i implemented previously for resetting smoke detector is correct?. I will stay with that.

It’s up to you.
You are building a race condition into your system.
At any arbitrary moment after a sensor sets, it may get reset again.

So let’s say another rule is triggered by the sensor setting -you know, to ring a bell or start a sprinkler - and when it checks for set sensor it may already have been reset.

This is a fire alarm system, right? Safety of life and all that? “Works usually” is good enough?

I have created Timer Event and before resetting the register, I am checking whether smoke detection is occurred. If so, I am turning on the alarm and I am manually turning off the alarm in my floor plan.

I am not resetting the register every minute. I do check before resetting.

If you have any other way to do this, Please provide me

My point is that your check occurrs every minute, or whatever cron period you set.

The timing of the check is completely unrelated to whenever the sensor may actually get set.

So the timing of the reset is completely unrelated to whenever the sensor got set. It may have been half a millisecond or one minute ago. It’s unpredictable - unpredictable in a safety related system should give you pause for thought.

If you have other rules that look at the value of the sensor, the sensor value may unpredictably change while that rule is running. Might be problem, do you think?

The root of the problem is that you have chosen a cron-based reset method.
An alternative approach is not to do it that way.
You might instead, for example, start a timer from an incoming change of sensor to "set. After a period, the timer resets the sensor.
The result is predictable.

I’m not writing code for you, I really do not want anything to do with life safety systems that are not getting properly thought out.

Ok…

I will be changing my code like this Once sensor is set, my “sensor event” rule will be called and inside that, I will be having timer function which will be sending a reset command for specific time period for example 5 minutes.

Please correct me, If i am wrong

That sounds a more sensible approach.

Ok. I am working on other issue. After that, I will implement this. I will let you know the status.