App GpioShutdownService for C2

Moderators: mdrjr, odroid

Re: App GpioShutdownService for C2

Unread postby joerg » Fri Jul 29, 2016 6:04 am

I would try it tomorrow and let you know.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby joerg » Sat Jul 30, 2016 4:36 am

@danhans42
Yes, I checked it now, it works.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby TrippleAAA » Sun Sep 04, 2016 10:40 pm

Joerg did a good job, and the GPIO Shutdown Service is a good solution, but if you want an easier solution without soldering something, maybe you are lucky to find this one:

viewtopic.php?f=137&t=22581&p=153066#p153066

With this easy to use solution you can shutdown and boot the Odroid C2 safely, and you get an easy to use Android App Service to set the shutdown delay times.

Hint: First Joerg has forbidden me to post this solution in his thread, but I thought about it and think nobody should forbid anyone to leave a hint to an easier or better solution.
TrippleAAA
 
Posts: 237
Joined: Mon Jun 13, 2016 4:57 am
languages_spoken: english

Re: App GpioShutdownService for C2

Unread postby joerg » Mon Sep 05, 2016 3:15 am

It appears odd to me, if it is called forbidden, that was a friendly question to remove a post, that was in form of unacceptable hijacking. And not understandable the intention of this, who everything reads should assume that the user has already finalized his project.

I lock this thread now. Only to ban a inexpressibly discussion. All users who like my support can send me a pm or better open their own thread. I am nearly daily here in forum to look what's going on.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby joerg » Wed Mar 15, 2017 4:40 am

New version can be found in first post.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby poptmartone » Tue May 23, 2017 2:44 am

Many thanks joerg, a UI is a great improvement for your service. Without this useful service I couldn't think an easiest way to control the shutdown of my odroid C2 in my home made car infotainment system (actually a work in progress).

Just a request, is it possible to switch the holdpower status pin to LOW just after the complete shutdown and not immediately after the shutdown input? It would be great and, in my case, would help me in having a correct trigger for shutdown the power supply after the system really complete the safe shutdown procedure.

Anyway, thanks a lot!
poptmartone
 
Posts: 52
Joined: Wed Aug 03, 2016 10:39 pm
languages_spoken: english italian
ODROIDs: ODROID C2

Re: App GpioShutdownService for C2

Unread postby joerg » Tue May 23, 2017 5:16 am

I need to check this, it will take a while.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby poptmartone » Tue May 23, 2017 4:18 pm

You're great :)
poptmartone
 
Posts: 52
Joined: Wed Aug 03, 2016 10:39 pm
languages_spoken: english italian
ODROIDs: ODROID C2

Re: App GpioShutdownService for C2

Unread postby joerg » Tue May 23, 2017 9:32 pm

Thank you. Unfortunately can't find a solution for that. The app writes the gpio if the delay of shutdown is reached, eg. I tried with 6 seconds and gpio 23 (pin.33). After triggering the shutdown and 6 seconds later the gpio is written from high to low. If you use another pin eg. gpio 2 (pin.13), it stays for 200ms (C1 Lollipop) or 800ms (C2 Marshmallow) to low and then returns to high. This cannot be controlled as the whole system is halted and all the gpio return to init state. Maybe you can use the return of the gpio to high state as indication that the shutdown process is terminated. If you like show here a diagram of your solution.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby poptmartone » Tue May 23, 2017 10:11 pm

Ok, I'll try it this weekend, however thanks for your time and interesting. :D
I'll share my diagram as soon as possible...
poptmartone
 
Posts: 52
Joined: Wed Aug 03, 2016 10:39 pm
languages_spoken: english italian
ODROIDs: ODROID C2

Re: App GpioShutdownService for C2

Unread postby InspecteurGadget » Mon Jun 12, 2017 11:22 pm

Hello in your app you can
Replace reboot or shutdown by a Keyevent input 114 or 115 for volume up/down?
Can you share your code for apk please
InspecteurGadget
 
Posts: 68
Joined: Thu Apr 27, 2017 3:33 am
languages_spoken: French, English
ODROIDs: Odroid C2
USB GPS, Bluetooth, Wifi
Emmc 8g Android M
Rtc modue

Re: App GpioShutdownService for C2

Unread postby joerg » Tue Jun 13, 2017 4:09 am

@InspecteurGadget
I already had the plan to integrate more functionality. Uploaded a version with that one can make two extra actions on gpio event. It's in the first post. You can go to settings and define the two gpio and two actions as: input keyevent 24. It does repeat the action every 1 second if the gpio stays switched.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby InspecteurGadget » Tue Jun 13, 2017 1:31 pm

Oh hey thanks =)
Can I connect a push switch directly without strength?
And I do connect GPIO pin with a GND or 3.3V?

I found my answer
+ "GPIO97 aka GPIOX.BIT0 aka Pin 35: short by resistor 2k to GND triggers ....."
InspecteurGadget
 
Posts: 68
Joined: Thu Apr 27, 2017 3:33 am
languages_spoken: French, English
ODROIDs: Odroid C2
USB GPS, Bluetooth, Wifi
Emmc 8g Android M
Rtc modue

Re: App GpioShutdownService for C2

Unread postby InspecteurGadget » Wed Jun 14, 2017 12:32 am

Can't open app,
Application has stopped
InspecteurGadget
 
Posts: 68
Joined: Thu Apr 27, 2017 3:33 am
languages_spoken: French, English
ODROIDs: Odroid C2
USB GPS, Bluetooth, Wifi
Emmc 8g Android M
Rtc modue

Re: App GpioShutdownService for C2

Unread postby joerg » Wed Jun 14, 2017 1:14 am

Please make a log as: logcat|grep com.jw.gpioshutdown and tell me the settings you made.
BTW. You can connect also without resistor, if you really know and you are sure that the pin is configured as input. I wrote this to use a resistor to not damage the C1/C2 if the gpio pin is wrong configured.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby InspecteurGadget » Thu Jun 15, 2017 12:10 am

