App GpioShutdownService for C2 / N2 / C4 / XU

jwilson
Posts: 26
Joined: Tue Feb 27, 2018 2:00 pm
languages_spoken: english
ODROIDs: C2, XU4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by jwilson »

Thank you for your prompt response.

I've been reading up wiringPi and trying to understand what you mean by
you need to put the pin number in wiringPi format
. The only thing I know so far is that the GPIO number for pin 29 is 228. Any tips on how the wiringPi format would look like in the 'Shutdown Pin'?

Appreciate the help.

User avatar
joerg
Posts: 1406
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 96 times
Been thanked: 220 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by joerg »

I see, the 228 is the number of the pin when it is used by sysfs. I initiate the wiringPi in normal mode and not in sysfs mode. Hence the numbering is different. The wpi number of pin 29 is 21. You can see this relation on the wiki pages of Odroid C2: https://wiki.odroid.com/odroid-c2/hardw ... connectors
I used it this way because the wpi numbers usually stay the same over different odroid models, the sysfs numbers not.
These users thanked the author joerg for the post:
jwilson (Tue Aug 11, 2020 3:22 am)

jwilson
Posts: 26
Joined: Tue Feb 27, 2018 2:00 pm
languages_spoken: english
ODROIDs: C2, XU4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by jwilson »

Hm, so I tried setting the 'Shutdown Pin' to 21 (having read it in your first reply), but I couldn't get it to work. I have a push button switch (NO) connected to pins 29 and 30. I configured 21 in settings, then exited the app by clicking on the < icon on the top. Then pressed the button and nothing happens. The same switch works fine on Linux so I know the switch isn't bad. I also checked under SuperUser and ensured this app is listed there.

jwilson
Posts: 26
Joined: Tue Feb 27, 2018 2:00 pm
languages_spoken: english
ODROIDs: C2, XU4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by jwilson »

Ok I take that back. It does work, I had to change the shutdown delay to 0 to realize it was working. I didn't realize that the pins need to remain shorted (at least for the duration of the 'Shutdown Delay') for the shutdown to activate. I was simply pressing and releasing the push button and that wouldn't activate the shutdown when I had it set to a higher value.

User avatar
joerg
Posts: 1406
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 96 times
Been thanked: 220 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by joerg »

OK. fine that it works. Initially the app was developed for use in car with the ignition wire that changes to constantly low when the car is switched off.
If you want only a short press, then you can use also the Extra Pin and Extra Action functions and put as action any command that can be given at the adb console, e.g 'reboot -p'.

jwilson
Posts: 26
Joined: Tue Feb 27, 2018 2:00 pm
languages_spoken: english
ODROIDs: C2, XU4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by jwilson »

Actually, I'm totally fine the way it works currently. I've set the delay to 3000, this way an accidental press won't poweroff the device. What would be great is if the app could set the wakeup gpio, as it does in Linux. That said, this app is life saver. The alternative is to download entire Android source code, then change one word in the DTS file and recompile.

User avatar
joerg
Posts: 1406
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 96 times
Been thanked: 220 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by joerg »

jwilson wrote:
Tue Aug 11, 2020 3:51 am
The alternative is to download entire Android source code, then change one word in the DTS file and recompile.
Sadly it is like that. The wake up is managed by uboot and it need this devicetree setting and also the variable in boot.ini. I cannot modify the devicetree with my app to make it work more comfortably.
But you don't need to download whole Android source. Simply download the image for fastboot flashing and get the default devicetree. Then you can modify it:

Code: Select all

$ fdtget meson64_odroidc2.dtb /gpio_keypad status
disabled
$ fdtput -t s  meson64_odroidc2.dtb /gpio_keypad status okay
$ fdtget meson64_odroidc2.dtb /gpio_keypad status
okay
And finally flash it with fastboot.

kouklo
Posts: 35
Joined: Wed Jun 26, 2019 9:53 am
languages_spoken: english
Has thanked: 3 times
Been thanked: 1 time
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by kouklo »

