Issue Calling Command
Trying to run a simple play/pause command “input keyevent 126” but no response.
The command works as expected through Terminal. I get the initial verification screen to use FYT HW as the trigger for the button, I confirm, but then no reaction. Are there permissions missing?

Any ideas on this?
I'm a bit late, sorry. The problem is that with the new version of android it is not possible to do shell commands anymore.
I'm making a fork of the project that will allow to make commands through ADB
For the moment I could only test it on the android studio emulator because I'm far from my head unit but it works (normally) https://github.com/noenic/FytHWOneKey
https://user-images.githubusercontent.com/75330764/222843072-df3def04-88db-4b96-a16d-a23bb6687fa7.mp4
Very nicely done.
What's more: I am not activley maintaining this apk anymore as I don't use it myself for at least 2 years now. If you want to take over, please do so. (Next to that: I never was a real android programmer. I just needed an apk that did what I needed and it did not exist). If you want to rename the apk and its packagename you can do so as well. I can point everyone forward to your github and point every link (under my control) also to your github. What do you think?
Hi,
I believe that credit should be given to the person who did the most work on this project. I simply combined two existing projects and used the Java and Android basics that I am learning in my computer science program. I don't think I will be doing much more than that, as this is an ultra-specific specification and each head unit has different characteristics.
I will wait to test it on my actual head unit when I can, and if it works there, I will open a pull request.
If I decide to add a new important feature someday, I will reconsider your proposal.
Thank you.
I'm a bit late, sorry. The problem is that with the new version of android it is not possible to do shell commands anymore.
I'm making a fork of the project that will allow to make commands through ADB
Thank you for the effort. However, still not working for me. Uninstalled and reinstalled, and set the BAND button to "By ADB command" Have also tried "adb shell input keyevent 126" No go.
"input keyevent 126" through the Material Terminal works every time.
Please let me know if there is some other command I'm missing.
By the way the app used to generate several supporting (shortcut) apps, these don't exist anymore.
So looks like "Test ABD connection" fails for me. I'm guessing that's a typo you have there. Should be "ADB" not "ABD".
Anyway, the Developer options are enabled. Not sure if I need to set the port to something specific. Tried both 5555 and 5559. The headunit is rooted.
Thank you for testing, Let's start from the beginning, When you use the terminal, do you use adb or do you just write "input keyevent 126", If you use adb, do you connect with the IP localhost and the port 5555?
First you have to make sure that adb is available on your head-unit. Use the remoteADB application (I used the same library)
Connect to localhost and port 5555, do you get an error message? If you have a timeout try running this command "setprop service.adb.tcp.port 5555" it will enable ADB listening on port 5555 then restart
When you pressed "Test ABD" was there an error message? "refused" or "timeout"? The typo is only in the user interface.
What did you write in the call action? It should have been for example "shell:input keyevent 126".
I don't know what head-unit you have, guessing by the UI at the top I'd say a T'eyes CC3?
EDIT :
By the way the app used to generate several supporting (shortcut) apps, these don't exist anymore.
Can you give me a bit more informations about that ?
Yes, I have the CC3.
In terminal I enter "input keyevent 126"
I did try "shell:input keyevent 126"
I have not used ADB before with this unit.
Will check on the other items soon.
Can you give me a bit more informations about that ?
Maybe @hvdwolf can speak to this. I believe there was an app that specifically triggered the BAND button, and another app for another button, can't recall.
Maybe @hvdwolf can speak to this. I believe there was an app that specifically triggered the BAND button, and another app for another button, can't recall.
As fas as i know there was never a specific app for these actions, at least not by me. Up until the PX5 I made Xposed modules to control those keys but all from one Xposed module, not per key. Xposed was not possible anymore on the sc9853i and now the uis7862. That's why I wrote the FytHWOneKey.
So I get connection refused error. have tried using the setprop command in terminal and rebooting device, still the same error.
So I get connection refused error. have tried using the setprop command in terminal and rebooting device, still the same error.
Well, this shows that the ADB service is not reachable. It's weird on my CC3 I can connect to ADB as localhost, I just can't remember how...
I know I used the setprop command, I just don't know if it's "setprop persist.adb.tcp.port 5555" or "setprop service.adb.tcp.port 5555"
Then I could access ADB from my laptop by connecting to the head unit's hotspot.
I have tried both commands now, and neither seem to work.
try to connect with a laptop in ADB to the head unit first using the hotspot.
Hi, finally back home I was able to try to install this on my CC3, and for me it works, it's not perfect, it doesn't work the first time you install it (you have to completely delete the application and reinstall it)
https://user-images.githubusercontent.com/75330764/226027063-8089aa70-8b07-467d-970a-9df1d289242d.mp4
Sorry for the quality of the video, it's really done on the fly
Thanks for this. I’ll try again
I had the same issues. ADB refusing connection. But I was able to solve it.
In addition to enabling USB Debugging in the Developers Menu, I also went to the Default USB configuration, also in the Developers Menu and found that it was configured for "No Data Transfer". If that is your case, change that to "File Transfer".
So, you need to make sure that, in the Developer's Menu:
(1) USB Debugging is set to ON (2) Default USB Configuration is set to "File Transfer"
As soon as I did that, the ADB connection issue was solved, and I can now successfully send key events to my unit using ADB.
BTW... great job on this app. I know it as a very specific application, but it has solved an issue that has been plaguing the Porsche community using these FYT units and the ability to send the appropriate signal/control from steering wheel. Thanks!
I do want to ask a question though. Now, when I send the key event command, it makes my app (in this case CarPlay) blink. Im sending the "shell:input keyevent 87" command to skip to next song in CarPlay. But every time I do that, CarPlay app blinks. If I delete the command and the steering wheel button then doesn't do anything (a blank command), it still blinks when button is pressed. It is like if it wants to change to another app, but returns to the current CarPlay app. This doesn't happen with all apps. Any ideas?
Hi there,
Thank you for clarifying the USB transfer mode.
Regarding the CarPlay screen flicker issue, I experienced a similar problem initially (a brief black screen when pressing a button). My theory is that the application displaying the CarPlay interface doesn't handle being in the background well. This likely happens because you're invoking a service from another application, causing the CarPlay interface to momentarily disappear.
Interestingly, I no longer encounter these flickers. While I can't pinpoint the exact fix, I regularly update my head unit whenever a new update is available (you can check for updates here: TEYES CC3 Updates). If you're using a CC3, keeping it updated could help resolve the issue.
Regarding FytHWOneKey, I've been using my fork for over a year without any malfunctions. The buttons always perform their programmed functions, to the point where I've forgotten there's middleware involved.
In the following video, I show the application of this solution in a 2015 Porsche Macan S modifying a steering wheel button configuration. The hard coded configuration was making this button useless. I have a FYT 7862 12.3” Android Unit.
Link to Video:
Finally, I figured it out! I modified the Diamond Button SW Control for my 12.3 Android unit https://youtu.be/Nk9kdunzBcI
@noenic I did see your fork and your additional improvements. Would you like to be co-owner of this repository? Or do you want me to declare that I stopped development in this repository and put a big link from this repository to your repository in the Readme? I did indeed stop further development, but I would like to both link to your repository and link from this XDA-thread to your repository, and of course give you the credits you deserve.
How did you guys get the service.adb.tcp.port command to persist on reboots? when I issue: setport persist.adb.tcp.port 5555 or setport service.adb.tcp.port 5555 it works fine until I reboot the radio..then the setting is lost and I have to go back into a terminal to set it again.
What's the right method to get this to persist across reboots?
Read the several topics in XDA. Simply add "service.adb.tcp.port=5555" to your config.txt and flash it (after having enabled the developer mode and enabled debugging) Or use my FET tool that allows you to modify the config.txt.
Edit: Sorry, I forgot to add that if you want to edit the config.txt in my FET tool, you also need to have your system rooted. That is not necessary for the first mentioned flashing step.
Read the several topics in XDA. Simply add "service.adb.tcp.port=5555" to your config.txt and flash it (after having enabled the developer mode and enabled debugging) Or use my FET tool that allows you to modify the config.txt.
Edit: Sorry, I forgot to add that if you want to edit the config.txt in my FET tool, you also need to have your system rooted. That is not necessary for the first mentioned flashing step.
Thanks, I'll take a look..apparently using google with keywords such as "persistent config on Android" or "saving ADB port on android" were not the keywords to find that information. I appreciate you replying and pointing me in the right direction.
Where does the logfile go? I have this set up and appears to be intercepting the canbus command as I see the icon flicker in the status bar (and it prompted me what app to use).. however, input keyevent 87 doesn't seem to work. If I got into a remote adb shell and type the command the song switches..so I'm trying to determine if the app is indeed sending the command as expected or at least determine what it sees in the logs. thanks for any pointers.
Assuming you are writing the string correctly, starting with “shell:”, as such “shell:input keyevent 87”?
Assuming you are writing the string correctly, starting with “shell:”, as such “shell:input keyevent 87”?
yes
Where does the logfile go? I have this set up and appears to be intercepting the canbus command as I see the icon flicker in the status bar (and it prompted me what app to use).. however, input keyevent 87 doesn't seem to work. If I got into a remote adb shell and type the command the song switches..so I'm trying to determine if the app is indeed sending the command as expected or at least determine what it sees in the logs. thanks for any pointers.
Logs are written to internal memory folder FET_Logs