Qwalcon Posted July 27, 2019 Posted July 27, 2019 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?
Igor Posted July 27, 2019 Posted July 27, 2019 2 hours ago, Qwalcon said: if this question very simple It is not simple. https://forum.armbian.com/search/?q=ar100&fromCSE=1
Qwalcon Posted July 27, 2019 Author Posted July 27, 2019 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> Where on the boad the port PL03?
martinayotte Posted July 27, 2019 Posted July 27, 2019 1 hour ago, Qwalcon said: Where on the boad the port PL03? Looking at schematic, PL3 is been pulled up by R16 resistor bottom side near debug header. 1
lxde-OSIREN Posted July 27, 2019 Posted July 27, 2019 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 1
Qwalcon Posted July 27, 2019 Author Posted July 27, 2019 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?
Qwalcon Posted July 27, 2019 Author Posted July 27, 2019 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?
martinayotte Posted July 28, 2019 Posted July 28, 2019 15 hours ago, Qwalcon said: R16 need to connect to GND or 3.3V? GND ! 15 hours ago, Qwalcon said: And 1 green or red 2 the part of R16 will be connected? According to voltage measured, it should be the green side ... 1
Qwalcon Posted July 29, 2019 Author Posted July 29, 2019 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?
martinayotte Posted July 29, 2019 Posted July 29, 2019 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 ? 1
Qwalcon Posted July 29, 2019 Author Posted July 29, 2019 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?
lxde-OSIREN Posted July 29, 2019 Posted July 29, 2019 its autologin no pw, its a desktop img, the other command line ones are probably faster boot for ssh but you can always use default: user: root pw: orangepi 1
martinayotte Posted July 30, 2019 Posted July 30, 2019 16 hours ago, Qwalcon said: I mean prevent double click on the button (look at image above) I still not understand : since the button is a "wakeup" button, why do you need to "prevent double click" ? 1
Qwalcon Posted July 30, 2019 Author Posted July 30, 2019 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?
Qwalcon Posted July 30, 2019 Author Posted July 30, 2019 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
martinayotte Posted July 30, 2019 Posted July 30, 2019 46 minutes ago, Qwalcon said: the OPiZero will sleep again or shutdown? I don't know, I've never tried such feature since I'm running Mainline ...
lxde-OSIREN Posted July 30, 2019 Posted July 30, 2019 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.
Qwalcon Posted July 31, 2019 Author Posted July 31, 2019 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); }
Qwalcon Posted July 31, 2019 Author Posted July 31, 2019 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
lxde-OSIREN Posted July 31, 2019 Posted July 31, 2019 yes that should work if what your button does is wake it up, the ebay link just leave the chip in the usb port for the power on and the other digital pin soldered to the orange pi button with 1 wire.
Recommended Posts