@joerg Do you think it's possible to modify your app to work with USB instead of just GPIO? I know the app Tasker can do something similar to this. When the car turns off/on the PSU sends some sort of "ping" or keyboard short cut through the USB that's plugged into it. Your app sees that incoming signal and starts the shut down/sleep process in some sort of terminal.

I would much rather use your app than Tasker because 1st your a cool guy and I love your work and second, Tasker can be a pain in the butt to use. LOL

User avatar
joerg
Posts: 1406
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 96 times
Been thanked: 220 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by joerg »

Maybe yes, I have to check this. I dealed already with usb time ago for another app.
But I need to find time for it. At the moment I am busy with setting up the N1 with new Debian, OMV5 and Nextcloud.

kouklo
Posts: 35
Joined: Wed Jun 26, 2019 9:53 am
languages_spoken: english
Has thanked: 3 times
Been thanked: 1 time
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by kouklo »

joerg wrote:
Sun Nov 15, 2020 5:50 am
Maybe yes, I have to check this. I dealed already with usb time ago for another app.
But I need to find time for it. At the moment I am busy with setting up the N1 with new Debian, OMV5 and Nextcloud.
So I'm actually working with someone right now to make a universal "smart" power supply that will work with any SBC on the market. It will have 12V input and 3V, 5V, 12V output. We are working to get SUPER clean power out of it (especially important for audio). What makes this car PSU "smart" is when it senses that the car is on/off it sends a keyboard shortcut/ping using USB to whatever it's plugged into.
Obviously, keyboard shortcuts are easy for Windows and (I think for) Linux/Ubuntu but it's a completely different issue for Android as I'm sure you know. Our biggest problem right now is getting Android to sleep/shut down with just some simple keystrokes.

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

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by mad_ady »

If you can send the KEYCODE_POWER (https://developer.android.com/reference ... CODE_POWER) I think it should work directly.

User avatar
joerg
Posts: 1406
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 96 times
Been thanked: 220 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by joerg »

@mad_ady: Yes, one can send this code from command line. But I think what @kouklo is refering to, is to have his power supply connected to the sbc by usb and send via this connection the command.
That would be possible if the controller of this power supply emulates a hid keyboard on his usb interface. When Android knows this vid/pid and starts the keyboard driver, then the controller can send this keycode.
This would shutdown immediately.
But also would be possible to connect from my app with libusb to this controller and read commands and do a delayed shutdown. This delayed shutdown is something that makes interesting using my app.
In my car I use it with 10min delay, so I can take petrol , go paying and come back and the C4 is already there, no need to boot up again.

kouklo
Posts: 35
Joined: Wed Jun 26, 2019 9:53 am
languages_spoken: english
Has thanked: 3 times
Been thanked: 1 time
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by kouklo »

joerg wrote:
Sun Nov 15, 2020 11:48 pm
@mad_ady: Yes, one can send this code from command line. But I think what @kouklo is refering to, is to have his power supply connected to the sbc by usb and send via this connection the command.
That would be possible if the controller of this power supply emulates a hid keyboard on his usb interface. When Android knows this vid/pid and starts the keyboard driver, then the controller can send this keycode.
This would shutdown immediately.
But also would be possible to connect from my app with libusb to this controller and read commands and do a delayed shutdown. This delayed shutdown is something that makes interesting using my app.
In my car I use it with 10min delay, so I can take petrol , go paying and come back and the C4 is already there, no need to boot up again.
That's exactly what I'm talking about bro!! Please don't think I'm trying to pressure you into stoping everything and working on this, I'm just curious if it's even possible. For all I know my idea is just a stupid fantasy. You got to admit tho, it's an interesting idea. Heck, if I decide to bring my PSU to market I might even work with you on integrating the app into the hardware somehow. LOL

User avatar
joerg
Posts: 1406
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 96 times
Been thanked: 220 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by joerg »

Don't worry.
If I have time and like to do it, I will do it. ;)

zyssai
Posts: 244
Joined: Wed Jan 27, 2021 6:42 pm
languages_spoken: english, french
ODROIDs: Odroid N2+ 2Gb
Vu7a+
Has thanked: 78 times
Been thanked: 27 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by zyssai »

Hi joerg.
I followed your instructions on the last page for using your app with tasker.
I bought macrodroid app few months ago, it's similar to tasker.
But i'm not able to receive detailled event.

First, do you need to put something into Extra1Action?
I leaved it empty.

Image

Second, i don't know what to enter in the Intent Extra field.
If i leave it empty, Macrodroid receive correctly event but don't know what gpio it was (i need to use multiples one)
Image

Image
As you can see i setup a popup, defined permanent int variables but they stays empty.

Hope you have some time to help me

misha
Posts: 1
Joined: Mon Mar 01, 2021 4:58 am
languages_spoken: english
ODROIDs: C1+
Has thanked: 0
Been thanked: 0
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by misha »

Hi @joerg
Is it possible to upload a version that works with Odroid C1. I tried 1.8.0 but it is probably for a newer android version and it cannot be installed. On my Odroid C1 I use Android 4.4, unfortunately the newer version of android is not stable on C1.

User avatar
joerg
Posts: 1406
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 96 times
Been thanked: 220 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by joerg »

@misha, can you this version I found in my C1 folder:
GpioShutdownService-1.5.1.zip
(1.12 MiB) Downloaded 23 times
I haven't tried for years on C1. :?

User avatar
joerg
Posts: 1406
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 96 times
Been thanked: 220 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by joerg »

@zyssai, I think you need to put the string gpio in Extra Name and the number of GPIO in Extra value to match. I am not familar with macrodroid. Can you add an additional Extra? Then you can put string value in Extra Name and 0 or 1 in Extra value to match.
In my app you can leave the ExtraX Action empty. When the ExtraX Pin setting is filled, a intent will be fired every value change of this GPIO, with extras "gpio":x[Integer] and "value":x[Integer].
Hope it helps.

zyssai
Posts: 244
Joined: Wed Jan 27, 2021 6:42 pm
languages_spoken: english, french
ODROIDs: Odroid N2+ 2Gb
Vu7a+
Has thanked: 78 times
Been thanked: 27 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by zyssai »

Ok thanks for your answer, i will try this week and let you know if it worked.

zyssai
Posts: 244
Joined: Wed Jan 27, 2021 6:42 pm
languages_spoken: english, french
ODROIDs: Odroid N2+ 2Gb
Vu7a+
Has thanked: 78 times
Been thanked: 27 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by zyssai »

I understood how it works, thanks for your help

Image
Image

Image
Image

As you have explained to me, i must create extra with gpio and the wpi number of the pin, and optionally an extra with value of the pin.

Just a thing, how is working holdpower pin? 23 is wpi or physical number of pin? I need to apply 3.3v, and if it stopped, odroid is shutted down?

Thanks again for your great app!

User avatar
joerg
Posts: 1406
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 96 times
Been thanked: 220 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by joerg »

Holdpower is an output. It's wpi number. Please do not apply voltage, this could destroy destroy your board.
These users thanked the author joerg for the post:
zyssai (Mon Mar 08, 2021 7:38 pm)

zyssai
Posts: 244
Joined: Wed Jan 27, 2021 6:42 pm
languages_spoken: english, french
ODROIDs: Odroid N2+ 2Gb
Vu7a+
Has thanked: 78 times
Been thanked: 27 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by zyssai »

Hi joerg,
I'm using all the extra pins. Everything is working perfectly with N2+.
However I need to add 2 more ones.
Can I hope an update of the app? Or is it hardware limited?
Thanks!

User avatar
joerg
Posts: 1406
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 96 times
Been thanked: 220 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by joerg »

Hi @zyassi, sure I can add 2 more. Give me some days...Need to update the app to latest AndroidStudio and add some more functionality...