Hi,
Code: Select all
logcat | grep com.jw
06-14 19:00:31.648  3192  3192 W PackageManager: Not granting permission android.permission.WRITE_EXTERNAL_STORAGE to package com.jw.shutdownservice because it was previously installed without
06-14 19:00:31.648  3192  3192 W PackageManager: Not granting permission android.permission.READ_EXTERNAL_STORAGE to package com.jw.shutdownservice because it was previously installed without
06-14 19:00:31.648  3192  3192 W PackageManager: Not granting permission android.permission.ACCESS_SUPERUSER to package com.jw.shutdownservice because it was previously installed without
06-14 19:00:31.648  3192  3192 W PackageManager: Not granting permission android.permission.READ_PHONE_STATE to package com.jw.shutdownservice because it was previously installed without
06-14 19:00:32.701  3192  3238 W PackageManager: Not granting permission android.permission.WRITE_EXTERNAL_STORAGE to package com.jw.shutdownservice because it was previously installed without
06-14 19:00:32.701  3192  3238 W PackageManager: Not granting permission android.permission.READ_EXTERNAL_STORAGE to package com.jw.shutdownservice because it was previously installed without
06-14 19:00:32.701  3192  3238 W PackageManager: Not granting permission android.permission.ACCESS_SUPERUSER to package com.jw.shutdownservice because it was previously installed without
06-14 19:00:32.701  3192  3238 W PackageManager: Not granting permission android.permission.READ_PHONE_STATE to package com.jw.shutdownservice because it was previously installed without
06-14 19:00:43.776  3192  3206 I ActivityManager: Start proc 4413:com.jw.shutdownservice/u0a71 for broadcast com.jw.shutdownservice/.autostart
06-14 19:00:44.187  4413  4413 E AndroidRuntime: Process: com.jw.shutdownservice, PID: 4413
06-14 19:00:44.187  4413  4413 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate receiver com.jw.shutdownservice.autostart: java.lang.ClassNotFoundException: Didn't find class "com.jw.shutdownservice.autostart" on path: DexPathList[[zip file "/data/app/com.jw.shutdownservice-1/base.apk"],nativeLibraryDirectories=[/data/app/com.jw.shutdownservice-1/lib/arm, /data/app/com.jw.shutdownservice-1/base.apk!/lib/armeabi, /vendor/lib, /system/lib]]
06-14 19:00:44.187  4413  4413 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.jw.shutdownservice.autostart" on path: DexPathList[[zip file "/data/app/com.jw.shutdownservice-1/base.apk"],nativeLibraryDirectories=[/data/app/com.jw.shutdownservice-1/lib/arm, /data/app/com.jw.shutdownservice-1/base.apk!/lib/armeabi, /vendor/lib, /system/lib]]
06-14 19:00:44.187  4413  4413 E AndroidRuntime:        Suppressed: java.lang.ClassNotFoundException: com.jw.shutdownservice.autostart
06-14 19:04:37.730  3192  3333 I ActivityManager: Process com.jw.shutdownservice (pid 4413) has died
06-14 19:04:40.995  3192  3589 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.jw.shutdownservice/.SettingsActivity} from uid 10051 on display 0
06-14 19:04:41.021  3192  3204 I ActivityManager: Start proc 4926:com.jw.shutdownservice/u0a71 for activity com.jw.shutdownservice/.SettingsActivity
06-14 19:04:41.182  4926  4926 E AndroidRuntime: Process: com.jw.shutdownservice, PID: 4926
06-14 19:04:41.182  4926  4926 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.jw.shutdownservice/com.jw.shutdownservice.SettingsActivity}: java.lang.ClassNotFoundException: Didn't find class "com.jw.shutdownservice.SettingsActivity" on path: DexPathList[[zip file "/data/app/com.jw.shutdownservice-1/base.apk"],nativeLibraryDirectories=[/data/app/com.jw.shutdownservice-1/lib/arm, /data/app/com.jw.shutdownservice-1/base.apk!/lib/armeabi, /vendor/lib, /system/lib]]
06-14 19:04:41.182  4926  4926 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.jw.shutdownservice.SettingsActivity" on path: DexPathList[[zip file "/data/app/com.jw.shutdownservice-1/base.apk"],nativeLibraryDirectories=[/data/app/com.jw.shutdownservice-1/lib/arm, /data/app/com.jw.shutdownservice-1/base.apk!/lib/armeabi, /vendor/lib, /system/lib]]
06-14 19:04:41.182  4926  4926 E AndroidRuntime:        Suppressed: java.lang.ClassNotFoundException: com.jw.shutdownservice.SettingsActivity
06-14 19:04:41.184  3192  3486 W ActivityManager:   Force finishing activity com.jw.shutdownservice/.SettingsActivity
06-14 19:04:41.701  3192  3206 W ActivityManager: Activity pause timeout for ActivityRecord{cafa5e3 u0 com.jw.shutdownservice/.SettingsActivity t124 f}
06-14 19:04:51.745  3192  3206 W ActivityManager: Activity destroy timeout for ActivityRecord{cafa5e3 u0 com.jw.shutdownservice/.SettingsActivity t124 f}
06-14 19:05:41.480  3192  3598 I ActivityManager: Process com.jw.shutdownservice (pid 4926) has died
06-14 19:06:06.575  3192  3204 I ActivityManager: Start proc 4987:com.jw.shutdownservice/u0a71 for service com.jw.shutdownservice/.GpioShutdownService
06-14 19:06:06.741  4987  4987 E AndroidRuntime: Process: com.jw.shutdownservice, PID: 4987
06-14 19:06:06.741  4987  4987 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate service com.jw.shutdownservice.GpioShutdownService: java.lang.ClassNotFoundException: Didn't find class "com.jw.shutdownservice.GpioShutdownService" on path: DexPathList[[zip file "/data/app/com.jw.shutdownservice-1/base.apk"],nativeLibraryDirectories=[/data/app/com.jw.shutdownservice-1/lib/arm, /data/app/com.jw.shutdownservice-1/base.apk!/lib/armeabi, /vendor/lib, /system/lib]]
06-14 19:06:06.741  4987  4987 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.jw.shutdownservice.GpioShutdownService" on path: DexPathList[[zip file "/data/app/com.jw.shutdownservice-1/base.apk"],nativeLibraryDirectories=[/data/app/com.jw.shutdownservice-1/lib/arm, /data/app/com.jw.shutdownservice-1/base.apk!/lib/armeabi, /vendor/lib, /system/lib]]
06-14 19:06:06.741  4987  4987 E AndroidRuntime:        Suppressed: java.lang.ClassNotFoundException: com.jw.shutdownservice.GpioShutdownService
06-14 19:06:11.110  3192  3486 I ActivityManager: Process com.jw.shutdownservice (pid 4987) has died
06-14 19:06:11.110  3192  3486 W ActivityManager: Scheduling restart of crashed service com.jw.shutdownservice/.GpioShutdownService in 8776ms
06-14 19:06:19.902  3192  3206 I ActivityManager: Start proc 5015:com.jw.shutdownservice/u0a71 for service com.jw.shutdownservice/.GpioShutdownService
06-14 19:06:20.043  5015  5015 E AndroidRuntime: Process: com.jw.shutdownservice, PID: 5015
06-14 19:06:20.043  5015  5015 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate service com.jw.shutdownservice.GpioShutdownService: java.lang.ClassNotFoundException: Didn't find class "com.jw.shutdownservice.GpioShutdownService" on path: DexPathList[[zip file "/data/app/com.jw.shutdownservice-1/base.apk"],nativeLibraryDirectories=[/data/app/com.jw.shutdownservice-1/lib/arm, /data/app/com.jw.shutdownservice-1/base.apk!/lib/armeabi, /vendor/lib, /system/lib]]
06-14 19:06:20.043  5015  5015 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.jw.shutdownservice.GpioShutdownService" on path: DexPathList[[zip file "/data/app/com.jw.shutdownservice-1/base.apk"],nativeLibraryDirectories=[/data/app/com.jw.shutdownservice-1/lib/arm, /data/app/com.jw.shutdownservice-1/base.apk!/lib/armeabi, /vendor/lib, /system/lib]]
06-14 19:06:20.043  5015  5015 E AndroidRuntime:        Suppressed: java.lang.ClassNotFoundException: com.jw.shutdownservice.GpioShutdownService
06-14 19:06:23.950  3192  3204 I ActivityManager: Process com.jw.shutdownservice (pid 5015) has died
06-14 19:06:23.951  3192  3204 W ActivityManager: Service crashed 2 times, stopping: ServiceRecord{b9d832 u0 com.jw.shutdownservice/.GpioShutdownService}
InspecteurGadget
 
Posts: 68
Joined: Thu Apr 27, 2017 3:33 am
languages_spoken: French, English
ODROIDs: Odroid C2
USB GPS, Bluetooth, Wifi
Emmc 8g Android M
Rtc modue

Re: App GpioShutdownService for C2

Unread postby joerg » Thu Jun 15, 2017 2:45 am

