Jump to content

How to return Orange Pi Zero from power saving mode?


Qwalcon

Recommended Posts

Hello all!
Hardware: Orange Pi Zero
OS: Armbian 5.91 Orangepizero Debian buster next 4.19.59

First of all sorry, if this question very simple but I didn't find solution.

I'm going to turn on sleep mode:

echo mem > /sys/power/state


Working but I can not wakeup system becouse OrangePi Zero don't have power on - button by default.

Is it posible wake orange pi zero from sleep mode?

Could you offer some advice how to (wake up) return device from power saving mode, please?

Link to comment
Share on other sites

Thank you so much for your responce.
 

I swaped OS to Armbian 5.59 Orangepizero Ubuntu xenial default 3.4.113

mkdir ~/fex/
bin2fex /boot/script.bin  ~/fex/script.fex
cat ~/fex/script.fex |less

 

Quote

[wakeup_src_para]
cpu_en = 0
cpu_freq = 48
pll_ratio = 273
dram_selfresh_en = 1
dram_freq = 36
wakeup_src0 =
wakeup_src_wl = port:PG10<4><default><default><0>
wakeup_src_bt = port:PL03<6><default><default><0>


Orange-Pi-Zero-Pinout.jpg
Where on the boad the port PL03?

Link to comment
Share on other sites

Thank you for answers.
 

1 hour ago, ftp-bin2fex said:

did you solve your sleep issue yet?

not yet, I'm trying figure out what kind of pin need to connect to PL03.
R16 need to connect to GND or 3.3V?
And 1 green or red 2 the part of R16 will be connected?

orangepizero_bottom.jpg

Link to comment
Share on other sites

Goals:
1) if device "sleep" ( echo mem > /sys/power/state ) after click on the button the device will be "wake up".
2) if device "non sleep" after click on the button to do nothing.
Is it possible to reach?

Link to comment
Share on other sites

23 hours ago, martinayotte said:

it should be the green side ... 


tryied to connected to green side but nothing.
I think you mean red side becouse the right side of the image rotaited.
Look like the system wake up after connected to red side.
After checked uptime I saw it was a reset not wake up.
After connected GND to red side of R16 again the system rebooted.
 

On 7/27/2019 at 9:13 PM, Qwalcon said:

if device "non sleep" after click on the button to do nothing.


Because I want to prevent double click to button.
How to prevent double click on the button?
It is possible wake up the system not reset?

Link to comment
Share on other sites

59 minutes ago, Qwalcon said:

I think you mean red side becouse the right side of the image rotaited.

No ! I was considering the orientation and the R16 label itself.

59 minutes ago, Qwalcon said:

Look like the system wake up after connected to red side.
After checked uptime I saw it was a reset not wake up.

That is probably caused by a short of the VCC-RTC to GND, which can harm/damage your board.

 

59 minutes ago, Qwalcon said:

How to prevent double click on the button?

What do you mean by double click ?

Link to comment
Share on other sites

orange_pi_zero_wake_up_button.jpg.b3a662a5ddc1180346ffbab2a6db5f4e.jpg
 

7 hours ago, martinayotte said:

What do you mean by double click ? 

I mean prevent double click on the button (look at image above)
I am going to check on different version of the operating system.

On 7/27/2019 at 7:58 PM, ftp-bin2fex said:

keep my custom orange pi zero h2 18sec boot to desktop img, all popup error windows/crash windows disabled, did you solve your sleep issue yet?:

 

http://skyizo.com/deb8_18sec_boot.img

ftp-bin2fex, please, remind me what are the login and the password for connect via ssh?

Link to comment
Share on other sites

6 hours ago, martinayotte said:

I still not understand : since the button is a "wakeup" button, why do you need to "prevent double click" ?

I will try explain what I mean:
A OPiZero is sleeping. Pressed a button for wake up the OPiZero.
The OPiZero wake up.
If pressed a button again when the OPiZero running what happeds:
the OPiZero will sleep again or shutdown?

 

Link to comment
Share on other sites

I checked on older versions of operating system and I tryied many times it was worked but not every times.

Explain what I mean:
echo mem > /sys/power/state
press button then system wake up.

Runned again echo mem > /sys/power/state
press button and nothing happens

Link to comment
Share on other sites

it can be done by programming this small microcontroller to send the button pin a voltage periodically: https://www.ebay.com/itm/10Pcs-Digispark-Kickstarter-ATTINY85-Arduino-General-Micro-USB-Development-Board/293002153078?ssPageName=STRK%3AMEBIDX%3AIT&var=591803336110&_trksid=p2057872.m2749.l2649

 

but that would be a last option for some if the wakeup can be done all programmatically in a shell script and you don't need to buy anything, but I don't write that much shell script so if it were me id send it the voltage with the usb sized chip above.

Link to comment
Share on other sites

19 hours ago, ftp-bin2fex said:

it can be done by programming this small microcontroller to send the button pin a voltage periodically: https://www.ebay.com/itm/10Pcs-Digispark-Kickstarter-ATTINY85-Arduino-General-Micro-USB-Development-Board/293002153078?ssPageName=STRK%3AMEBIDX%3AIT&var=591803336110&_trksid=p2057872.m2749.l2649

 

but that would be a last option for some if the wakeup can be done all programmatically in a shell script and you don't need to buy anything, but I don't write that much shell script so if it were me id send it the voltage with the usb sized chip above.

Do you mean something like this:

https://github.com/MCUdude/MicroCore
 

#define BUTTON_PIN  3
#define CTRL_PIN    5
#define POWER_PIN   2

void setup() { 
  pinMode(BUTTON_PIN, INPUT_PULLUP);
  pinMode(CTRL_PIN, INPUT_PULLUP);
  pinMode(POWER_PIN, OUTPUT);
  digitalWrite(POWER_PIN, LOW);  
  attachInterrupt(BUTTON_PIN, poweron, RISING);
  attachInterrupt(CTRL_PIN, poweroff, RISING);
}

void loop() {}

unsigned int microsFunc(){ return micros(); }

void delayMic(unsigned int waitTime){
  unsigned int stat = microsFunc();
  while( microsFunc() - stat < waitTime ){}
}

void poweroff() {
  delayMic(60000000);//delay one minute
  digitalWrite(POWER_PIN, LOW);
}

void poweron() {
  digitalWrite(POWER_PIN, HIGH);
}


opizero_power_control_attity.png.b066a1bf01194ea988c7907ce9788822.png

Link to comment
Share on other sites

For power on: click to the button.
For turn off: the Orange Pi Zero the GPIO 10 pin connect to the attiny pin 5.

sudo echo "10" > /sys/class/gpio/export && \
sudo echo "out" > /sys/class/gpio/gpio10/direction && \
sudo echo "1" > /sys/class/gpio/gpio10/value && \
sudo shutdown -h

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines