Super Watchdog Interrupt

alexburcea

Moderator
Staff member
Hi Tony,

I was looking at the WDT and I realize that is a little problem with the interrupt, is a hardware problem because the card keeps the interrupt pin low even if the interrupt is enabled or not. The workaround for this is to add about 2k pull-up to 3.3V and the pin is copy the button state.

The "pbe" is created for safe shutdown and then power only if the button is pressed again so the flow should look like this:
1) enable the button "wdt -pbe 1"
2) Wait for button to be pressed reading periodically the status "wdt -g pbs"
3) if the button is pressed change the off period to a higher number "wdt -off 10000"
4) set the period so the raspberry have te time to shutdown "wdt -p 120"
5) issue a shutdown command "sudo shutdown now"
6) The raspberry will be powered off.
7) The raspberry will be powered on again if the button is pressed again or if the off interval is passed.

This is the functionality requested by a client so he can turn off his raspberry by pushing the button and turn it back on when push the button again.
 

alexburcea

Moderator
Staff member
Do you mean that the LCD is not releasing the interrupt pin?
PS: Please update the watchdog firmware and add a 2k pullup resistor on the interrupt pin.
 

TonyD

Member
H Alex
Yes the LCD card is not releasing the Interrupt

I had updated the watchdog from github & carried out testing of the VER 9 WDT card & all was working great before your last forum post above
I have now updated the WDT card with the update64 program & now the WDT card python interrupt script routine is now broken & does not work.
How do i get back to the previous firmware revision that was on the card when delivered

Tony
 

alexburcea

Moderator
Staff member
I could roll back the version on the server but the firmware is not the problem but the leakage current on that interrupt pin. Please add a pull-up resistor on the int pin and if is not working I will rollback the firmware.
 

TonyD

Member
hi Alex
just tried the help from command line
wdt -g bint I get error Fail to read reg
getting errors from wdt -g

Can i go back to the previous ver firmware

Tony
 

TonyD

Member
i will have to dig around for a resistor if i have one otherwise i will have to order some from jaycar snail mail cause is 8hr round trip to get a resistor

The Ver 9 firmware was working great till i updated the firmware now broken
 

alexburcea

Moderator
Staff member
I have been playing all day with this firmware version and not getting any problems but I roll back to the previous version, do the update again and you will have the older version
 

TonyD

Member
giday Alex
i have rolled back the firmware & am still having command line errors example wdt -g bint "Fail to select mem add" please help getting frustrated
am probably doing something wrong Please note am running 64 bit RPI
Cheers tony
 

TonyD

Member
Hi Tony,

I was looking at the WDT and I realize that is a little problem with the interrupt, is a hardware problem because the card keeps the interrupt pin low even if the interrupt is enabled or not. The workaround for this is to add about 2k pull-up to 3.3V and the pin is copy the button state.

The "pbe" is created for safe shutdown and then power only if the button is pressed again so the flow should look like this:
1) enable the button "wdt -pbe 1"
2) Wait for button to be pressed reading periodically the status "wdt -g pbs"
3) if the button is pressed change the off period to a higher number "wdt -off 10000"
4) set the period so the raspberry have te time to shutdown "wdt -p 120"
5) issue a shutdown command "sudo shutdown now"
6) The raspberry will be powered off.
7) The raspberry will be powered on again if the button is pressed again or if the off interval is passed.

This is the functionality requested by a client so he can turn off his raspberry by pushing the button and turn it back on when push the button again.
H Alex yes i am doing something very similar from python but using interrupt from the LCD & WDT cards rather than constantly polling the buttons on both cards. From the LCD when the interrupt is working any button push or Rotary nob turn will generate an interrupt then i just check the interrupt routine if the LCD or the WDT caused the interrupt

Tony
 

TonyD

Member
Alex the roll back of firmware is not working have tried several time & the WDT card is returning errors from command line

pi@Rpi-5:~/wdt-rpi/update $ wdt -g d
Fail to select mem add
pi@Rpi-5:~/wdt-rpi/update $

Your thoughts
Packing up for the day will try again tomorrow
 

alexburcea

Moderator
Staff member
Sorry, but now the firmware has rolled back on the server, my SSH tool did some funny things..
Please update the wdt command because now you can read the firmware version, now you should have 4.1 and after the update, you should have back the 4.0.
 

TonyD

Member
Giday Alex
Well saw your reply just before packing up
1 Rebooted from scratch power off to on
2 new clean install from scratch github download
3 Update firmware light flashing when updating card
4 when complete command line -g bint working correctly & interrupt python script working correctly
I have include the python test script for your info have commented out the LCD cause the LCD is not on this RPI but on the production system

One thing i did notice with the python script if the WDT interrupt is enabled from command line & we try to disable the interrupt from python script this has no effect & the Interrupt is persistent because is written t memory from command line. was wondering if this could be enabled so can be made persistent from python as well & then disabled from python, this is just a thought

Interrupt is working fine now from the WDT card. not this is the only card on the test pi5. Question will the WDT v9.0 card still require the 2k pull up resistor

Cheers Tony
Looking forward to the LCD interrupt working
 