Hi,
seems that you need to set the permissions manually in Apps/ShutdownService/Permissions. Restarting the service is done by press the upper left button on preferences activity.
If this not work try to remove the app with uninstall and install again. Note that after complete new install there must come up the super user dialog to give root permission. Then you need to make your settings again.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby InspecteurGadget » Thu Jun 15, 2017 3:28 am

I set manually all permissions, I restart
it not work,
I uninstall/install, I don't have super user dialog.
And it's normal if I dont have super su app?
InspecteurGadget
 
Posts: 68
Joined: Thu Apr 27, 2017 3:33 am
languages_spoken: French, English
ODROIDs: Odroid C2
USB GPS, Bluetooth, Wifi
Emmc 8g Android M
Rtc modue

Re: App GpioShutdownService for C2

Unread postby joerg » Thu Jun 15, 2017 3:31 pm

This was somehow rare. I had to update AndroidStudio and gradle to get rid of this. When I installed the app from AndroidStudio all was ok. But when I installed with adb install... I had the same errors as you. I uploaded the newer apk version is 1.5.1, now it should do.
And yes, superuser is there, I think as system app, you can't see in app list:
device-2017-06-15-084036.png
device-2017-06-15-084036.png (128.29 KiB) Viewed 4010 times
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby InspecteurGadget » Fri Jun 16, 2017 12:30 am

thank's It's work now =)
More extra pin Would be super =)
Is not it possible to make a tab on the ribbon the extra pin number you want and it loop on it?
InspecteurGadget
 
Posts: 68
Joined: Thu Apr 27, 2017 3:33 am
languages_spoken: French, English
ODROIDs: Odroid C2
USB GPS, Bluetooth, Wifi
Emmc 8g Android M
Rtc modue

Re: App GpioShutdownService for C2

Unread postby poptmartone » Fri Aug 18, 2017 7:12 am

Hello Joerg, my odroid based car infotainment system grows day after day. Your service is fundamental in order to control the startup and shutdown phases so thank you. I just want to know if exists a method to recognize the shutdown event initialized by the pressure of the power button in the navbar which produce the same results of the external push button, I mean for instance the state change of the heartbeat pin.

Hope you could help me. Many thanks.
poptmartone
 
Posts: 52
Joined: Wed Aug 03, 2016 10:39 pm
languages_spoken: english italian
ODROIDs: ODROID C2

Re: App GpioShutdownService for C2

Unread postby joerg » Fri Aug 18, 2017 8:18 pm

Hello poptmartone, I see two possible solution. One is the option for RemotePi board. There is observed the broadcast intent of the shutdown and generated a pulse sequence on the used pin. But this is unknown seconds before the shutdown is really done. Other method could be the pin 26, as is described here: https://forum.odroid.com/viewtopic.php?f=140&t=27203#p192857. This pin is served from u-boot code, so it is really early high at boot up and really late low at shutdown, and totally independent of the app.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby poptmartone » Sat Aug 19, 2017 5:06 am

Ok Joerg, I will try both the solutions. Thank you.
poptmartone
 
Posts: 52
Joined: Wed Aug 03, 2016 10:39 pm
languages_spoken: english italian
ODROIDs: ODROID C2

Re: App GpioShutdownService for C2

Unread postby Palasito » Fri Sep 01, 2017 1:28 am

Hello joerg,
I just wanted to ask a question regarding your app.. can this be used with an xu4 ?
Also, if not, is there a way to make it compatible ?
Have a great day mate and thanks in advance for your time !! :D
Palasito
 
Posts: 9
Joined: Tue Jun 13, 2017 3:10 am
languages_spoken: English, Greek
ODROIDs: XU4, VU7

Re: App GpioShutdownService for C2

Unread postby joerg » Fri Sep 01, 2017 3:00 am

Hello Paiasito,
can you please check what you get, when you give the command: getprop|grep ro.product.device
Also need to check if there is a /system/bin/su or a /system/xbin/su. If not I need to know where is the su binary.
And please check if you have the /dev/gpiomem device.
I can add what I think need to. But I can't test it, as don't have a XU4.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby deadlocked » Fri Mar 23, 2018 2:53 pm

Hi joerg,

I have an ODROID-XU4 and I can answer your question to Palasito. Here is what I get when I run the commands that you requested:

getprop|grep ro.product.device
[ro.product.device]: [odroidxu3]
(I think this is hard-coded in the LineageOS android image, I get the XU4 mislabeled as XU3 everywhere)

"/system/xbin/su" exists and "/system/bin/su" is a symlink to it.

"/dev/gpiomem" exists on my system

thanks and regards.
deadlocked
 
Posts: 5
Joined: Fri Mar 23, 2018 2:44 pm
languages_spoken: english
ODROIDs: ODROID-C2 and ODROID-XU4

Re: App GpioShutdownService for C2

Unread postby deadlocked » Fri Mar 23, 2018 2:58 pm

joerg,

Can you also please repost the "on-off-switch.png" circuit from your post from back in "Sat May 21, 2016 8:48 am"?

When I try to view it, I get:
"The file ./../files/4766_397ee5a66725f33cbadae72551f8bf91 does not exist."

Thanks in advance.
deadlocked
 
Posts: 5
Joined: Fri Mar 23, 2018 2:44 pm
languages_spoken: english
ODROIDs: ODROID-C2 and ODROID-XU4

Re: App GpioShutdownService for C2

Unread postby joerg » Sat Mar 24, 2018 12:07 am

O.K. I uploaded the png.
I will add the odroidxu3 in the list of devices, but I am not sure if the wiringPi will work if I add the arch armv7a to build the library. Need somebody who can test it.
I need to make some extension to the code then I will upload a new version.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby joerg » Sat Mar 24, 2018 4:08 am

-Added 4 more extra actions.
-Experimental support for XU3/4.

If someone can do a test on XU4? If it is not working, I need the part of logcat that shows the errors.

[edid]
deleted this experimental version
Last edited by joerg on Thu Mar 29, 2018 5:34 am, edited 2 times in total.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby deadlocked » Sat Mar 24, 2018 11:12 am

Thank you, joerg!

I will give it a try this weekend (I have to take apart my XU4-in-Amiga1200-case and wire a resistor-switch (for shutdown test) and an resistor-LED (for the heartbeat function), so most likely Saturday night or Sunday morning.

Does the apk in the XU4 use the WiringPI numbers, just like the C2 version? I am aware that the pinout on the XU4 is different, but the WiringPI numbers should make it easier to figure out which GPIO is which.
deadlocked
 
Posts: 5
Joined: Fri Mar 23, 2018 2:44 pm
languages_spoken: english
ODROIDs: ODROID-C2 and ODROID-XU4

Re: App GpioShutdownService for C2

Unread postby joerg » Sat Mar 24, 2018 9:46 pm

The app uses the wiringPi numbers. But please look after install when opens the preferences activity, you should adjust the shutdown and restart settings according the i/o map of the XU4. There is shutdown:24 and restart:27 and hold_power:23 predefined. The 24 doesn't exist on the XU4 and I don't know what happens after the service is started.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby deadlocked » Sun Mar 25, 2018 7:43 am

Thanks, joerg. I have installed 1.7.0 on my XU4 and started the service without issues. I have remapped the shutdown pin to 27, heartbeat to pin 5 and hold_power to pin 6. I blanked the rest of the pin assignments (that weren't already blank) to avoid conflicts.

It turns out that I forgot that the GPIO pins on the XU4 are 1.8V (not 3.3 like in the rest of the "civilized world"), but thankfully I double-checked the HardKernel pinout page before I blew up anything. Since I had everything set to 3.3V, I will have to wait until next week to get a level converter so that I can test the pins themselves, but I assure you I will test them and report back.
deadlocked
 
Posts: 5
Joined: Fri Mar 23, 2018 2:44 pm
languages_spoken: english
ODROIDs: ODROID-C2 and ODROID-XU4

Re: App GpioShutdownService for C2

Unread postby joerg » Sun Mar 25, 2018 3:39 pm

The app should set the shutdown pin as input with pull up. If you can access the header easily, just connect the shutdown pin by a resistor of 1k to GND to test the function.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby Luke.go » Mon Mar 26, 2018 2:19 pm

Hi joerg. I trying to install 1.7.0 on my XU4 android 4.4.4-alph-6.1, but it couldn't do that.
Via using the 'adb install' commands, the massage was returned.
- Failure [INSTALL_FAILED_OLDER_SDK]
I will try it on lineageOS.:)

EDIT: I tested it on lineageOS 15.1, Alpha-0.2_07.03.18.

When I installed an first running the apps, it works fine. :)

but after second opening, the apps is not works. NO UI, NO response until a little bit time. and android shows the 'ShutdownService isn't responding' message.

here is logcat messages.

Code: Select all
03-25 20:52:20.351  3324  6158 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.jw.shutdownservice/.SettingsActivity bnds=[1058,402][1268,505]} from uid 10028
03-25 20:52:20.353  3210  5950 D audio_hw_primary: found out /dev/snd/pcmC0D1p
03-25 20:52:20.402  3324  6158 I ActivityManager: Start proc 7401:com.jw.shutdownservice/u0a82 for activity com.jw.shutdownservice/.SettingsActivity
03-25 20:52:20.409  3210  3269 D AudioFlinger: mixer(0xab4ae880) throttle end: throttle time(22)
03-25 20:52:20.411  7401  7401 I zygote  : Late-enabling -Xcheck:jni
03-25 20:52:20.397  7401  7401 I main    : type=1400 audit(0.0:120): avc: denied { write } for name="trace_marker" dev="debugfs" ino=2152 scontext=u:r:zygote:s0 tcontext=u:object_r:sysfs_debug_untrusted:s0 tclass=file permissive=1
03-25 20:52:20.975  7401  7420 D OpenGLRenderer: HWUI GL Pipeline
03-25 20:52:20.979  7401  7406 I zygote  : Do partial code cache collection, code=9KB, data=21KB
03-25 20:52:20.980  7401  7406 I zygote  : After code cache collection, code=9KB, data=21KB
03-25 20:52:20.980  7401  7406 I zygote  : Increasing code cache capacity to 128KB
03-25 20:52:20.982  7401  7406 I zygote  : Do partial code cache collection, code=9KB, data=39KB
03-25 20:52:20.983  7401  7406 I zygote  : After code cache collection, code=9KB, data=39KB
03-25 20:52:20.983  7401  7406 I zygote  : Increasing code cache capacity to 256KB
03-25 20:52:20.984  7401  7406 I zygote  : Compiler allocated 4MB to compile void android.widget.TextView.<init>(android.content.Context, android.util.AttributeSet, int, int)
03-25 20:52:20.990  7401  7401 I com.jw.gpioshutdown: onCreate() entry
03-25 20:52:20.991  7401  7401 I com.jw.gpioshutdown: Checking superuser binary, check = true
03-25 20:52:21.012  7423  7423 D su      : su invoked.
03-25 20:52:21.017  7423  7423 D su      : starting daemon client 10082 10082
03-25 20:52:21.025  7425  7425 D su      : remote pid: 7423
03-25 20:52:21.026  7425  7425 D su      : remote pts_slave:
03-25 20:52:21.029  7425  7425 D su      : waiting for child exit
03-25 20:52:21.033  7427  7427 D su      : su invoked.
03-25 20:52:21.034  7427  7427 E su      : SU from: u0_a82
03-25 20:52:21.036  7427  7427 D su      : Checking whether app [uid:10082, pkgName: com.jw.shutdownservice] is allowed to be root
03-25 20:52:21.040  7427  7427 D su      : Privilege elevation allowed by appops
03-25 20:52:21.040  7427  7427 D su      : Allowing via appops.
03-25 20:52:21.040  7427  7427 D su      : 10082 /system/bin/app_process32 executing 0 /system/bin/sh using binary /system/bin/sh : sh
03-25 20:52:21.041  3324  3339 E ActivityManager: Sending non-protected broadcast android.intent.action.SU_SESSION_CHANGED from system 3324:system/1000 pkg android
03-25 20:52:21.041  3324  3339 E ActivityManager: java.lang.Throwable
03-25 20:52:21.041  3324  3339 E ActivityManager:       at com.android.server.am.ActivityManagerService.checkBroadcastFromSystem(ActivityManagerService.java:19153)
03-25 20:52:21.041  3324  3339 E ActivityManager:       at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:19665)
03-25 20:52:21.041  3324  3339 E ActivityManager:       at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:19900)
03-25 20:52:21.041  3324  3339 E ActivityManager:       at android.app.ContextImpl.sendBroadcastAsUser(ContextImpl.java:1130)
03-25 20:52:21.041  3324  3339 E ActivityManager:       at com.android.server.AppOpsService$2.run(AppOpsService.java:142)
03-25 20:52:21.041  3324  3339 E ActivityManager:       at android.os.Handler.handleCallback(Handler.java:790)
03-25 20:52:21.041  3324  3339 E ActivityManager:       at android.os.Handler.dispatchMessage(Handler.java:99)
03-25 20:52:21.041  3324  3339 E ActivityManager:       at android.os.Looper.loop(Looper.java:164)
03-25 20:52:21.041  3324  3339 E ActivityManager:       at android.os.HandlerThread.run(HandlerThread.java:65)
03-25 20:52:21.041  3324  3339 E ActivityManager:       at com.android.server.ServiceThread.run(ServiceThread.java:46)
03-25 20:52:21.044  7427  7427 D su      : Waiting for pid 7428.
03-25 20:52:21.002  7421  7421 I su      : type=1400 audit(0.0:121): avc: denied { read } for name="online" dev="sysfs" ino=34 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:sysfs:s0 tclass=file permissive=1
03-25 20:52:21.067  3324  3339 E ActivityManager: Sending non-protected broadcast android.intent.action.SU_SESSION_CHANGED from system 3324:system/1000 pkg android
03-25 20:52:21.067  3324  3339 E ActivityManager: java.lang.Throwable
03-25 20:52:21.067  3324  3339 E ActivityManager:       at com.android.server.am.ActivityManagerService.checkBroadcastFromSystem(ActivityManagerService.java:19153)
03-25 20:52:21.067  3324  3339 E ActivityManager:       at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:19758)
03-25 20:52:21.067  3324  3339 E ActivityManager:       at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:19900)
03-25 20:52:21.067  3324  3339 E ActivityManager:       at android.app.ContextImpl.sendBroadcastAsUser(ContextImpl.java:1130)
03-25 20:52:21.067  3324  3339 E ActivityManager:       at com.android.server.AppOpsService$2.run(AppOpsService.java:142)
03-25 20:52:21.067  3324  3339 E ActivityManager:       at android.os.Handler.handleCallback(Handler.java:790)
03-25 20:52:21.067  3324  3339 E ActivityManager:       at android.os.Handler.dispatchMessage(Handler.java:99)
03-25 20:52:21.067  3324  3339 E ActivityManager:       at android.os.Looper.loop(Looper.java:164)
03-25 20:52:21.067  3324  3339 E ActivityManager:       at android.os.HandlerThread.run(HandlerThread.java:65)
03-25 20:52:21.067  3324  3339 E ActivityManager:       at com.android.server.ServiceThread.run(ServiceThread.java:46)
03-25 20:52:21.088  3478  3478 I SuControllerImpl: Got change
03-25 20:52:21.002  7421  7421 I su      : type=1400 audit(0.0:122): avc: denied { open } for path="/sys/devices/system/cpu/online" dev="sysfs" ino=34 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:sysfs:s0 tclass=file permissive=1
03-25 20:52:22.996  7401  7401 I com.jw.gpioshutdown: Checking ro.product.device, check = true
03-25 20:52:30.365  3324  3339 W ActivityManager: Launch timeout has expired, giving up wake lock!
03-25 20:54:41.771  4844  4919 I PlayCommon: [176] com.google.android.play.b.h.e(263): Preparing logs for uploading
03-25 20:54:41.771  4844  4919 I PlayCommon: [176] com.google.android.play.b.h.e(267): No file ready to send
03-25 20:55:10.387  5179  5217 I PlayCommon: [198] com.google.android.play.b.h.e(263): Preparing logs for uploading
03-25 20:55:10.388  5179  5217 I PlayCommon: [198] com.google.android.play.b.h.e(267): No file ready to send
03-25 20:55:40.539  3324  3339 W ActivityManager: Timeout executing service: ServiceRecord{2bd12df u0 com.jw.shutdownservice/.GpioShutdownService}
03-25 20:55:41.008  3324  3339 I zygote  : libdebuggerd_client: started dumping process 7401
03-25 20:55:41.009  3222  3222 I /system/bin/tombstoned: registered intercept for pid 7401 and type kDebuggerdJavaBacktrace
03-25 20:55:41.009  7401  7407 I zygote  : Thread[3,tid=7407,WaitingInMainSignalCatcherLoop,Thread*=0xa55da000,peer=0x15f80020,"Signal Catcher"]: reacting to signal 3
03-25 20:55:41.010  7401  7407 I zygote  :
03-25 20:55:41.126  3222  3222 I /system/bin/tombstoned: received crash request for pid 7401
03-25 20:55:41.126  3222  3222 I /system/bin/tombstoned: found intercept fd 512 for pid 7401 and type kDebuggerdJavaBacktrace
03-25 20:55:41.126  7401  7407 I zygote  : Wrote stack traces to '[tombstoned]'
03-25 20:55:41.128  3324  3339 I zygote  : libdebuggerd_client: done dumping process 7401
03-25 20:55:41.128  3324  3339 I zygote  : libdebuggerd_client: started dumping process 3324
03-25 20:55:41.129  3222  3222 I /system/bin/tombstoned: registered intercept for pid 3324 and type kDebuggerdJavaBacktrace
03-25 20:55:41.129  3324  3329 I zygote  : Thread[2,tid=3329,WaitingInMainSignalCatcherLoop,Thread*=0x9d98c000,peer=0x12c00110,"Signal Catcher"]: reacting to signal 3
03-25 20:55:41.129  3324  3329 I zygote  :
03-25 20:55:41.750  3222  3222 I /system/bin/tombstoned: received crash request for pid 3324
03-25 20:55:41.750  3222  3222 I /system/bin/tombstoned: found intercept fd 512 for pid 3324 and type kDebuggerdJavaBacktrace
03-25 20:55:41.750  3324  3329 I zygote  : Wrote stack traces to '[tombstoned]'
03-25 20:55:41.758  3324  3339 I zygote  : libdebuggerd_client: done dumping process 3324
03-25 20:55:41.759  3324  3339 I zygote  : libdebuggerd_client: started dumping process 3465
03-25 20:55:41.759  3222  3222 I /system/bin/tombstoned: registered intercept for pid 3465 and type kDebuggerdJavaBacktrace
03-25 20:55:41.759  3465  3471 I zygote  : Thread[3,tid=3471,WaitingInMainSignalCatcherLoop,Thread*=0xa55da000,peer=0x12dc0218,"Signal Catcher"]: reacting to signal 3
03-25 20:55:41.759  3465  3471 I zygote  :
03-25 20:55:41.908  3222  3222 I /system/bin/tombstoned: received crash request for pid 3465
03-25 20:55:41.908  3222  3222 I /system/bin/tombstoned: found intercept fd 512 for pid 3465 and type kDebuggerdJavaBacktrace
03-25 20:55:41.908  3465  3471 I zygote  : Wrote stack traces to '[tombstoned]'
03-25 20:55:41.911  3324  3339 I zygote  : libdebuggerd_client: done dumping process 3465
03-25 20:55:41.911  3324  3339 I zygote  : libdebuggerd_client: started dumping process 3952
03-25 20:55:41.912  3222  3222 I /system/bin/tombstoned: registered intercept for pid 3952 and type kDebuggerdJavaBacktrace
03-25 20:55:41.912  3952  3958 I zygote  : Thread[3,tid=3958,WaitingInMainSignalCatcherLoop,Thread*=0xa55da000,peer=0x13400020,"Signal Catcher"]: reacting to signal 3
03-25 20:55:41.912  3952  3958 I zygote  :
03-25 20:55:42.027  3222  3222 I /system/bin/tombstoned: received crash request for pid 3952
03-25 20:55:42.027  3222  3222 I /system/bin/tombstoned: found intercept fd 512 for pid 3952 and type kDebuggerdJavaBacktrace
03-25 20:55:42.027  3952  3958 I zygote  : Wrote stack traces to '[tombstoned]'
03-25 20:55:42.029  3324  3339 I zygote  : libdebuggerd_client: done dumping process 3952
03-25 20:55:42.029  3324  3339 I zygote  : libdebuggerd_client: started dumping process 3478
03-25 20:55:42.030  3222  3222 I /system/bin/tombstoned: registered intercept for pid 3478 and type kDebuggerdJavaBacktrace
03-25 20:55:42.030  3478  3487 I zygote  : Thread[3,tid=3487,WaitingInMainSignalCatcherLoop,Thread*=0xa55da000,peer=0x12e40978,"Signal Catcher"]: reacting to signal 3
03-25 20:55:42.030  3478  3487 I zygote  :
03-25 20:55:42.222  3222  3222 I /system/bin/tombstoned: received crash request for pid 3478
03-25 20:55:42.222  3222  3222 I /system/bin/tombstoned: found intercept fd 512 for pid 3478 and type kDebuggerdJavaBacktrace
03-25 20:55:42.223  3478  3487 I zygote  : Wrote stack traces to '[tombstoned]'
03-25 20:55:42.226  3324  3339 I zygote  : libdebuggerd_client: done dumping process 3478
03-25 20:55:42.226  3324  3339 I zygote  : libdebuggerd_client: started dumping process 3041
03-25 20:55:42.227  3222  3222 I /system/bin/tombstoned: registered intercept for pid 3041 and type kDebuggerdNativeBacktrace
03-25 20:55:42.227  3041  3041 I libc    : Requested dump for tid 3041 (surfaceflinger)
03-25 20:55:42.262  7437  7437 E cutils-trace: Error opening trace file: Permission denied (13)
03-25 20:55:42.291  7438  7438 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdNativeBacktrace
03-25 20:55:42.291  3222  3222 I /system/bin/tombstoned: received crash request for pid 3041
03-25 20:55:42.291  3222  3222 I /system/bin/tombstoned: found intercept fd 512 for pid 3041 and type kDebuggerdNativeBacktrace
03-25 20:55:42.292  7438  7438 I crash_dump32: performing dump of process 3041 (target tid = 3041)
03-25 20:55:42.699  3324  3339 I zygote  : libdebuggerd_client: done dumping process 3041
03-25 20:55:42.699  3324  3339 I zygote  : libdebuggerd_client: started dumping process 3207
03-25 20:55:42.700  3222  3222 I /system/bin/tombstoned: registered intercept for pid 3207 and type kDebuggerdNativeBacktrace
03-25 20:55:42.701  3222  3222 I /system/bin/tombstoned: received crash request for pid 3207
03-25 20:55:42.701  3222  3222 I /system/bin/tombstoned: found intercept fd 512 for pid 3207 and type kDebuggerdNativeBacktrace
03-25 20:55:42.757  3324  3339 I zygote  : libdebuggerd_client: done dumping process 3207
03-25 20:55:42.758  3324  3339 I zygote  : libdebuggerd_client: started dumping process 3210
03-25 20:55:42.758  3222  3222 I /system/bin/tombstoned: registered intercept for pid 3210 and type kDebuggerdNativeBacktrace
03-25 20:55:42.758  3210  3210 I libc    : Requested dump for tid 3210 (audioserver)
03-25 20:55:42.784  7440  7440 E cutils-trace: Error opening trace file: Permission denied (13)
03-25 20:55:42.803  7441  7441 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdNativeBacktrace
03-25 20:55:42.803  3222  3222 I /system/bin/tombstoned: received crash request for pid 3210
03-25 20:55:42.803  3222  3222 I /system/bin/tombstoned: found intercept fd 512 for pid 3210 and type kDebuggerdNativeBacktrace
03-25 20:55:42.804  7441  7441 I crash_dump32: performing dump of process 3210 (target tid = 3210)
03-25 20:55:43.061  3324  3339 I zygote  : libdebuggerd_client: done dumping process 3210
03-25 20:55:43.061  3324  3339 I zygote  : libdebuggerd_client: started dumping process 3211
03-25 20:55:43.062  3222  3222 I /system/bin/tombstoned: registered intercept for pid 3211 and type kDebuggerdNativeBacktrace
03-25 20:55:43.062  3211  3211 I libc    : Requested dump for tid 3211 (cameraserver)
03-25 20:55:43.080  7443  7443 E cutils-trace: Error opening trace file: Permission denied (13)
03-25 20:55:43.090  7444  7444 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdNativeBacktrace
03-25 20:55:43.090  3222  3222 I /system/bin/tombstoned: received crash request for pid 3211
03-25 20:55:43.090  3222  3222 I /system/bin/tombstoned: found intercept fd 512 for pid 3211 and type kDebuggerdNativeBacktrace
03-25 20:55:43.091  7444  7444 I crash_dump32: performing dump of process 3211 (target tid = 3211)
03-25 20:55:43.227  3324  3339 I zygote  : libdebuggerd_client: done dumping process 3211
03-25 20:55:43.227  3324  3339 I zygote  : libdebuggerd_client: started dumping process 3212
03-25 20:55:43.228  3222  3222 I /system/bin/tombstoned: registered intercept for pid 3212 and type kDebuggerdNativeBacktrace
03-25 20:55:43.228  3212  3212 I libc    : Requested dump for tid 3212 (drmserver)
03-25 20:55:43.248  7446  7446 E cutils-trace: Error opening trace file: Permission denied (13)
03-25 20:55:43.257  7447  7447 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdNativeBacktrace
03-25 20:55:43.257  3222  3222 I /system/bin/tombstoned: received crash request for pid 3212
03-25 20:55:43.257  3222  3222 I /system/bin/tombstoned: found intercept fd 512 for pid 3212 and type kDebuggerdNativeBacktrace
03-25 20:55:43.258  7447  7447 I crash_dump32: performing dump of process 3212 (target tid = 3212)
03-25 20:55:43.314  3324  3339 I zygote  : libdebuggerd_client: done dumping process 3212
03-25 20:55:43.314  3324  3339 I zygote  : libdebuggerd_client: started dumping process 3215
03-25 20:55:43.315  3222  3222 I /system/bin/tombstoned: registered intercept for pid 3215 and type kDebuggerdNativeBacktrace
03-25 20:55:43.315  3215  3215 I libc    : Requested dump for tid 3215 (mediadrmserver)
03-25 20:55:43.336  7449  7449 E cutils-trace: Error opening trace file: Permission denied (13)
03-25 20:55:43.344  7450  7450 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdNativeBacktrace
03-25 20:55:43.345  3222  3222 I /system/bin/tombstoned: received crash request for pid 3215
03-25 20:55:43.345  3222  3222 I /system/bin/tombstoned: found intercept fd 512 for pid 3215 and type kDebuggerdNativeBacktrace
03-25 20:55:43.345  7450  7450 I crash_dump32: performing dump of process 3215 (target tid = 3215)
03-25 20:55:43.418  3324  3339 I zygote  : libdebuggerd_client: done dumping process 3215
03-25 20:55:43.418  3324  3339 I zygote  : libdebuggerd_client: started dumping process 3218
03-25 20:55:43.419  3222  3222 I /system/bin/tombstoned: registered intercept for pid 3218 and type kDebuggerdNativeBacktrace
03-25 20:55:43.420  3218  3218 I libc    : Requested dump for tid 3218 (mediaserver)
03-25 20:55:43.445  7452  7452 E cutils-trace: Error opening trace file: Permission denied (13)
03-25 20:55:43.459  7453  7453 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdNativeBacktrace
03-25 20:55:43.459  3222  3222 I /system/bin/tombstoned: received crash request for pid 3218
03-25 20:55:43.459  3222  3222 I /system/bin/tombstoned: found intercept fd 512 for pid 3218 and type kDebuggerdNativeBacktrace
03-25 20:55:43.460  7453  7453 I crash_dump32: performing dump of process 3218 (target tid = 3218)
03-25 20:55:43.540  3324  3339 I zygote  : libdebuggerd_client: done dumping process 3218
03-25 20:55:43.540  3324  3339 I zygote  : libdebuggerd_client: started dumping process 3484
03-25 20:55:43.541  3222  3222 I /system/bin/tombstoned: registered intercept for pid 3484 and type kDebuggerdNativeBacktrace
03-25 20:55:43.541  3484  3484 I libc    : Requested dump for tid 3484 (sdcard)
03-25 20:55:43.562  7455  7455 E cutils-trace: Error opening trace file: Permission denied (13)
03-25 20:55:43.568  7456  7456 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdNativeBacktrace
03-25 20:55:43.569  3222  3222 I /system/bin/tombstoned: received crash request for pid 3484
03-25 20:55:43.569  3222  3222 I /system/bin/tombstoned: found intercept fd 512 for pid 3484 and type kDebuggerdNativeBacktrace
03-25 20:55:43.569  7456  7456 I crash_dump32: performing dump of process 3484 (target tid = 3484)
03-25 20:55:43.603  3324  3339 I zygote  : libdebuggerd_client: done dumping process 3484
03-25 20:55:43.603  3324  3339 I zygote  : libdebuggerd_client: started dumping process 3572
03-25 20:55:43.604  3222  3222 I /system/bin/tombstoned: registered intercept for pid 3572 and type kDebuggerdNativeBacktrace
03-25 20:55:43.604  3572  3572 I libc    : Requested dump for tid 3572 (sdcard)
03-25 20:55:43.625  7458  7458 E cutils-trace: Error opening trace file: Permission denied (13)
03-25 20:55:43.631  7459  7459 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdNativeBacktrace
03-25 20:55:43.632  3222  3222 I /system/bin/tombstoned: received crash request for pid 3572
03-25 20:55:43.632  3222  3222 I /system/bin/tombstoned: found intercept fd 512 for pid 3572 and type kDebuggerdNativeBacktrace
03-25 20:55:43.632  7459  7459 I crash_dump32: performing dump of process 3572 (target tid = 3572)
03-25 20:55:43.666  3324  3339 I zygote  : libdebuggerd_client: done dumping process 3572
03-25 20:55:43.666  3324  3339 I zygote  : libdebuggerd_client: started dumping process 7388
03-25 20:55:43.667  3222  3222 I /system/bin/tombstoned: registered intercept for pid 7388 and type kDebuggerdNativeBacktrace
03-25 20:55:43.668  3222  3222 I /system/bin/tombstoned: received crash request for pid 7388
03-25 20:55:43.668  3222  3222 I /system/bin/tombstoned: found intercept fd 512 for pid 7388 and type kDebuggerdNativeBacktrace
03-25 20:55:43.674  2970  2970 I ServiceManager: service 'media.extractor' died
03-25 20:55:43.674  3324  3339 I zygote  : libdebuggerd_client: done dumping process 7388
03-25 20:55:43.674  3222  3222 W /system/bin/tombstoned: crash socket received short read of length 0 (expected 12)
03-25 20:55:43.676  3324  3339 E ActivityManager: ANR in com.jw.shutdownservice
03-25 20:55:43.676  3324  3339 E ActivityManager: PID: 7401
03-25 20:55:43.676  3324  3339 E ActivityManager: Reason: executing service com.jw.shutdownservice/.GpioShutdownService
03-25 20:55:43.676  3324  3339 E ActivityManager: Load: 0.02 / 0.19 / 0.35
03-25 20:55:43.676  3324  3339 E ActivityManager: CPU usage from 68159ms to 0ms ago (2018-03-25 20:54:32.381 to 2018-03-25 20:55:40.540):
03-25 20:55:43.676  3324  3339 E ActivityManager:   0.2% 3324/system_server: 0.1% user + 0% kernel / faults: 47 minor
03-25 20:55:43.676  3324  3339 E ActivityManager:   0.1% 3633/RTW_CMD_THREAD: 0% user + 0.1% kernel
03-25 20:55:43.676  3324  3339 E ActivityManager:   0% 3041/surfaceflinger: 0% user + 0% kernel / faults: 16 minor
03-25 20:55:43.676  3324  3339 E ActivityManager:   0% 3587/kworker/u16:4: 0% user + 0% kernel
03-25 20:55:43.676  3324  3339 E ActivityManager:   0% 7434/kworker/0:1: 0% user + 0% kernel
03-25 20:55:43.676  3324  3339 E ActivityManager:   0% 1803/thread_hotplug: 0% user + 0% kernel
03-25 20:55:43.676  3324  3339 E ActivityManager:   0% 7085/kworker/u16:2: 0% user + 0% kernel
03-25 20:55:43.676  3324  3339 E ActivityManager:   0% 3478/com.android.systemui: 0% user + 0% kernel / faults: 8 minor
03-25 20:55:43.676  3324  3339 E ActivityManager:   0% 5179/com.android.vending:instant_app_installer: 0% user + 0% kernel / faults: 10 minor
03-25 20:55:43.676  3324  3339 E ActivityManager:   0% 6846/com.google.android.instantapps.supervisor: 0% user + 0% kernel / faults: 11 minor
03-25 20:55:43.676  3324  3339 E ActivityManager:   0% 7430/kworker/4:2: 0% user + 0% kernel
03-25 20:55:43.676  3324  3339 E ActivityManager:   0% 1663/mmcqd/0: 0% user + 0% kernel
03-25 20:55:43.676  3324  3339 E ActivityManager:   0% 2970/servicemanager: 0% user + 0% kernel
03-25 20:55:43.676  3324  3339 E ActivityManager:   0% 3022/android.hardware.tv.cec@1.0-service: 0% user + 0% kernel
03-25 20:55:43.676  3324  3339 E ActivityManager:   0% 3976/org.lineageos.trebuchet: 0% user + 0% kernel / faults: 1 minor
03-25 20:55:43.676  3324  3339 E ActivityManager:   0% 6458/kworker/7:1: 0% user + 0% kernel
03-25 20:55:43.676  3324  3339 E ActivityManager:   0% 6885/kworker/3:1: 0% user + 0% kernel
03-25 20:55:43.676  3324  3339 E ActivityManager:   0% 7229/kworker/1:2: 0% user + 0% kernel
03-25 20:55:43.676  3324  3339 E ActivityManager:   0% 7365/kworker/2:0: 0% user + 0% kernel
03-25 20:55:43.676  3324  3339 E ActivityManager:  +0% 7435/kworker/6:0: 0% user + 0% kernel
03-25 20:55:43.676  3324  3339 E ActivityManager: 0% TOTAL: 0% user + 0% kernel
03-25 20:55:43.676  3324  3339 E ActivityManager: CPU usage from 41ms to 433ms later (2018-03-25 20:55:40.581 to 2018-03-25 20:55:40.973):
03-25 20:55:43.676  3324  3339 E ActivityManager:   37% 3324/system_server: 12% user + 25% kernel / faults: 261 minor
03-25 20:55:43.676  3324  3339 E ActivityManager:     34% 3339/ActivityManager: 12% user + 22% kernel
03-25 20:55:43.676  3324  3339 E ActivityManager: 6% TOTAL: 2.5% user + 3.5% kernel
03-25 20:55:43.752  3324  4837 D vndksupport: Loading /vendor/lib/hw/gralloc.exynos5.so from current namespace instead of sphal namespace.
03-25 20:55:43.771  3324  4837 I zygote  : android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
03-25 20:55:43.772  3324  4837 I OpenGLRenderer: Initialized EGL, version 1.4
03-25 20:55:43.772  3324  4837 D OpenGLRenderer: Swap behavior 1
03-25 20:55:43.920  7461  7461 V MediaUtils: physMem: 2095112192
03-25 20:55:43.920  7461  7461 V MediaUtils: requested limit: 419022420
03-25 20:55:43.920  7461  7461 V MediaUtils: actual limit: 419022420
03-25 20:55:43.920  7461  7461 V MediaUtils: original limits: 4294967295/4294967295
03-25 20:55:43.920  7461  7461 V MediaUtils: new limits: 419022420/4294967295
03-25 20:55:43.920  7461  7461 D vndksupport: Loading libutils.so from current namespace instead of sphal namespace.
03-25 20:55:43.921  7461  7461 W /system/bin/mediaextractor: libminijail[7461]: allowing syscall: clock_gettime
03-25 20:55:43.921  7461  7461 W /system/bin/mediaextractor: libminijail[7461]: allowing syscall: connect
03-25 20:55:43.921  7461  7461 W /system/bin/mediaextractor: libminijail[7461]: allowing syscall: fcntl64
03-25 20:55:43.921  7461  7461 W /system/bin/mediaextractor: libminijail[7461]: allowing syscall: socket
03-25 20:55:43.921  7461  7461 W /system/bin/mediaextractor: libminijail[7461]: allowing syscall: writev
03-25 20:55:43.921  7461  7461 W /system/bin/mediaextractor: libminijail[7461]: logging seccomp filter failures
Luke.go
 
Posts: 236
Joined: Mon May 30, 2016 1:55 pm
languages_spoken: english

Re: App GpioShutdownService for C2

Unread postby joerg » Tue Mar 27, 2018 12:18 am

Hi Luke.go,
can you check with ps and/or with top if the service is running and how much load?
Kitkat isn't supported any more with my app and to test it on Nougart, I first need to port the wiringPi to N1.
Can you confirm that the wiringPi is working well on XU4?
I see that the code of wiringPi branch dev changed a lot and I can not see that it is ported to Android.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby joerg » Thu Mar 29, 2018 5:29 am

@Luke.go
Here is another version. For some reason the app blocks with Android N when reading with InputStreamer from a su process. As workaround I disabled the device check.
I tried the app on my N1 with the ported wiringPi dev branch :). All experimental.
GpioShutdownService-1.7.1.apk
Version 1.7.1
(1.52 MiB) Downloaded 33 times
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby joerg » Fri Mar 30, 2018 2:08 am

A note to the last version:
-put some command in On Start Service Action, On Shutdown Action, On Cancel Shutdown Action.
The service can crash, if the these actions are empty.
I will correct this in next version.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby Luke.go » Fri Mar 30, 2018 9:59 am

@joerg
Hi joerg!
I tested 1.7.1 on ODROID-XU4 and ODROID-N1 by checking restart function.
On XU4, I tested it with LineageOS 14.1 and it works.
But on N1, it doesn't works. but the apps no more crashed until load the GUI. :)
Luke.go
 
Posts: 236
Joined: Mon May 30, 2016 1:55 pm
languages_spoken: english

Re: App GpioShutdownService for C2

Unread postby deadlocked » Sun Apr 01, 2018 1:29 am

@joerg,

Thanks for the updated apk. Sorry I did not reply earlier, I had to wait for my level shifters to arrive to open the case, as I do not have it set up for easy dismantle.

I tried 1.7.0 and had the same issue as Luke (it will open fine the first time and then it will not open the second time) but 1.7.1 seems to have fixed the issue. I am on LIneageOS 14.1 (11/03/18).

I have tested the shutdown functionality (which I do not really need on the XU4 as it has a built-in power button) and the heartbeat function (the one I needed the level shifter board for) and both work well. I did map the "HoldPower" output just to see what it did (as I do not have the UPS to drive it with) and it seems to signal something (an LED attached to the level shifter seem to dim randomly)so I am guessing it works too, unless my shifter board is bad.

For those trying the shutdown function, use "am start -a android.intent.action.ACTION_REQUEST_SHUTDOWN" as the shutdown action.

@joerg:
Another question: Is it possible to map an "Activity" LED to the heartbeat pin (or other pin)? I would like to see if I can turn one of the LEDs on the Amiga 1200 case (HDD) into an activity light (right now, it is the heartbeat LED).