zyssai
Posts: 244
Joined: Wed Jan 27, 2021 6:42 pm
languages_spoken: english, french
ODROIDs: Odroid N2+ 2Gb
Vu7a+
Has thanked: 78 times
Been thanked: 27 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by zyssai »

joerg wrote:
Mon Sep 20, 2021 12:09 am
Hi @zyassi, sure I can add 2 more. Give me some days...Need to update the app to latest AndroidStudio and add some more functionality...
I must say that i didn't thought it was possible. It's incredible, thanks you!! ;)
And, take your time!!!

User avatar
joerg
Posts: 1406
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 96 times
Been thanked: 220 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by joerg »

It's ready! You can find it at first post. (Only tested on C4 with LineageOS)

zyssai
Posts: 244
Joined: Wed Jan 27, 2021 6:42 pm
languages_spoken: english, french
ODROIDs: Odroid N2+ 2Gb
Vu7a+
Has thanked: 78 times
Been thanked: 27 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by zyssai »

joerg wrote:
Tue Sep 21, 2021 1:17 am
It's ready! You can find it at first post. (Only tested on C4 with LineageOS)
You made it too fast :lol:
Thanks for your support!
Last edited by zyssai on Thu Sep 23, 2021 2:13 pm, edited 1 time in total.

zyssai
Posts: 244
Joined: Wed Jan 27, 2021 6:42 pm
languages_spoken: english, french
ODROIDs: Odroid N2+ 2Gb
Vu7a+
Has thanked: 78 times
Been thanked: 27 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by zyssai »

Just another question, is there a way to save global settings (file.cfg or something else), if I need to backup and restore system one day?

User avatar
joerg
Posts: 1406
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 96 times
Been thanked: 220 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by joerg »

I never have tried. But the settings file can be found and listed here:

Code: Select all

adb shell cat data/data/com.jw.shutdownservice/shared_prefs/com.jw.shutdownservice_preferences.xml
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
    <string name="pin_extra5"></string>
    <string name="pin_shutdown">24</string>
    <string name="pin_extra4"></string>
    <string name="pin_extra3"></string>
    <string name="delay_shutdown">120000</string>
    <string name="pin_extra2"></string>
    <string name="pin_extra1"></string>
    <string name="delay_onstart">10000</string>
    <string name="pin_restart">28</string>
    <string name="action_extra12">input keyevent KEYCODE_VOLUME_UP</string>
    <string name="pin_extra12">26</string>
    <string name="pin_extra11"></string>
    <string name="pin_extra10"></string>
    <string name="pin_holdpower">23</string>
    <boolean name="progress" value="true" />
    <string name="pin_heartbeat"></string>
    <string name="pin_remotePiSequence"></string>
    <string name="pin_extra9"></string>
    <string name="pin_extra8"></string>
    <string name="pin_extra7"></string>
    <string name="time_heartbeat"></string>
    <string name="pin_extra6"></string>
</map>
It can be pulled and pushed with adb. So I think it must work.
These users thanked the author joerg for the post:
zyssai (Tue Sep 21, 2021 3:46 am)

zyssai
Posts: 244
Joined: Wed Jan 27, 2021 6:42 pm
languages_spoken: english, french
ODROIDs: Odroid N2+ 2Gb
Vu7a+
Has thanked: 78 times
Been thanked: 27 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by zyssai »

Thanks joerg, will take a look and let you know

zyssai
Posts: 244
Joined: Wed Jan 27, 2021 6:42 pm
languages_spoken: english, french
ODROIDs: Odroid N2+ 2Gb
Vu7a+
Has thanked: 78 times
Been thanked: 27 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by zyssai »

Hi joerg, i don't know what is happening.
I tried to update app on my N2+.
I have 'app not installed' error.
So I removed old version, and tried but still can't install new version.

Have you an idea?
Thanks

User avatar
joerg
Posts: 1406
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 96 times
Been thanked: 220 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by joerg »

