Posts: 20
Threads: 2
Joined: Oct 2021
Reputation:
0
I bought this HAT: https://wiki.52pi.com/index.php?title=EP-0077
I used this script:
Code: #!/bin/bash
echo -e "\e[32;40mInstall package's for script. \e[0m"
sudo apt-get install -y -qq wiringpi
sudo sh -c " curl -sSL https://raw.githubusercontent.com/geeekpi/RPB-HAT/master/remoteswitch > /bin/remoteswitch "
sudo chmod a+x /bin/remoteswitch
sudo sed -i '$i sudo remoteswitch &' /etc/rc.local
echo -e '"\e[32:40m Reboot your raspberry and try to press the power button, reboot button and test it.\e[0m"'
for i in 5 4 3 2 1
do
echo -e "\e[32;40m $i second...\e[0m"
sleep 1
done
sudo sync
sudo shutdown -r now
Remote on and off works. Unfortunately, when I use the power off button in the moode interface, the system shuts down, but hat does not turn off the raspberry's power. The LEDs are on. I then have to press the button on the remote control again and only then everything goes out. After that, turning on the remote is OK. What to do to make the effect the same when:
- I press the button on the remote control
- press power off in moode
?
Posts: 6,229
Threads: 185
Joined: Apr 2018
Reputation:
251
(11-21-2022, 07:46 PM)arczar Wrote: I bought this HAT: https://wiki.52pi.com/index.php?title=EP-0077
I used this script: [deleted]
Remote on and off works. Unfortunately, when I use the power off button in the moode interface, the system shuts down, but hat does not turn off the raspberry's power. The LEDs are on. I then have to press the button on the remote control again and only then everything goes out. After that, turning on the remote is OK. What to do to make the effect the same when:
- I press the button on the remote control
- press power off in moode
?
Basically, you can't.
Both the moOde power shutdown button and the script supplied by your board vendor cause the Pi to stop running but only your board actually turns off the DC supply.
You would need some way to communicate back to the board that moOde is shutting down so the board would turn off the power and I don't see an obvious way to do that.
Regards,
Kent
Posts: 1,411
Threads: 24
Joined: Jun 2022
Reputation:
51
(11-21-2022, 08:40 PM)TheOldPresbyope Wrote: (11-21-2022, 07:46 PM)arczar Wrote: I bought this HAT: https://wiki.52pi.com/index.php?title=EP-0077
I used this script: [deleted]
Remote on and off works. Unfortunately, when I use the power off button in the moode interface, the system shuts down, but hat does not turn off the raspberry's power. The LEDs are on. I then have to press the button on the remote control again and only then everything goes out. After that, turning on the remote is OK. What to do to make the effect the same when:
- I press the button on the remote control
- press power off in moode
?
Basically, you can't.
Both the moOde power shutdown button and the script supplied by your board vendor cause the Pi to stop running but only your board actually turns off the DC supply.
You would need some way to communicate back to the board that moOde is shutting down so the board would turn off the power and I don't see an obvious way to do that.
Regards,
Kent
Hi all,
the only thing I was able to see is the following:
shutdown_signal_pin=5
...
shutdown_STATS=[color=var(--color-prettylights-syntax-string)] `gpio [color=var(--color-prettylights-syntax-constant)]read[/color] [color=var(--color-prettylights-syntax-storage-modifier-import)]${shutdown_signal_pin}[/color]`
[/color]
then... what happens? The board is monitoring at HW level if (somehow) the same gpio input goes down again, and then turns the DC off?
Just out of curiosity, cheers, Al.
Posts: 6,229
Threads: 185
Joined: Apr 2018
Reputation:
251
The vendor Wiki has neither schematic nor logic diagram for this board that I could find. That's what I mean by "I don't see an obvious way...." It could be as simple as a time-out circuit (likely) or something as complicated as a handshake-driven state machine (doubt it). Someone who has one will have to experiment.
Regards,
Kent
Posts: 1,411
Threads: 24
Joined: Jun 2022
Reputation:
51
(11-21-2022, 09:43 PM)TheOldPresbyope Wrote: The vendor Wiki has neither schematic nor logic diagram for this board that I could find. That's what I mean by "I don't see an obvious way...." It could be as simple as a time-out circuit (likely) or something as complicated as a handshake-driven state machine (doubt it). Someone who has one will have to experiment.
Regards,
Kent
Hi Kent,
yes, I was just wandering around with my brains... I think the IR turns the pin 5 on, then everything begins... can we give it a try, say, using some "gpio write(5, 1)" or similar from command line? (if there is such a call, of course)... I mean, just for fun's sake :-)
Cheers, Al.
Posts: 20
Threads: 2
Joined: Oct 2021
Reputation:
0
There used to be an overlay that could do that: https://www.msldigital.com/pages/shutdow...oode-audio
Nutul, How to apply your instructions? I can try, but I need to know what to type in the SSH TERMINAL.
Posts: 1,411
Threads: 24
Joined: Jun 2022
Reputation:
51
(11-21-2022, 09:57 PM)arczar Wrote: There used to be an overlay that could do that: https://www.msldigital.com/pages/shutdow...oode-audio
Nutul, How to apply your instructions? I can try, but I need to know what to type in the SSH TERMINAL.
Since I see the sh script is basically doing a gpio "read" on pin 5 for it to be "1", by "gpio read ${shutdown_signal_pin}" (shutdown_signal_pin being 5, as seen here: https://github.com/geeekpi/RPB-HAT/blob/...moteswitch) I was just thinking that maybe, may-be, we can just do a:
gpio write ${shutdown_signal_pin} 1
or, simply from a shell prompt
gpio write 5 1
and see what happens.
Cheers, Al.
Posts: 6,229
Threads: 185
Joined: Apr 2018
Reputation:
251
Ummm.
This pin #5 is apparently in INPUT mode since the script is reading its state (and because the table in the script’s header says the pin is “IN”). I don’t know squat about wiringpi but I’d be surprised if the gpio command automagically forces a change in a pin’s mode when you write to it.
Secondly, if pin #5 is in INPUT mode, then the HAT must be driving it, not sensing it. Not so sure I’d want to be experimenting driving in reverse using my Pi’s GPIO pins.
I was thinking of experimenting in terms of using a breadboard with switches and current-limiting resistors to see what other pins do (like that mysterious “disk status” pin called out in the parameters table in the HAT’s Wiki entry). But I’ve become cautious that way—I’m too old to be doing smoke tests like I used to.
Just my 2-cents worth. If I’m wrong, it wouldn’t be the first time
Regards,
Kent
Posts: 1,553
Threads: 107
Joined: Mar 2018
Reputation:
74
Quote:I’m too old to be doing smoke tests like I used to.
Kent, I thought it was legal in most states now :-)
----------
bob
Posts: 1,411
Threads: 24
Joined: Jun 2022
Reputation:
51
(11-22-2022, 05:26 AM)TheOldPresbyope Wrote: Ummm.
This pin #5 is apparently in INPUT mode since the script is reading its state (and because the table in the script’s header says the pin is “IN”). I don’t know squat about wiringpi but I’d be surprised if the gpio command automagically forces a change in a pin’s mode when you write to it.
Secondly, if pin #5 is in INPUT mode, then the HAT must be driving it, not sensing it. Not so sure I’d want to be experimenting driving in reverse using my Pi’s GPIO pins.
I was thinking of experimenting in terms of using a breadboard with switches and current-limiting resistors to see what other pins do (like that mysterious “disk status” pin called out in the parameters table in the HAT’s Wiki entry). But I’ve become cautious that way—I’m too old to be doing smoke tests like I used to.
Just my 2-cents worth. If I’m wrong, it wouldn’t be the first time
Regards,
Kent
This is what I have been looking into, too... but my lack of understanding HOW gpio pins got their status changed forced my (old 'n' grumpy) neurons to suggest some naughty "shit" and see what could happen.
But then again, if the power enters the hat board, and through it reaches the PI... well, indeed we might be extremely out-of-luck.
Cheers, Al.
|