Thanks for all the hard work! If you need me to test anything else, I can do that.
deadlocked
 
Posts: 5
Joined: Fri Mar 23, 2018 2:44 pm
languages_spoken: english
ODROIDs: ODROID-C2 and ODROID-XU4

Re: App GpioShutdownService for C2

Unread postby odroid » Sun Apr 01, 2018 4:58 pm

Refer this thread to change the heatbeat LED GPIO.
viewtopic.php?f=135&t=22525#p151227
User avatar
odroid
Site Admin
 
Posts: 28698
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: App GpioShutdownService for C2

Unread postby joerg » Mon Apr 02, 2018 1:54 am

@deadlocked, thank you for the feedback.
Basically @odroid is right. To modify the heartbeat led, either you can do this by editing the sysfs, or if you want to have it on a pin of the 40 pin header, you need to modify the devicetree.
Also as I know the tools to modify the devicetree are available on linux, but not on Android. On Android there is also no way to get access to the devicetree. It need to be done on a linux based machine and then pushed the modified dt to the XU4 with fastboot.
If you only want to change the trigger of the blue led, check which trigger are available on your XU4:
Code: Select all
cat /sys/class/leds/blue\:heartbeat/trigger
none nand-disk [heartbeat] emmc sd battery-charging-or-full battery-charging battery-full battery-charging-blink-full-solid ac-online