Try with adb install -t ... or wait, I will upload a version with a bugfix.
This happens when a new AndroidStudio needs to convert a project written with older AndroidStudio. There is missing a setting in gradle properties.

[edit]
Uploaded new version.
These users thanked the author joerg for the post (total 2):
zyssai (Thu Sep 23, 2021 2:33 am) • odroid (Thu Sep 23, 2021 9:23 am)

zyssai
Posts: 244
Joined: Wed Jan 27, 2021 6:42 pm
languages_spoken: english, french
ODROIDs: Odroid N2+ 2Gb
Vu7a+
Has thanked: 78 times
Been thanked: 27 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by zyssai »

Successful update this morning with last version.
Many thanks joerg for your support.
Will test news extra pins mid October

zyssai
Posts: 244
Joined: Wed Jan 27, 2021 6:42 pm
languages_spoken: english, french
ODROIDs: Odroid N2+ 2Gb
Vu7a+
Has thanked: 78 times
Been thanked: 27 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by zyssai »

I need to send lights command of my car to the Odroid.
So I will wire it to a dash lamp. But this is 12V.
Is there a simple way to connect it to gpio, other than using a relay module?
Thanks

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

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by mad_ady »

A level shifter? But It needs to be decoupled in order not to risk overvoltage to the board

zyssai
Posts: 244
Joined: Wed Jan 27, 2021 6:42 pm
languages_spoken: english, french
ODROIDs: Odroid N2+ 2Gb
Vu7a+
Has thanked: 78 times
Been thanked: 27 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by zyssai »

A level shifter? To transform 12v to 3.3v is that do you mean?

User avatar
joerg
Posts: 1406
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 96 times
Been thanked: 220 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by joerg »

level shifter is too much. They are typically used in communication like i2c.
A simple network of resistors and a zener diode is enough.
Bildschirmfoto vom 2021-09-25 10-35-48.png
Bildschirmfoto vom 2021-09-25 10-35-48.png (7.04 KiB) Viewed 527 times

zyssai
Posts: 244
Joined: Wed Jan 27, 2021 6:42 pm
languages_spoken: english, french
ODROIDs: Odroid N2+ 2Gb
Vu7a+
Has thanked: 78 times
Been thanked: 27 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by zyssai »

Thanks!
So Vin at top left, and vout to gpio at right?
Do you think the values are correct? And if it's classic zener diode 1n4007?
Sorry not an advanced electrician :lol:

User avatar
joerg
Posts: 1406
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 96 times
Been thanked: 220 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by joerg »

Yes, the values are correct. 12V / 3700 Ohm x 1000 Ohm = 3,24 V.
And no, 1N4007 is a classic diode, not a zener diode. Zener diodes have defined breakthrough voltage in opposite direction, and therefor are used for limiting voltage.
Eg.: BZX55-C3V3, 1N5226B
And yes, on the left input 12V and on the right gpio connection.
These users thanked the author joerg for the post:
odroid (Mon Sep 27, 2021 9:30 am)

zyssai
Posts: 244
Joined: Wed Jan 27, 2021 6:42 pm
languages_spoken: english, french
ODROIDs: Odroid N2+ 2Gb
Vu7a+
Has thanked: 78 times
Been thanked: 27 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by zyssai »

That couldn't be most clear. Thanks again!

User avatar
odroid
Site Admin
Posts: 38212
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 2068 times
Been thanked: 1237 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by odroid »

Moved from C2 sub-forum.
These users thanked the author odroid for the post:
zyssai (Mon Sep 27, 2021 12:51 pm)

zyssai
Posts: 244
Joined: Wed Jan 27, 2021 6:42 pm
languages_spoken: english, french
ODROIDs: Odroid N2+ 2Gb
Vu7a+
Has thanked: 78 times
Been thanked: 27 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by zyssai »

Hi joerg.

