HW watchdog

Post Reply
themoonlitknight
Posts: 10
Joined: Mon Jul 07, 2014 2:55 am
languages_spoken: english
ODROIDs: C2, C1, U3
Has thanked: 0
Been thanked: 0
Contact:

HW watchdog

Unread post by themoonlitknight » Mon Jan 14, 2019 7:36 pm

Hello, I have a Odroid C2 with Android 6.0.1. I need to use a hardware watchdog but I can't find a way to use it on Android, since all the guides (like https://wiki.odroid.com/odroid-c2/appli ... hdog_timer) refer to Linux only. I looked into /lib/modules directory and there is nothing similar to gxbb_wdt. Also there is no /dev/watchdog path.

Is it possible to activate it? How?

Thank you!

User avatar
odroid
Site Admin
Posts: 30282
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: HW watchdog

Unread post by odroid » Tue Jan 15, 2019 8:59 am

Can you build Android OS?
https://wiki.odroid.com/odroid-c2/softw ... ng_android

If yes, you can modify Kernel configuration and device-tree file to enable the WDT.

themoonlitknight
Posts: 10
Joined: Mon Jul 07, 2014 2:55 am
languages_spoken: english
ODROIDs: C2, C1, U3
Has thanked: 0
Been thanked: 0
Contact:

Re: HW watchdog

Unread post by themoonlitknight » Tue Jan 15, 2019 7:31 pm

Is it possible to build and install the kernel only, without all Android OS?

User avatar
odroid
Site Admin
Posts: 30282
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: HW watchdog

Unread post by odroid » Wed Jan 16, 2019 8:35 am

Yes, Kernel and DTB should be fine.

themoonlitknight
Posts: 10
Joined: Mon Jul 07, 2014 2:55 am
languages_spoken: english
ODROIDs: C2, C1, U3
Has thanked: 0
Been thanked: 0
Contact:

Re: HW watchdog

Unread post by themoonlitknight » Thu Jan 17, 2019 9:10 am

I compiled the kernel as specified in https://wiki.odroid.com/odroid-c2/softw ... lchain_492 for Android Marshmallow, after enabled all available wdt drivers:
dw_wdt.ko
gpio_wdt.ko
mena21_wdt.ko
softdog.ko
sp805_wdt.ko
Then I copied them onto the C2 and run

Code: Select all

insmod
for each of them.

Only with softdog I'm able to see the /dev/watchdog file, but actually it's not a hardware watchdog.

Browsing the repo for linux I saw that there exists a meson_gxbb_wdt driver which is not present for Android.

Am I missing something?

User avatar
odroid
Site Admin
Posts: 30282
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: HW watchdog

Unread post by odroid » Thu Jan 17, 2019 12:04 pm

Device tree file should be considered too.
We will check it.

User avatar
codewalker
Posts: 558
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all
Has thanked: 1 time
Been thanked: 1 time
Contact:

Re: HW watchdog

Unread post by codewalker » Thu Jan 17, 2019 7:06 pm


themoonlitknight
Posts: 10
Joined: Mon Jul 07, 2014 2:55 am
languages_spoken: english
ODROIDs: C2, C1, U3
Has thanked: 0
Been thanked: 0
Contact:

Re: HW watchdog

Unread post by themoonlitknight » Fri Jan 18, 2019 4:49 am

This is unbelievable for the following reasons:
- you made a commit in no time
- it works

Thanks to the wonderful community

User avatar
rooted
Posts: 6449
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 4 times
Been thanked: 4 times
Contact:

Re: HW watchdog

Unread post by rooted » Fri Jan 18, 2019 8:07 am

themoonlitknight wrote:This is unbelievable for the following reasons:
- you made a commit in no time
- it works

Thanks to the wonderful community
That's how we roll around here ImageImage

themoonlitknight
Posts: 10
Joined: Mon Jul 07, 2014 2:55 am
languages_spoken: english
ODROIDs: C2, C1, U3
Has thanked: 0
Been thanked: 0
Contact:

Re: HW watchdog

Unread post by themoonlitknight » Fri Jan 18, 2019 8:38 am

haha I was just surprised that I succeeded in building the kernel with the right driver at the first try :)

User avatar
codewalker
Posts: 558
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all
Has thanked: 1 time
Been thanked: 1 time
Contact:

Re: HW watchdog

Unread post by codewalker » Fri Jan 18, 2019 9:36 am

We've released a new version.
Try to update.
https://wiki.odroid.com/odroid-c2/os_im ... allow_v4.9

themoonlitknight
Posts: 10
Joined: Mon Jul 07, 2014 2:55 am
languages_spoken: english
ODROIDs: C2, C1, U3
Has thanked: 0
Been thanked: 0
Contact:

Re: HW watchdog

Unread post by themoonlitknight » Mon Feb 04, 2019 3:53 am

After I stop the watchdog process in adb shell with "stop watchdogd" the reset is not triggered. Is it normal?
Is there something else keeping it alive? It doesn't seem to respond at all to any write.
It responds to ioctl system call for WDIOC_GETSUPPORT, WDIOC_SETTIMEOUT, WDIOC_GETTIMEOUT, though.

I tried with softdog on /dev/watchdog1 and it does work as expected.

User avatar
codewalker
Posts: 558
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all
Has thanked: 1 time
Been thanked: 1 time
Contact:

Re: HW watchdog

Unread post by codewalker » Mon Feb 18, 2019 11:59 am

Hi, themoonlitknight.
I tested on Ubuntu. the reset is not triggered too.

odroid@odroid:~$ service watchdog stop
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to stop 'watchdog.service'.
Authenticating as: ,,, (odroid)
Password:
==== AUTHENTICATION COMPLETE ===
odroid@odroid:~$

themoonlitknight wrote:
Mon Feb 04, 2019 3:53 am
After I stop the watchdog process in adb shell with "stop watchdogd" the reset is not triggered. Is it normal?
Is there something else keeping it alive? It doesn't seem to respond at all to any write.
It responds to ioctl system call for WDIOC_GETSUPPORT, WDIOC_SETTIMEOUT, WDIOC_GETTIMEOUT, though.

I tried with softdog on /dev/watchdog1 and it does work as expected.

CharlesC
Posts: 13
Joined: Mon Dec 11, 2017 10:22 pm
languages_spoken: english, french
ODROIDs: C2, XU4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: HW watchdog

Unread post by CharlesC » Tue Apr 09, 2019 9:13 pm

codewalker wrote:
Fri Jan 18, 2019 9:36 am
We've released a new version.
Try to update.
https://wiki.odroid.com/odroid-c2/os_im ... allow_v4.9
Hi CodeWalker, I installed yesterday that latest Android 6 image on a C2.
We have had a lot of C2 freezing lately and i am looking for a solution.
I would like to know, does this watchdog require any configuration or it is ready and active by default?
I can see that i have the files /dev/watchdog and /dev/watchdog0 as well as a watchdogd process running.
Finally, if it is active, do you think there is a chance it detects our frozen C2 and reboot them?

Thank you.

User avatar
codewalker
Posts: 558
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all
Has thanked: 1 time
Been thanked: 1 time
Contact:

Re: HW watchdog

Unread post by codewalker » Wed Apr 10, 2019 9:33 am

Can you explain the situation when c2 was frozen.
If you have a USB-UART Module Kit, Show me the kernel log or adb logcat.

User avatar
codewalker
Posts: 558
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all
Has thanked: 1 time
Been thanked: 1 time
Contact:

Re: HW watchdog

Unread post by codewalker » Wed Apr 10, 2019 10:10 am

Do you try this?

https://wiki.odroid.com/odroid-c2/appli ... dog_daemon

Open your serial terminal or adb shell and type this.

