Octoprint controlling electric lock

Hello all,
I am in charge of a workshop including a 3D printer at my university. For this, I have converted a key box so that it can be opened via an electric lock with a coil. I would like to control the coil via Octoprint so that I can create an account there for all users. The connection between Raspberry and lock can either with an additional ESP or directly through a GPIO.
I have discovered the Enclousure plugin, but it looks depricated. Alternatively, control via Tasmota and an ESP would also be possible, but communication there is only possible via http, which I don't want to operate unencrypted in our network with other users. Do you have any other good ideas for implementation?
Many greetings

Hello @Joko !

That does not it will not work.
(What have I written there :man_facepalming:)

Check out the SIOControl plugIn. It employs a MC to do the IO control. It might be a good option for your setup.


1 Like

Thanks for your reply and idea. Thats look pretty good. Do you know if it is possible to switch the output after a few seconds to off? People are stupid and I want to prevent that the coil has all the time power if the forget to switch the output to off.

SIOControl currently does not support an interval output at this time. That said, it would be a minor change to the firmware to hard code a relay to turn off after a set number of seconds.

Where do I have to modify the code? I found the "SIO_ESP32WRM_Relay_X2" firmware, which looks well for my case.

SIO_ESP32WRM_Relay_X2.zip (5.0 KB)

Assuming you are taking VERSIONINFO "SIO_ESP32WRM_Relay_X2 1.0.9"

I have uploaded a zip that you can use to replace the "SIO_ESP32WRM_Relay_X2.ino" file.
Here is what is done.

We will add a reset for IO12 (relay 2 on the related board) Real IO point is 17

I will suggest that you update the #define VERSIONINFO to the following but its merely to help if you need support.
"SIO_ESP32WRM_Relay_X2 1.0.9_joko"

On line 121 Add:
TimeRelease ResetOutPut12; unsigned long IO12ResetTime = 3000; //resets after 3 seconds

At the end of the loop line ~138 .
Add the following.

  if (IO[12] == 1 && !ResetOutPut12.isRunning()){
    Serial.println("IO Changed, timer is set");
  }else if(IO[12] == 1 && ResetOutPut12.check()){

I did a quick test and it seems to be working well. I will look at how this functionality can be added in a future update.

Hope this works out for you.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.