ef-gy / rpi-ups-pico

Raspberry Pi UPS PIco control daemons.
https://ef.gy/documentation/rpi-ups-pico
MIT License
9 stars 2 forks source link

picod fails with firmware 0x30 #11

Open renne opened 7 years ago

renne commented 7 years ago

When picod is started it immediately runs the shutdown command with firmware 0x30. Have a look at my ASH-script for order of GPIO operations and debounce time.

EffinMaggie commented 7 years ago

This is actually slightly odd, as picod-2 specifically checks if it ever saw a HIGH before considering a LOW condition to initiate the shutdown. Did they swap around the pinout and this is now an entirely different pin? It looks like the pin assignment is the same in that script...

renne commented 7 years ago

From the release-notes of the firmware: 2. Improved the Powering Falling Edge Recognition algorithm and 7. Improved the de-bouncing filter on the ISR of the pulse train input recognition

In my understanding GPIO 27 supplies a clock-signal. On the falling edge of GPIO 27 the watchdog expects a inversion of high/low on GPIO 22. For the loop I took over the 300ms of the original Python-script. Alternatively it should be possible to use Interrupt Service Routines with WiringPi on GPIO 27.

EffinMaggie commented 7 years ago

Oh wow, that's a pretty significant change. The original just required the host to provide a pulse train with an arbitrary modulation; in fact, that's pretty much the opposite behavior, as it seemed the old Pico was requiring the host to provide that as its clock signal, not the other way around.

I'll try to wire this up with a flag and see if I can't find a spec sheet somewhere that has an explanation of figuring out which version of the Pico we need...

renne commented 7 years ago

From I²C UPS PIco Programmers Registers:

i2cget -y 1 0x69 0x24 b returns PCB revision i2cget -y 1 0x69 0x25 b returns bootloader version i2cget -y 1 0x69 0x26 b returns firmware version

renne commented 7 years ago

What's the current state?

pvgennip commented 7 years ago

I am experiencing the same problem, that as soon as I run picod with the HV3.0 (with new fw) my Pi shuts down. An update that is compatible with both versions of the Pico fw, would be great!

EffinMaggie commented 7 years ago

I think I'll need to order some hardware for that, but the usual stores I get that stuff from aren't carrying the new hardware. I'll try again and see if it's in stock now.

Unless someone else wants to hack at that main loop? :)

renne commented 7 years ago

Rasppishop Heise Shop

EffinMaggie commented 7 years ago

I live in Ireland, and I'd prefer to grab that at a local store, what with shipping and all.

If I can't find it here by EoM I'll order it abroad, but I really do wanna support the local store if they get it in before then :).