App GpioShutdownService for C2

Moderators: mdrjr, odroid

Re: App GpioShutdownService for C2

Unread postby InspecteurGadget » Wed Jun 13, 2018 2:19 pm

Yes I use torque with tasker : tasker open an app when I exceed 3000rpm.
And I use tasker with screen filter: tasker applied I night filter at 8P.M.

But if tasker work with your app we can add a button to any spot.

For the moment your application works in the material direction towards software (button to action volume for example).

But the best would be in the software to hardware direction(at a certain time, it performs the lighting of the inner light for example).

Edit: with tasker it exist an AutoArduino plugin, that communicate with arduino on usb or wifi or ethernet, we should make an identical plugin to communicate with our gpio
InspecteurGadget
 
Posts: 67
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 14, 2018 6:51 am

Sorry, I made a mistake in my last post. I was thinking 'tasker' but I wrote 'torque'. So I mean with tasker you can program receiving intents. When I am back at home and find some free time I can check this and give some example.
http://tasker.dinglisch.net/userguide/en/intents.html
joerg
 
Posts: 797
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 14, 2018 2:54 pm

do not worry, my english is not very good.
If I find solutions I'll give you
InspecteurGadget
 
Posts: 67
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 » Fri Jun 15, 2018 12:07 am

Hi with androidmanifest.XML of your app we can send intent with tasker
InspecteurGadget
 
Posts: 67
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 » Fri Jun 15, 2018 7:59 pm

OK, I would need to extend my app for receiving intents. So far it only receives intent for system shutdown and for boot complete. I could do but it would take some time.
And to test sending intents from my app to tasker I need to understand how to add a receiving intent in tasker and the syntax of it. Yesterday I looked into it but without success so far.
joerg
 
Posts: 797
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 » Mon Jun 18, 2018 7:51 pm

There is now a new version uploaded in first post.
I added the functionality to send and receive intents. You can adjust tasker to work with this intents.
GpioShutdownService sends the status of the used inputs in this form:
com.jw.shutdownservice.GpioShutdownService.GPIO_STATE_CHANGED
with extra data:
int gpio, int value
Every state change from 0 to 1 or from 1 to 0 is sent.
In the ExtraXAction the gpio number must be set, the action string can be left empty. The zero is not allowed as gpio number.

To receive with tasker add a event system:intent received under Profiles:
screen_event_receive_gpio.png
screen_event_receive_gpio.png (35.57 KiB) Viewed 737 times


And a Task to make something with it:
screen_task_popup.png
screen_task_popup.png (39.02 KiB) Viewed 737 times


Generates a pop up:
screen_gpio_status_changed.png
screen_gpio_status_changed.png (22.55 KiB) Viewed 737 times


All of the not used gpio can be set with tasker. The Action must be in this form:
com.jw.shutdownservice.action.SET_GPIO
with extra data:
int gpio, int value

To send the intent with tasker add a task system:send intent and put the above string as Action, under first Extra gpio:22, under second Extra value:1
Allowed values are 0 and 1.
screen_action_set_gpio.png
screen_action_set_gpio.png (33.86 KiB) Viewed 737 times
joerg
 
Posts: 797
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 19, 2018 1:41 pm

Oh yes nickel thank's to you Joeg =)
InspecteurGadget
 
Posts: 67
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 » Tue Jun 19, 2018 10:12 pm

Hi,
I test intent received,
Exactly like your 2 firts picture
I d'ont have popup
InspecteurGadget
 
Posts: 67
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 20, 2018 1:37 pm

Have you got checked Preferences:Misc:Alow External Access ?
joerg
 
Posts: 797
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 » Wed Jun 20, 2018 6:45 pm

Yes I check it
How can I test gpio to be sure Im not burn it? I've a multimeter
InspecteurGadget
 
Posts: 67
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 21, 2018 12:47 am

Hi, you would see a message in logcat as this, when the intent is sent:
Code: Select all
com.jw.shutdownservice D/com.jw.gpioshutdown: Intent { act=com.jw.shutdownservice.GpioShutdownService.GPIO_STATE_CHANGED (has extras) }

The intent is sent when the gpio input changes from 1 to 0 or from 0 to 1.

Code: Select all
adb shell logcat|grep shutdownservice


And you always should use a resistor of 1k or 2k to connect the gpio to GND. Only to be sure not to burn the gpio.
joerg
 
Posts: 797
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 22, 2018 5:21 pm

Hi,
It work :)
I thinks its my relay board that not compatible with 3.3v .

I bought one this week
InspecteurGadget
 
Posts: 67
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

Previous

Return to Android

Who is online

Users browsing this forum: No registered users and 4 guests