-1

I want to use the "wake from halt" with my raspberry pi to keep it down must of the time and waking up using external stimuli when need. But I am not sure why, sometime it wakes up from halt although I haven't touched the gpio 6. It seems that other changes are waking up the pi. For example, I have a moisture sensor on gpio3 and if I put it in water (thus sending a 1 on gpio3) the pi wake up.

I have no idea what's wrong and any thought is welcome.

Simon C.
  • 119
  • 5
  • 1
    GPIO3 has special powers :p see https://raspberrypi.stackexchange.com/questions/22524/power-on-from-idle-with-gpio3-undocumented - though, from what I read, pulling GPIO3 **LOW** is what triggers wake from halt – Jaromanda X Mar 11 '19 at 23:11
  • 1
    I'd try a different GPIO for your humidity sensor - is that possible? – Jaromanda X Mar 11 '19 at 23:22
  • Yes I will try other GPIO for the humidity sensor thanks. And sorry I said humidity but it's moisture sensors, so it can goes low or high given if its humid or not, so whatyou say makes sens. – Simon C. Mar 12 '19 at 06:06
  • Ok so I just change gpio3 with gpio17 and it looks that you were right! no more unwanted wake up from halt! if you want to write an answer that I could accep @JaromandaX ? – Simon C. Mar 12 '19 at 06:39

1 Answers1

0

It is almost impossible to halt a Pi running Raspbian with current firmware, so "wake from halt" is meaningless. See https://raspberrypi.stackexchange.com/a/66401/8697

You can boot by pulling pin 3 low, after a shutdown - using poweroff (or similar) - I know of nothing using GPIO6.

It is always possible that a power glitch is causing the Pi to reboot.

Why do you want to shut the Pi down anyway? What are you hoping to achieve?

Milliways
  • 54,718
  • 26
  • 92
  • 182
  • `if I put it in water (thus sending a 1 on gpio3) the pi wake up` - seems like OP has determined the humidity sensor triggers the wakeup - i.e. not a power glitch – Jaromanda X Mar 11 '19 at 23:21
  • @JaromandaX it is unlikely the sensor would be causing an restart, as pin3 (SCL) is an output from the Pi if I²C is in use. I use I²C RTC on my Pi without problem. I also use DHT22 but on pin 7. There is little reason to use pin 5 as reboot, when the Pi has a dedicated reset pin (labelled RUN) - this is a hangover from the early model Pi (with 26 pin headers) – Milliways Mar 12 '19 at 00:35
  • You're assuming the sensor is i2c. I doubt it is because an i2c device does not drive scl at all – Jaromanda X Mar 12 '19 at 00:39
  • I want to halt the pi because it's battery powered and the battery is charged by a solar panel. I just need to run some script during a short period, shutting down the pi during the time I don't need it (90% of the time) will ensure that I can fully charge the battery . – Simon C. Mar 12 '19 at 06:04
  • and yes no i2c involved. And What you mena by power glitch? I don't think the pi reboot because if I stay logged in the pi stays up up until the battery fall without power. – Simon C. Mar 12 '19 at 06:10
  • @SimonC Unless you remove power the Pi continues to draw significant current (although on the Pi3B+ there is an option to put the power management chip into low power mode). The power used is little less than leaving the Pi run with no active tasks. 99.99% of users use mains power - I assume this unless the question indicates batter power, so mains glitches are a common problem. – Milliways Mar 12 '19 at 06:30
  • Pulling the RUN pin low ACTUALLY HALTs the Pi, and reduces power consumption, so this would be better than just using poweroff. – Milliways Mar 12 '19 at 06:34
  • yes I guess this is what I will actually end up doing (shuting down the pi). It was just strange that the pi was waking up without 'apparent' reasons. I wanted to try to understand what's happening. I did not get that GPIO3 was doing this too. Moving my sensor to GPIO17 fixed this. – Simon C. Mar 12 '19 at 06:46