calaos / calaos_base

Calaos server
https://calaos.fr
GNU General Public License v3.0
160 stars 37 forks source link

On first configuration push, calaos_server incorrectly toggle DO_0 & DO_1 #149

Open StevenLeRoux opened 4 years ago

StevenLeRoux commented 4 years ago

I will try to make this more reproducible, but I've stumbled upon a weird behaviour while trying to push my very first config to calaos.

The funny thing is that while toggling DO_0, this had cut the power of the outlet where Calaos was , which led me to quickly face it :)

raoulh commented 4 years ago

What hardware do you use to control outlet? Wago PLC or anything else?

StevenLeRoux commented 4 years ago

A Wago 750-881

Note that while trying to debug this, I've make sure that no DO was actually configured at all for this address so DO_0 was totally unknown from calaos_installer before sending the conf to calaos_server.

raoulh commented 4 years ago

I guess that the wago switched to "calaos managed mode" after you loaded the first time your config. Then the adresse mapping was changed from the "fail safe mode" to "calaos mode" and the output state are switched to default value. Actually there is no fix for that. It happens only the first time, because without config calaos_server is not yet connected to the PLC, and the PLC does not know calaos_server, and then is by default in "fail safe mode"...

StevenLeRoux commented 4 years ago

Hmm the relay behind DO_0 is CLOSED by default which would mean that a default value should have been to not enable the Digital Output right?

Do we have a way to dump the state from/to the Wago PLC? This way we could try to sync the PLC and Calaos so that the failover between Wago and Calaos would be transparent.