Re: [Emc-users] Graceful pi shutdown, power off

2022-02-20 Thread Chris Albertson
I think you already have what you need. "shutdown -h now" does not immediately power down the system. It sends a "SIGTERM" signal to each process, waits then unmounts the file system then halts. If your software had a "SIGTERM" signal handler then it could ask if you want to save data.

Re: [Emc-users] Graceful pi shutdown, power off

2022-02-20 Thread Thaddeus Waldner
I got this put together. https://youtu.be/tKHrTkvBHCg One lingering question (for now). The shutdown script calls “sudo shutdown -h now” I’d like something a bit softer. For example, if there’s an unsaved change in an open program, the program should be able to interrupt the shutdown. What

Re: [Emc-users] Graceful pi shutdown, power off

2022-02-16 Thread Thaddeus Waldner
I think I may have found a simple solution. According to the discussion here: https://forums.raspberrypi.com/viewtopic.php?t=254875 The pi can be configured to turn off the 3.3v power when shut down. This is not configured by default as

Re: [Emc-users] Graceful pi shutdown, power off

2022-02-16 Thread Chris Albertson
The shut off needs to have a delay otherwise you are killing the power in a running system. The delay gives the OS time to do an actual shutdown. On Wed, Feb 16, 2022 at 10:38 AM Roland Jollivet wrote: > On Wed, 16 Feb 2022 at 16:17, Thaddeus Waldner wrote: > > > > Just use a simple 10A

[Emc-users] Graceful pi shutdown, power off

2022-02-16 Thread Roland Jollivet
On Wed, 16 Feb 2022 at 16:17, Thaddeus Waldner wrote: > > Just use a simple 10A relay with 5V coil > > As a latch, you press a button to power up, ie power the coil, then the > > same line gets dropped by the Pi to power off.. > > How does the pi drop the 5v line after shutting down? The

Re: [Emc-users] Graceful pi shutdown, power off

2022-02-16 Thread Chris Albertson
Sory I was too lazy to look up the correct number. So to power down the Pi, you place a scrip in Run Level 0. That sends a command over some link to you power controller to turn off the power to the motors "now" and to the Pi in about 1 minute. The power controller does this then goes into a

Re: [Emc-users] Graceful pi shutdown, power off

2022-02-16 Thread John Dammeyer
Chris Albertson [mailto:albertson.ch...@gmail.com] > Sent: February-16-22 9:09 AM > To: Enhanced Machine Controller (EMC) > Subject: Re: [Emc-users] Graceful pi shutdown, power off > > This is the problem with an instant acting switch. The pi gets one if the > GPIO pins low and th

Re: [Emc-users] Graceful pi shutdown, power off

2022-02-16 Thread Mark Wendt
Runlevel 6 on Unix/Linux systems is a reboot. Runlevel 0 is a shutdown. Using either the init or telinit scripts as superuser will get you to your desired runlevel. Running init 6 as root or superuser will reboot your system. Running init 0 as root or superuser will shut your system down. There

Re: [Emc-users] Graceful pi shutdown, power off

2022-02-16 Thread Chris Albertson
This is the problem with an instant acting switch. The pi gets one if the GPIO pins low and the replay opens, shutting down power but then the power is removed before the OS shuts down potentially corrupting storage. I think the only solution is the solution that every modern electronic device

Re: [Emc-users] Graceful pi shutdown, power off

2022-02-16 Thread Thaddeus Waldner
> Just use a simple 10A relay with 5V coil > As a latch, you press a button to power up, ie power the coil, then the > same line gets dropped by the Pi to power off.. How does the pi drop the 5v line after shutting down? ___ Emc-users mailing list

[Emc-users] Graceful pi shutdown, power off

2022-02-16 Thread Roland Jollivet
Just use a simple 10A relay with 5V coil As a latch, you press a button to power up, ie power the coil, then the same line gets dropped by the Pi to power off.. https://www.digikey.co.za/en/products/detail/omron-electronics-inc-emc-div/G5Q-1A4-DC5/1815721 On Wed, 16 Feb 2022 at 00:00, Thaddeus

Re: [Emc-users] Graceful pi shutdown, power off

2022-02-15 Thread Thaddeus Waldner
> Youu need a human to somehow > kick-start the process. But it should be automated after that. Of course > the computer *can* turn itself off. > > I've managed to put the "on" button on a phone or indoor PC. > … This is the part that won’t work. The machine is small enough to pick up and

Re: [Emc-users] Graceful pi shutdown, power off

2022-02-15 Thread Chris Albertson
What? You have a wall outlet to power the mill. There is obviously power in the wall output. The switch uses just a few milliwatts. This does work. I've got several of these little switches. Of course the computer can not use WiFi to turn itself on. You need a human to somehow kick-start

Re: [Emc-users] Graceful pi shutdown, power off

2022-02-15 Thread Thaddeus Waldner
Thanks for all the ideas. I don’t think a WiFi solution will work because I want to completely power down the system. There’s not too much power, as I would only need to switch the control power; all the high power circuits need only be switched through their respective relays. One other

Re: [Emc-users] Graceful pi shutdown, power off

2022-02-15 Thread gene heskett
On Tuesday, February 15, 2022 11:10:30 AM EST Greg Bernard wrote: > Perhaps this is what you're looking for? > http://www.mosaic-industries.com/embedded-systems/microcontroller-proje > cts/raspberry-pi/on-off-power-controller Sweet, the perfect companion to my idea. Bookmarked for future

Re: [Emc-users] Graceful pi shutdown, power off

2022-02-15 Thread dave engvall
Those 'smart sockets' can be really handy. I use one to control the startup of my 3 phase rotary converter. That way I can be in the shop and only have the converter running when I need 3 phase. In the house is a manual lockout switch for times when I know I won't need 3 phase. Dave On

Re: [Emc-users] Graceful pi shutdown, power off

2022-02-15 Thread Chris Albertson
How much power does your system use? If it can be powered from a normal 120 volt AC then you can buy a "Smart Outlet" that switches the 120V by WiFi, cost about $10 or $15. The Pi then can turn off or on any AC mains powered device. They sell these on Amazon or at Home Depot. You can buy

Re: [Emc-users] Graceful pi shutdown, power off

2022-02-15 Thread Jérémie Tarot
Le mar. 15 févr. 2022 à 17:13, Greg Bernard a écrit : > Perhaps this is what you're looking for? > > http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/raspberry-pi/on-off-power-controller I'm almost sure I've already seen ready made modules, also with UPS features

Re: [Emc-users] Graceful pi shutdown, power off

2022-02-15 Thread Greg Bernard
Perhaps this is what you're looking for? http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/raspberry-pi/on-off-power-controller On Tue, Feb 15, 2022 at 8:28 AM Thaddeus Waldner wrote: > On a small cnc machine run by a raspberry pi, I’d like to set up the main > power

Re: [Emc-users] Graceful pi shutdown, power off

2022-02-15 Thread gene heskett
On Tuesday, February 15, 2022 9:23:34 AM EST Thaddeus Waldner wrote: > On a small cnc machine run by a raspberry pi, I’d like to set up the > main power to accomplish the following: > > 1)pressing the power button/flipping the switch turns on the machine > > 2) pressing the off button, the pi

[Emc-users] Graceful pi shutdown, power off

2022-02-15 Thread Thaddeus Waldner
On a small cnc machine run by a raspberry pi, I’d like to set up the main power to accomplish the following: 1)pressing the power button/flipping the switch turns on the machine 2) pressing the off button, the pi should first perform a shutdown then turn off the main power to all control power