This I get on a C1. You would need to figure out which of the existing trigger is working for you. E.g.:
Code: Select all
echo sd > /sys/class/leds/blue\:heartbeat/trigger

Then you could add this command to the On Start Service Action.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby InspecteurGadget » Tue Apr 24, 2018 10:22 pm

Hello I've a question
Can I use an RJ45 4meters to extend my gpio pin ?
8 pin for gpio + GND of cable to gnd of odroid
with 2k resistor for each pin
thanks
InspecteurGadget
 
Posts: 68
Joined: Thu Apr 27, 2017 3:33 am
languages_spoken: French, English
ODROIDs: Odroid C2
USB GPS, Bluetooth, Wifi
Emmc 8g Android M
Rtc modue

Re: App GpioShutdownService for C2

Unread postby mad_ady » Tue Apr 24, 2018 11:48 pm

I've used an ethernet cable of 2-3m to extend a couple of gpios (5V, gnd, and two gpios) to drive a relay and a temperature sensor and it worked great. Having twisted pairs shields you from interference on your wires, so it should work fine without additional resistors.
User avatar
mad_ady
 
Posts: 4581
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: App GpioShutdownService for C2

Unread postby joerg » Wed Apr 25, 2018 2:07 am

Yes, but using resistors or not is the question. ;)
I would prefer resistors, because one can make an error and set the gpio to output. It could destroy the pin if it is high and a button press ...
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby InspecteurGadget » Sat Apr 28, 2018 5:45 pm

Thank's to you.

And what rotary encoder recommand you to use for vol+ vol- and push button for mute or select?
InspecteurGadget
 
Posts: 68
Joined: Thu Apr 27, 2017 3:33 am
languages_spoken: French, English
ODROIDs: Odroid C2
USB GPS, Bluetooth, Wifi
Emmc 8g Android M
Rtc modue

Re: App GpioShutdownService for C2

Unread postby joerg » Sat Apr 28, 2018 10:08 pm

A rotary encoder is not supported by my app. If you use simple push buttons then the app generates every 500ms the intent you have programed for the input. Means if you hold the button then in about 3 seconds it change the vol from 0 to 100. As I understand the rotary encoder, then the interrupt of rising and falling edges of two inputs need to counted and decided the direction. I think HK has already implemented a rotary encoder driver, but I never used.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby InspecteurGadget » Sat Apr 28, 2018 11:21 pm

hi thanks you have plan to update your app with this driver?
InspecteurGadget
 
Posts: 68
Joined: Thu Apr 27, 2017 3:33 am
languages_spoken: French, English
ODROIDs: Odroid C2
USB GPS, Bluetooth, Wifi
Emmc 8g Android M
Rtc modue

Re: App GpioShutdownService for C2

Unread postby joerg » Sun Apr 29, 2018 3:09 am

Maybe some day, but the next weeks I don't have time for it.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: App GpioShutdownService for C2

Unread postby InspecteurGadget » Mon Jun 11, 2018 4:49 am

Hi, It's possible to use your app with Tasker? any command possible?
InspecteurGadget
 
Posts: 68
Joined: Thu Apr 27, 2017 3:33 am
languages_spoken: French, English
ODROIDs: Odroid C2
USB GPS, Bluetooth, Wifi
Emmc 8g Android M
Rtc modue

Re: App GpioShutdownService for C2

Unread postby joerg » Wed Jun 13, 2018 6:58 am

Yes it should be possible. As I saw in the torque documentation, you can create receiving intents. And you can send any intent you want with ShutdownService.
joerg
 
Posts: 803
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

PreviousNext

Return to Android

Who is online

Users browsing this forum: No registered users and 1 guest