$ echo c > /proc/sysrq-trigger

Within about 10 sec system will reboot by watchdog.

User avatar
odroid
Site Admin
Posts: 30282
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: HW watchdog

Unread post by odroid » Wed Apr 10, 2019 12:16 pm

CharlesC wrote:
Tue Apr 09, 2019 9:13 pm
We have had a lot of C2 freezing lately and i am looking for a solution.
We strongly recommend to use the DC barrel jack instead of the micro-USB with a good PSU for better system stability.
If you use the DC barrel jack for power input, you have to remove the J1 jumper.
https://wiki.odroid.com/odroid-c2/hardw ... wer_enable

CharlesC
Posts: 13
Joined: Mon Dec 11, 2017 10:22 pm
languages_spoken: english, french
ODROIDs: C2, XU4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: HW watchdog

Unread post by CharlesC » Wed Apr 10, 2019 3:08 pm

Hi, thank you for your answers.
First, I just tried that echo c > /proc/sysrq-trigger and it worked, the C2 rebooted.
We already have J1 removed and use some strong dedicated power supplies (like 5 volts, 4 amps).
We have hundreds of C2 devices, we use them to show content on elevator screens.
On them, we load a web page in the browser to simply show a static image or play a video.
From time to time they freeze, especially those that are playing videos.
On the screen we see the last thing that was displayed but everything is stopped.
The C2 become totally unresponsive, even if we try to access them through the network.
This has become a big problem for us, I hope this watchdog will help us.
Do you think the new N2 with Android 9 will be more reliable?

User avatar
odroid
Site Admin
Posts: 30282
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: HW watchdog

Unread post by odroid » Wed Apr 10, 2019 3:56 pm

We've shipped over 50,000 C2 boards to several companies who have made their own digital signage system with C2 Android from a couple of years ago.
And there was near zero complain about the stability/reliability.
I think your application must be very similar to theirs.

They just used our official 5V/2A PSU, official plastic cases, official WiFi module 3/5A, official 8GB eMMC and their own large(42~65inch) HDMI display.
Can you tell me your configuration to narrow down root causes?
Which Android OS image do you use?
Which devices do you connect to C2?
Can you trace stack/memory usage with your application via ADB debugging?

CharlesC
Posts: 13
Joined: Mon Dec 11, 2017 10:22 pm
languages_spoken: english, french
ODROIDs: C2, XU4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: HW watchdog

Unread post by CharlesC » Wed Apr 10, 2019 4:56 pm

Half our deployed C2 have your Android 5.1.1 image.
The others have your Android 6 image, but not the latest one with the hardware watchdog.
Most have your power supply, plastic case, no WIFI (they are cable connected), your 8GB eMMC and we use various HDMI displays.
Please note that when they are frozen there is no way to get anything from them, so if you want me to show you some file content it will be after they have been power cycled.
Can you tell me how to use the ADB debugging (or anything else) to get the log you want?
I use the terminal emulator that is available on your images to look at files or enter linux commands.
Keep in mind that I can only access all those C2 remotely, using Teamviewer for Android that we install on each of them.
Note: I created an Android app that monitors the CPU temperature as well as the available memory.
That app never caught a C2 with less than 200MB of memory available.
And sometimes, the freezing happens a few minutes only after a fresh reboot.
So I doubt this is a memory issue.
The other issue we have is that sometimes they don't even reboot properly when asked to, especially those with the Android 5 image.

User avatar
odroid
Site Admin
Posts: 30282
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 3 times
Been thanked: 26 times
Contact:

Re: HW watchdog

Unread post by odroid » Wed Apr 10, 2019 6:01 pm

Other members will try to help you to find a root cause in the software side.

BTW, do you share a PSU power source with C2 and HDMI display?
Please measure the voltage on 5V rail of the 40pin header with a DMM.
https://wiki.odroid.com/odroid-c2/hardw ... connectors
If it is very stable at 4.75V~5.25V in any cases, we can focus on software debugging.

User avatar
codewalker
Posts: 558
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all
Has thanked: 1 time
Been thanked: 1 time
Contact:

Re: HW watchdog

Unread post by codewalker » Wed Apr 10, 2019 6:30 pm

Please send your app if possible.

CharlesC
Posts: 13
Joined: Mon Dec 11, 2017 10:22 pm
languages_spoken: english, french
ODROIDs: C2, XU4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: HW watchdog

Unread post by CharlesC » Wed Apr 10, 2019 9:25 pm

The power supply is only used for the C2.
The HDMI displays have a different power source.
I had the voltage measured a few times and it appeared stable.
Our app is very simple, we have an HTTP server (PAW server for Android) hosting a simple HTML file.
We also have the Fully Kiosk Browser that starts at boot and loads that local html file.
In that html file we have an IMG tag with source set to a remote MJPG video stream.

User avatar
mad_ady
Posts: 5676
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 18 times
Been thanked: 18 times
Contact:

Re: HW watchdog

Unread post by mad_ady » Wed Apr 10, 2019 9:37 pm

Offtopic:
no WIFI (they are cable connected),
How do you run ethernet cable to a moving elevator?

Ontopic: Can you ping them when they're dead?
Can you attach a serial cable to a unit that dies frequently and log its serial output? You should also check temperature.
Not sure if netconsole works on the android kernel....

CharlesC
Posts: 13
Joined: Mon Dec 11, 2017 10:22 pm
languages_spoken: english, french
ODROIDs: C2, XU4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: HW watchdog

Unread post by CharlesC » Wed Apr 10, 2019 9:45 pm

Hi mad_ady, yes we have network cables in moving elevators.
Sometimes, when frozen, they can be pinged but most of the time not.
When they can be pinged it is the only thing working, no other network feature is working.
Like accessing their HTML server remotely.
The temperature was addressed, it used to be quite high (over 80 Celcius degrees) but fans were added and now they are at around 60 degrees, even less sometimes.

User avatar
mad_ady
Posts: 5676
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 18 times
Been thanked: 18 times
Contact:

Re: HW watchdog

Unread post by mad_ady » Wed Apr 10, 2019 9:52 pm

Ok, when they don't reply to ping, watchdog will help you. In the other case - it remains to be tested...

CharlesC
Posts: 13
Joined: Mon Dec 11, 2017 10:22 pm
languages_spoken: english, french
ODROIDs: C2, XU4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: HW watchdog

Unread post by CharlesC » Wed Apr 10, 2019 10:00 pm

Is there a way to know that the hardware watchdog has rebooted the system?
Is there a log of that somewhere?

User avatar
mad_ady
Posts: 5676
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 18 times
Been thanked: 18 times
Contact:

Re: HW watchdog

Unread post by mad_ady » Wed Apr 10, 2019 10:23 pm

It should say so on the serial console/netconsole. I doubt it remains in a log file. Something like "Watchdog didn't stop..."

CharlesC
Posts: 13
Joined: Mon Dec 11, 2017 10:22 pm
languages_spoken: english, french
ODROIDs: C2, XU4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: HW watchdog

Unread post by CharlesC » Wed Apr 10, 2019 10:28 pm

Unfortunately I won't be able to connect to the serial console.
As all those C2 devices are remote, installed at client sites.

CharlesC
Posts: 13
Joined: Mon Dec 11, 2017 10:22 pm
languages_spoken: english, french
ODROIDs: C2, XU4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: HW watchdog

Unread post by CharlesC » Sun Apr 14, 2019 4:42 am

I installed your latest Android 6.0.1 image with hardware watchdog on a few C2 devices in the field.
Among them is the most problematic one of them all.
I will keep you posted.
Thank you.

Post Reply

Return to “Android”

Who is online

Users browsing this forum: No registered users and 1 guest