-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IOT Power Relay configuration help needed #97
Comments
If I'm understanding this right you want:
Based on the above:
|
I appreciate the quick response. |
You may need to alter the script slightly to match your configuration but it should work. |
I'll try it tonight, Thank you. |
I hope I did this right. I used Putty to SSH into RPi and used I then used "sudo chmod 755 /home/pi/sense.sh". I installed Portlister via the plugin manager. I then restarted OctoPrint. I logged into OctoPrint locally from a win10 machine. Under PSU Control, I changed "switching" to 'GPIO Pin #40'. No checkmark on Invert, Enable switching with G-code commands, M80 & M81. Under 'Sensing' i set it to 'System Command' and typed "/home/pi/sense.sh". Power On Options is un checkmarked. Power Off Options, checkmark only next to 'disconnect on power off'. I confirmed that "Auto-connect to printer on sever start" was checkmarked. Under "GCODE Scripts", 'After Connection to Printer is established" I added: I then Shut down everything and tested it from scratch. RPi pluged into Always-ON, Printer plugged into Normally-ON. I flipped the main switch on the IOT Power Relay. OctoPrint Booted while the Printer Booted. Now the bad. The lighting bolt is not lit up. If I click the button, the printer instantly turns off without a warning dialog. If I click the button again, it give mes a dialog that im going to turn the printer off, but actually Im trying to turn it on. If I toggle the invert checkmark under PSU Control, then the printer turns off on boot up. |
Run |
When Printer is on: When Printer is off: |
Enable invert on switching pin |
If i do that, on boot, the printer will turn off mid mid stream. Like the RPi is sending a signal on GPIO |
yeap - it did. just tested it again to confirm. |
Although not required you generally want HIGH(1) to be ON and LOW(0) to be OFF. In your case you can edit the script on line 7 and 11. Swap the 0 and 1 on each. |
So I swapped the 1 and the 0 . And then I toggled the "invert" back off (un-checkmarked) because the first test didn't work. I now tested a second time. It booted good, printer beeped, Lightning bolt is green, but when I click the button, it does show the warning but it doesn't toggle the GPIO pin state now, the Printer stays powered .... but it does disconnect. once disconnected the light is still green. and now its giving me constant errors on trying to re-connect. I hope this makes sense to you... |
I tried to use Invert function and use the Normally-Off outlets on the IOT Power Relay, but I was having issues with the lighting bolt button not working that way also. its all really frustrating for me as i thought this was going to be a really nice device to use. |
I tore apart the CR-10 Control box this morning thinking there might be a sleep function to the power supply like a ATX PSU, but I don't see anything. Now I'm thinking I might be better off to just developed some scripts using the System Command Editor Plugin. I also got two in there for turning the RPi Camera on and off. but I don't know now to make the printer at the end of the printer run that script in that utility. |
I decided to stop here as it currently beyond my knowledge to get OctoPrint to talk to the IOT Power Relay. I've just ordered a TP-Link Smart plug to use with the https://github.com/jneilliii/OctoPrint-TPLinkSmartplug plugin. Thanks for your quick response and help, much appreciated. Maybe someone else can gain knowledge from these attempts. |
I'm using a IOT Power Relay ( https://dlidirect.com/products/iot-power-relay) to power my Printer (CR-10s). I have OctoPrint installed on a Raspberry Pi 2 B. I'm using GPIO Pin 40 and Ground as the Signal wire to the IOT Power Relay.
The IOT Power Relay is Version 2 which has (1) Always-ON, (1) Normally-ON & (2) Normally-OFF outlets. with a constant signal ( 3.3V or 5V DC to the signal wire, it actives the IOT Relay which reverses the power state of the outlets as listed above.)
What I would like to do is to plug the RPi into the Always-ON and the Printer into Normally-ON outlets. Then when I flip the power switch on the IOT Power Relay:
1.) The Printer and RPi will become powered.
2.) The Pi will boot with OctoPrint.
3.) The Printer will boot up as normally.
4.) Once loaded up, OctoPrint should auto connect to the Printer.
4.) If I could get the printer or RPi to beep, that would be awesome to let me know I can remote in to a local IP to start a Print, but not neccessary.
I would also like the green lighting bolt to be lit on the menu bar of OctoPrint whenever the printer is powered. If I toggle the lighting bolt, the printer should turn off with a warning window. Once a print job is done, I would also like the Printer to turn off with a small delay (say 5 mins).
The best I've been able to achieve is to plug the printer into Normally-OFF outlet as PSU Control appears to send a signal on GPIO Pin 40 and toggle the relay in the IOT Power Relay. But even using invert, I have to manually use the lightning bolt button to power up the Printer and about 60% of the time it won't let me connect as it flags a power failure. I also have to manually connect.
Any and all help is appreciated as this is driving me nuts and unfortunately this is only the second time I've ever messed with a RPi, so my knowledge is very limited. I just don't understand the settings i need to use. seems like a simple concept.
Current setup:
RPi plugged into Always-ON
Printer plugged into Normally-Off
GPIO Pin 40 and Ground wired to the IOT Power Relay signal port.
PSU Control Settings:
--General--
checkmark next to Warnings
GPIO Mode: Board
--Switching--
Switching Method: GPIO Pin
On/Off: 40, no checkmark on invert
checkmark on enable G-code commands
On G-Code: M80
Off G-Code: M81
--Sensing--
Method: Internal
--Power On Options--
No Checkmark for Auto On
Delay is 0
--Power Off Options--
No Checkmark for Auto Off
CheckMark on Disconnect on Power Off
Then under the GCODE scripts I have added:
---After print job completes---
;Wait 5 mins
G4 S300
;Turn of PowerRelay
M81
The text was updated successfully, but these errors were encountered: