flyte / mqtt-io

Expose GPIO modules (Raspberry Pi, Beaglebone, PCF8754, PiFace2 etc.) and digital sensors (LM75 etc.) to an MQTT server for remote control and monitoring.
MIT License
461 stars 157 forks source link

timed_set_ms is not respected always. #310

Open athanassis opened 1 year ago

athanassis commented 1 year ago

Describe the bug I'm using the timed_set_ms in output pins which drive latching relays. The configured value (100ms) is not always followed by mqtt-io. I observe delays in automatically setting the gpio pin back to its initial state of up to 6s. This causes a buzz sound in the relays which is annoying. The frequency that the delays are observed is ~2.3% (98 occurrences / 4201 total events). This is from a log file of 1 year period, so I hear the buzz in the relays nearly every ~3.5 days on average.

Expected behavior The timed_set_ms should be respected in all cases.

Error messages and traceback Here is a sample from a log showing a delay:

2023-02-20 18:19:42 mqtt_io.server [INFO] Digital output 'corridor_lights_relay' set to False (on)
2023-02-20 18:19:48 mqtt_io.server [INFO] Setting digital output 'corridor_lights_relay' back to its previous value after configured 'timed_set_ms' delay of 100ms
2023-02-20 18:19:48 mqtt_io.server [INFO] Digital output 'corridor_lights_relay' set to True (off)```

Here is a sample from an event working as expected:

2023-02-20 18:48:37 mqtt_io.server [INFO] Digital output 'corridor_lights_relay' set to False (on)
2023-02-20 18:48:37 mqtt_io.server [INFO] Setting digital output 'corridor_lights_relay' back to its previous value after configured 'timed_set_ms' delay of 100ms
2023-02-20 18:48:37 mqtt_io.server [INFO] Digital output 'corridor_lights_relay' set to True (off)

Config

  - name: corridor_lights_relay
    module: kili
    pin: 8
    initial: 'high'
    inverted: True
    timed_set_ms: 100```

Hardware

System:

Additional context I run mqtt-io with Deployment using supervisor