Attachments

  • Interrupt.txt
    4.4 KB · Views: 1

alexburcea

Moderator
Staff member
Thanks for the update. Did you test the card after repowering with the new firmware version? I am puzzled here because mine is working and I have to release this version because fixes the RTC bug.
You could measure the voltage on the interrupt pin (on my RPI5 stays at about 1.3V which is not good) and if is close to 3.3V it will not require the pull-up resistor.
I will check the Python function for the interrupt, it must behave the same as the command line.
 

TonyD

Member
i have tested the card thoroughly from python & all works great appears also that enabling the Interrupt from python & the disabling interrupts from python on exit works all as expected & the interrupt is not persistent which is what i was expecting,
I will test voltages to morrow eyes starting to get sore going to bed shortly. Below is the version wdt iam running

pi@Rpi-5:~ $ wdt -v
Watchdog Control Software ver 2.05
Copyright (c) 2016-2023 Sequent Microsystems

pi@Rpi-5:~ $

Talk more tomorrow & will check voltages
 

TonyD

Member
Giday Alex
Good Morning with a clearer head
OK testing so far today with WDT v9.0
1) git pull # this updated my RPI
2) sudo make install #this compiled OK
3) sudo python setup.py install # this installed the WDT python libraries
4) wdt -g fv returns 4.0

Ran my Python interrupt.py script # Interrupt routine works as expected & python Enable/Disable of interrupt "bint" works like command line

Now to find oscilloscope & check voltage on RPi interrupt line

Will get back to you with interrupt pin voltage
have included a revised python interrupt.py test routine for your info

Regards Tony

" EDIT additional Testing "
Giday Again Alex
Carried out interrupt line testing with Oscilloscope RPi5 64bit RPi OS pin37 GPIO26 sits at 3.36V & a interrupt pulls this line down to 40mv
all appears to be functioning correctly as far as i can see the WDT card V9.0 & firmware 4.0 & Watchdog Control Software ver 2.05 is functioning with out any problems using interrupt from WDT card. Debounce also appears to be good & super clean.

At present iam unable to test the new V9.0 WDT card with my production system that has the LCD card attached to it. I have to schedule some down time to retrieve the LCD card & try the interrupts from both LCD & NEW WDT V9.0 card together on my spare rpi5.

I have carried out 250 interrupts from the button on the WDT v9.0 card without any problems

If you have a LCD card on your test bench are you able to test the 2 cards together using my latest Interrupt test routine as all you need to do is uncomment a couple of line for the LCD drivers

AS always thankyou for the assistance you give this is much appreciated.

Regards Tony
 

Attachments

  • interrupt.txt
    4.8 KB · Views: 2
Last edited:

TonyD

Member
Giday Alex

This is what i carried out earlier today & all was functioning

Giday Again Alex
Carried out interrupt line testing with Oscilloscope RPi5 64bit RPi OS pin37 GPIO26 sits at 3.36V & a interrupt pulls this line down to 40mv
all appears to be functioning correctly as far as i can see the WDT card V9.0 & firmware 4.0 & Watchdog Control Software ver 2.05 is functioning with out any problems using interrupt from WDT card. Debounce also appears to be good & super clean.

At present iam unable to test the new V9.0 WDT card with my production system that has the LCD card attached to it. I have to schedule some down time to retrieve the LCD card & try the interrupts from both LCD & NEW WDT V9.0 card together on my spare rpi5.

I have carried out 250 interrupts from the button on the WDT v9.0 card without any problems

If you have a LCD card on your test bench are you able to test the 2 cards together using my latest Interrupt test routine as all you need to do is uncomment a couple of line for the LCD drivers

AS always thankyou for the assistance you give this is much appreciated.

The Above all worked

I then did a git pull & nothing was updated
I then did a make install No errors don't think anything was compiled either
i the move to Update directory & issued command Updat64
answered yes & the firmware was update to the V9.0 card

After this repowered RPI
if issue command
wdt -h works
wdt -h -g works
wdt -g fv i get Fail to select mem add
I get this error for any command line command i issue
I tried running my python interrupt test script & it returns -1 & does not function

so i then did a fresh down load from Git
then a fresh make
then a fresh python install libraries
Tried running python script same problem -1 & does not function

I do not know what version firmware i downloaded this morning but it doesn't work where the Firmware i downloaded late yesterday function beautifully

Will be great when this is all functioning
I await your earliest replay
Cheers Tony
 

alexburcea

Moderator
Staff member
Tony

After you updated the card I recompile the V4.0 with the RTC problem fixed, all sims to work properly on my side so I made it 4.1 and uploaded on the server.
Is frustrating that v4.1 works on my lab and does not work on your setup....
I think I have a clue, I reuploaded the V4.1 again with some changes, could you please give it a try and re-update the firmware on your card?
 

TonyD

Member
Giday Alex
Updated only the Firmware update64
Have not rebooted

pi@Rpi-5:~/wdt-rpi/update $ wdt -g fv
Fail to read reg
pi@Rpi-5:~/wdt-rpi/update $

This is the error i get after updating the Firmware
Do i need to do a fresh install from Git

Tony
 
Top