Just found this one on an old amplifier.
Identified BZX 550 15 (or 55C, didn't know)

Do u think it can work?

Image

User avatar
joerg
Posts: 1406
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 96 times
Been thanked: 220 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by joerg »

I think no, it seems to be a 15V zener diode.

zyssai
Posts: 244
Joined: Wed Jan 27, 2021 6:42 pm
languages_spoken: english, french
ODROIDs: Odroid N2+ 2Gb
Vu7a+
Has thanked: 78 times
Been thanked: 27 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by zyssai »

Thanks, i ordered some 3v3, and will install this week.

zyssai
Posts: 244
Joined: Wed Jan 27, 2021 6:42 pm
languages_spoken: english, french
ODROIDs: Odroid N2+ 2Gb
Vu7a+
Has thanked: 78 times
Been thanked: 27 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by zyssai »

Hi joerg.

Just seen that there is typo error in the diagram you draw, it's not 2.7k resistor but 3.7k, else Vout is 4.4v.
So as not to mislead someone who would like to use it.

I think I will use 4700ohm resistor because when engine car is running, it is mostly 14.6v, so 3.1v at output, i think it will be good.

Have a nice day

User avatar
joerg
Posts: 1406
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 96 times
Been thanked: 220 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by joerg »

My values are correct.
To calculate you take the supply voltage and devide it by the summ of both resistors, then you multiply it with the resistor beside the zener diode. In case of 14.4V you get about 3.9V, but it's OK, because the zener clamps the voltage to 3.3V.
You can increase the upper resistor a little bit, but not too much, you could get too low voltage at the gpio input.

zyssai
Posts: 244
Joined: Wed Jan 27, 2021 6:42 pm
languages_spoken: english, french
ODROIDs: Odroid N2+ 2Gb
Vu7a+
Has thanked: 78 times
Been thanked: 27 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by zyssai »

Ok I'm sorry, just didn't know that it was the summ needed, thought it was only the input resistor.
I'm totally newbie with diodes, my bad.

After checking the datasheet of bzx55, voltage range seems to be 3.1 to 3.5v, so I think 3.3k could be a good choice.

zyssai
Posts: 244
Joined: Wed Jan 27, 2021 6:42 pm
languages_spoken: english, french
ODROIDs: Odroid N2+ 2Gb
Vu7a+
Has thanked: 78 times
Been thanked: 27 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by zyssai »

Hi.

I have no reaction with wpi 26. I don't know what is the problem.
For the moment I didn't received bzx55, so I tried with a relay that short to ground gpio pin 32 (with pull up resistor).
I can't try another pin, because it's not my car and I have him back.
Just wanna know if pin 32 has something that would do it doesn't work.

User avatar
joerg
Posts: 1406
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 96 times
Been thanked: 220 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by joerg »

Have you tried gpio tool in adb shell?
Just do a gpio readall and look what it reports about the pin. Does it report ALT1, ALT2, etc, then the pin is occupied by another function and you can have a chance to remove a not needed devicetree overlay.

zyssai
Posts: 244
Joined: Wed Jan 27, 2021 6:42 pm
languages_spoken: english, french
ODROIDs: Odroid N2+ 2Gb
Vu7a+
Has thanked: 78 times
Been thanked: 27 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by zyssai »

joerg wrote:
Mon Oct 11, 2021 12:12 am
Have you tried gpio tool in adb shell?
Just do a gpio readall and look what it reports about the pin. Does it report ALT1, ALT2, etc, then the pin is occupied by another function and you can have a chance to remove a not needed devicetree overlay.
I'm obtaining this:

Image

But don't know what is the V column. Does it mean that is it desactivated?

User avatar
joerg
Posts: 1406
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 96 times
Been thanked: 220 times
Contact:

Re: App GpioShutdownService for C2 / N2 / C4 / XU

Post by joerg »

Hi @zyssai, V means the actual value at the moment of the command. I see that wpi 26 is configured as input. So if you apply 3.3V to the input, it's value should change to 1.

Post Reply

Return to “Android”

Who is online

Users browsing this forum: No registered users and 2 guests