USB programming - Xperia Arc Android Development

I'm using Xperia Arc with 2.3.4 and wrote a small app to check for USB accessories via an intent filter BUT it's not happening...
The device senses when I add the usb sensor (conected via an OTG cable) an tells me it's name but my app can't see the accessory ...
I'm developing using GoogleAPI (API Level 10) and I use com.android.future.usb.accessory.
Anyone knows anything about this please let me know.
Thanks
================================================
It seems there is an option in the kernel to filter out 'unwanted' usb devices.
That is external accessories/devices, keyboards, mice, printers, cameras and such are allowed, but nothing else (like proprietary devices/accessories).
here's a description:
http://forum.xda-developers.com/showthread.php?t=1246116

Related

How to pair a Wireless Xbox 360 Controller and fix Camera Spin

Video that demonstrates the setup, show an example of the problem, the steps to solve the problem, and the working solution!!!
http://www.youtube.com/watch?v=9czISrLGXNI&hd=1
So first lets just talk about the Hardware Setup.
Xbox 360 Wireless Controller
OTG Cable.
Xbox 360 Wireless Dongle (This is meant for the PC but also works on the Android, and quite lovely on emulators)
This setup alone works well for allot of the emulators out there, however some of the games are not working with the controller, for instance GTA3 , Dead Trigger, Shadowgun and others. So by reading the logcat I was able to figure out a solution. Snippet of logcat below
--------------------
07-22 19:55:48.039 350 405 D EventHub: No input device configuration file found for device 'Xbox 360 Wireless Receiver'.
07-22 19:55:48.059 350 405 I EventHub: New device: id=4, fd=269, path='/dev/input/event3', name='
360 Wireless Receiver', classes=0x80000341, configuration='', keyLayout='/system/usr/keylayout/Generic.kl', keyCharacterMap='/system/usr/keychars/Generic.kcm', builtinKeyboard=false, usingSuspendBlockIoctl=true, usingClockIoctl=false
<6>[ 117.819812] usb 2-1: new full speed USB device number 2 using tegra-ehci
<6>[ 117.873142] usb 2-1: New USB device found, idVendor=045e, idProduct=0719
<6>[ 117.873219] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
<6>[ 117.873337] usb 2-1: Product: Xbox 360 Wireless Receiver for Windows
<6>[ 117.873403] usb 2-1: Manufacturer: ©Microsoft
<6>[ 117.873518] usb 2-1: SerialNumber: FE425DB0
-------------------
So when i searched through the /system/usr/keylayout/ I saw there was a profile for the xbox 360 wired controller so I thought why not copy the profile and name it a wireless xbox controller. This idea worked. You name keylayouts by Vendor ID and Product ID which I also was able to get from the logcat. What is nice about this is I think we can use this to solve issues with other controllers as well, but I don't know of any that are also having problems.
For this solution a rooted Nexus 7 is required. I already have a step by step video on rooting if you need the help on the nexus 7. but after obtaining root you need to enter into the Android Shell (i was using Terminal Emulator for Android on the Nexus 7 downloaded from the google play store ) . I entered this commands to get this all setup.
su
cd /system/usr/keylayout/
mount -o remount,rw /system
cp Vendor_045e_Product_0291.kl Vendor_045e_Product_0719.kl
chmod 644 Vendor_045e_Product_0291.kl
chmod 644 Vendor_045e_Product_0719.kl
exit
exit
Restart System and Enjoy!!!!
UPDATE 2
I attached the Key Character Mapping file as well. This is found in /system/usr/keychars . For nexus 7 users this isn't necessary but some other devices have different generic .kcm so this is needed (in the process of being confirmed) PLEASE NOTE THE .KCM Extension
UPDATE
Some of you do not have the Keylayout file for even the USB Xbox Controller, I am attaching the file (it needs to be unzipped), you will need to paste it into the /system/usr/keylayout/ folder. You also could rename this to the Wireless Xbox Controller Vendor and Product ID and copy it 'Vendor_045e_Product_0719' .
Update 2: When copying the file you still need to mount the Systems folder using the command listed above: "mount -o remount,rw /system" and also remember to modify its priveledges using the
"chmod 644 Vendor_045e_Product_0291.kl"
PLEASE NOTE THE .KL EXTENSION FOR THIS FILE
Good work!
Nice. If I didn't already use PS3 controllers I'd check it out.
Sent from my Nexus S using xda premium
So does it have to be the pc version of the xbox controller? Or a regular xbox controller?
Sent from my One X using xda premium
Is Vendor_045e_Product_0291.kl created when you sync your wireless controller? because I don't have such file on my keylayout folder.
Cybore said:
Is Vendor_045e_Product_0291.kl created when you sync your wireless controller? because I don't have such file on my keylayout folder.
Click to expand...
Click to collapse
Are you using a Rom? I was doing this with a rooted verion of stock 4.1.1.
I'm not at my Nexus 7 for the rest of the night but can upload the file tomorrow if you don't have it. But yes Vendor_045e_Product_0291.kl should be for this to work. In the case its not we will have to push the file to the folder and then set the permission for it.
ptesmoke said:
So does it have to be the pc version of the xbox controller? Or a regular xbox controller?
Sent from my One X using xda premium
Click to expand...
Click to collapse
There is no specific controllers to PC or Xbox. A wired controller works with both PC and 360 due to it being a USB connection. A wireless controller still can work with PC if you purchase a wireless adapter. That is what I do: sync up with this PC adapter when I want to play PC games with a controller, and sync the same controller up to my 360 on the off chance I want to play some Halo or something.
Anyway, I assume the same method of hooking up a wired 360 controller to an Android device is applicable as it uses the same drivers as the wireless one, just requires one less piece of equipment.
ptesmoke said:
So does it have to be the pc version of the xbox controller? Or a regular xbox controller?
Sent from my One X using xda premium
Click to expand...
Click to collapse
The controller itself is a regular xbox 360 controller. The dongle is just used on the PC so it can communicate with the controller like a xbox 360 does.
sleeplessninja said:
Are you using a Rom? I was doing this with a rooted verion of stock 4.1.1.
I'm not at my Nexus 7 for the rest of the night but can upload the file tomorrow if you don't have it. But yes Vendor_045e_Product_0291.kl should be for this to work. In the case its not we will have to push the file to the folder and then set the permission for it.
Click to expand...
Click to collapse
Nope, rooted stock 4.1.1 as well. Please upload the file if you get a chance.
So during cinematics like in Dead Trigger when the Zack gets too close, do you drop the controller and have to touch the screen?
I suck at this game, so that happens to me a LOT.
Updated OP with Attachment
Cybore said:
Nope, rooted stock 4.1.1 as well. Please upload the file if you get a chance.
Click to expand...
Click to collapse
Sorry for the delay. I appreciate you bringing this up and I updated the original post to include the attachment. Please let me know how it works out for you.
eawooten said:
So during cinematics like in Dead Trigger when the Zack gets too close, do you drop the controller and have to touch the screen?
I suck at this game, so that happens to me a LOT.
Click to expand...
Click to collapse
Yes, as far as i know you can't use the controller, i'd imagine the developers would change this to fix it though. But I was only showing the game to demonstrate the issue not so much discuss its gameplay with the xbox controller. I think there is a thread on here that is discussing this and might even direct you to a petition to Madfinger (developer of dead trigger) to request it to be changed.
Thanks for the up, I'll give it a go once my otg cable arrives. I wanted to get my n7 ready to sync once it got here.
Sweet. Thanks for posting the file.
I did not have the file either so I downloaded it to my nexus. When I try to copy the file after unzipping it it always says copy failed. I've tried Astro, ES, and File Manager with the same results. I've even moved it from my pc to my Nexus after unzipping and still having the same problem. Any ideas?
vzwty said:
I did not have the file either so I downloaded it to my nexus. When I try to copy the file after unzipping it it always says copy failed. I've tried Astro, ES, and File Manager with the same results. I've even moved it from my pc to my Nexus after unzipping and still having the same problem. Any ideas?
Click to expand...
Click to collapse
Are you mounting the Systems folder using the command " mount -o remount,rw /system " Just like in the instructions for copying the file, you need to mount the folder with write privledges using that command. I'm not sure if the file manager after remounting will allow you to still move it, you might need to use a command to move the file yourself. But let me know how it works out with the file manager first.
So I just got a chance to test it and it worked for me. I renamed the file to "Vendor_045e_Product_0719" and used root explorer to copy it into the keylayout folder. Just make sure to Mount r/w which should enable to set permissions as well.
any app for touch mapping? like the sixaxis controller one
sleeplessninja said:
Video that demonstrates the setup, show an example of the problem, the steps to solve the problem, and the working solution!!!"
Click to expand...
Click to collapse
It works great! Thanks!
Good work sleeplessninja! If only I had rooted my Nexus 7 already I'd be playing right now
Do you think getting wireless xbox controllers will become simpler in the near future through updates (preferably without rooting, not for me but for other who have no desire to root)? Also, can anyone comment on how much the wireless receiver drains the battery?
burntcustard said:
Good work sleeplessninja! If only I had rooted my Nexus 7 already I'd be playing right now
Do you think getting wireless xbox controllers will become simpler in the near future through updates (preferably without rooting, not for me but for other who have no desire to root)? Also, can anyone comment on how much the wireless receiver drains the battery?
Click to expand...
Click to collapse
I'd have to look at the spec of the reciever to figure out battery drain. But I haven't noticed any substantial drain for the limited time i've used it.
I actually can become simpler. We should all submit a ticket to Asus or Google. Because its somethign as simple as including the file in their next OTA. That way we wouldn't need to root to add it ourselves. Anyone submit a ticket before and know how to go about it? I can look it up myself but in case you find the page before me please let us all know.

[SOLVED] How do I enable Nexus 7 USB tether on Jelly Bean?

Is there a way compile the JB source so USB tether is enabled?
I made the following modification to frameworks/base/core/res/res/values/config.xml but the Nexus 7 with JB doesn't bring up any USB network interface or show the tethering option in the menu
Code:
<!-- List of regexpressions describing the interface (if any) that represent tetherable
USB interfaces. If the device doesn't want to support tething over USB this should
be empty. An example would be "usb.*" -->
<string-array translatable="false" name="config_tether_usb_regexs">
<item>"usb0"</item>
</string-array>
Not to be 'that guy', but could you please add a question mark to the title of your thread? I came in here hoping for a solution, not a question
I asked a similar question http://forum.xda-developers.com/showthread.php?t=1822788
a 3rd-party app may be able to help, but the kernel apparently has to be compiled with CONFIG_NETFILTER/CONFIG_IP_NF_IPTABLES and/or RNDIS
espionage724 said:
I asked a similar question http://forum.xda-developers.com/showthread.php?t=1822788
a 3rd-party app may be able to help, but the kernel apparently has to be compiled with CONFIG_NETFILTER/CONFIG_IP_NF_IPTABLES and/or RNDIS
Click to expand...
Click to collapse
I tried using android-wired-tether with a custom kernel that includes netfilter, iptables, and rndis. This still did not work since the application tries to access usb0 directly and the Nexus 7 never creates that interface even with a customized config.xml
I was able to get the USB tethering, Wi-Fi hotspot, and Bluetooth tethering options to come up in the menu on the Nexus 7 using the attached overlay placed in device/asus/grouper/overlay/frameworks/base/core/res/res/values/config.xml
The Wi-Fi hotspot and Bluetooth tethering options appear to work.
However, the USB tethering option unchecks itself after a second when I try to activate it.
I get the following error in logcat:
Code:
09-13 13:10:41.820: E/UsbDeviceManager(331): Failed to switch USB config to rndis,adb
I am happy to announce I got native USB tethering working on the Nexus 7
I had to make the changes to the config.xml as shown in the previous post and also had to modify out/target/product/grouper/root/init.usb.rc by adding the following
Code:
on property:sys.usb.config=rndis
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 18d1
write /sys/class/android_usb/android0/idProduct 4e23
write /sys/class/android_usb/android0/functions ${sys.usb.config}
write /sys/class/android_usb/android0/bDeviceClass 224
write /sys/class/android_usb/android0/enable 1
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=rndis,adb
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 18d1
write /sys/class/android_usb/android0/idProduct 4e24
write /sys/class/android_usb/android0/functions ${sys.usb.config}
write /sys/class/android_usb/android0/bDeviceClass 224
write /sys/class/android_usb/android0/enable 1
start adbd
setprop sys.usb.state ${sys.usb.config}
I'm also using a modified tegra kernel with RNDIS options activated...not sure if this is required (I'm assuming it is). I will try the stock kernel later.
That is good news indeed
Props to You!
cbdonohue said:
I was able to get the USB tethering, Wi-Fi hotspot, and Bluetooth tethering options to come up in the menu on the Nexus 7 using the attached overlay placed in device/asus/grouper/overlay/frameworks/base/core/res/res/values/config.xml
The Wi-Fi hotspot and Bluetooth tethering options appear to work.
However, the USB tethering option unchecks itself after a second when I try to activate it.
I get the following error in logcat:
Code:
09-13 13:10:41.820: E/UsbDeviceManager(331): Failed to switch USB config to rndis,adb
Click to expand...
Click to collapse
Nice work and quick as well, I do like those overlays, there is plenty of nice tweaks to be had out of them if folks are willing to put the effort in.
I built my own overlay earlier on after you planted the seed and was quite surprised to get Wifi-Hotspot for free. It does work, well my HTC Sensation connects to it, which is quite amusing as Cm10 on the sensation doesn't have a working WifiHotspot :laugh: I think a bit of cross device hacking is in order there
cbdonohue said:
I'm also using a modified tegra kernel with RNDIS options activated...not sure if this is required (I'm assuming it is). I will try the stock kernel later.
Click to expand...
Click to collapse
I think this is my missing link, I was going to have a proper look at some point and you've saved me a job there, I'll build myself a fresh kernel now and see if it is the case.
:good:
So does this require both a modified (before compile) Kernel and ROM?
espionage724 said:
So does this require both a modified (before compile) Kernel and ROM?
Click to expand...
Click to collapse
After talking with trevd, I am pretty confident you need to modify the .config created by "make tegra3_android_defconfig" so the RNDIS driver is in the kernel. I won't be able to compare the stock kernel to my modified one until the weekend (I only have one Nexus 7 and have to do other testing with it). The .config file I used for my modified tegra kernel is attached.
So yes, modify the kernel and Jelly Bean source. I can certainly help anyone if they run into trouble.
I plan on putting up flashable images when I can and submitting a patch to cyanogen.
cbdonohue said:
I was able to get the USB tethering, Wi-Fi hotspot, and Bluetooth tethering options to come up in the menu on the Nexus 7 using the attached overlay placed in device/asus/grouper/overlay/frameworks/base/core/res/res/values/config.xml
The Wi-Fi hotspot and Bluetooth tethering options appear to work.
However, the USB tethering option unchecks itself after a second when I try to activate it.
I get the following error in logcat:
Code:
09-13 13:10:41.820: E/UsbDeviceManager(331): Failed to switch USB config to rndis,adb
Click to expand...
Click to collapse
Would love to use your overlay.
Where exactly do I find the above mentioned path?
When I connect Nexus 7 to my Mac and see the file structure, it is missing the device/asus/grouper/overlay/frameworks/base/core/res/res/values/config.xml
retfeg said:
Would love to use your overlay.
Where exactly do I find the above mentioned path?
When I connect Nexus 7 to my Mac and see the file structure, it is missing the device/asus/grouper/overlay/frameworks/base/core/res/res/values/config.xml
Click to expand...
Click to collapse
You need to modify the files in the Jelly Bean source code and recompile the operating system.
@cbdonohue:
Hey! Do you think you could upload your kernel/framework files to use in the mean time?
I'm very curious and I have asked this so many times and no one has answered me.
Why would you want to tether your device? your device cant and does note generate its own Mobile internet service like a 3G/4G device. its wifi only so why would you want to share your devices wireless connectivity?
the only thing I can think of is if you have a desktop or laptop that does NOT have a wireless card and you want to use your Nexus 7 as a wireless card essentially and then plugging it in via USB to your desktop/laptop?
what other reason could you have for wanting to share your devices wireless connectivity?
nextelbuddy said:
I'm very curious and I have asked this so many times and no one has answered me.
Why would you want to tether your device? your device cant and does note generate its own Mobile internet service like a 3G/4G device. its wifi only so why would you want to share your devices wireless connectivity?
the only thing I can think of is if you have a desktop or laptop that does NOT have a wireless card and you want to use your Nexus 7 as a wireless card essentially and then plugging it in via USB to your desktop/laptop?
what other reason could you have for wanting to share your devices wireless connectivity?
Click to expand...
Click to collapse
You can reverse-tether a device in order to get connectivity from your PC. This is what I'm looking to accomplish with my device while I'm at work so I can access the company intranet.
ObsidianX said:
You can reverse-tether a device in order to get connectivity from your PC. This is what I'm looking to accomplish with my device while I'm at work so I can access the company intranet.
Click to expand...
Click to collapse
^ This.
ObsidianX said:
@cbdonohue:
Hey! Do you think you could upload your kernel/framework files to use in the mean time?
Click to expand...
Click to collapse
1. Download the tegra kernel branch android-tegra3-grouper-3.1-jb-fr2 and compile using the attached defconfig. (This enables the RNDIS driver)
2. Download grouper branch android-4.1.1_r1.1 and copy the compiled tegra kernel into it.
3. Modify the following grouper file with the attached config.xml (This allows the 'Tether to USB' option to come up in the settings')
device/asus/grouper/overlay/frameworks/base/core/res/res/values/config.xml
4. Compile grouper
5. Modify the following file with the attached init.usb.rc (This allows the OS to enable RNDIS USB tethering)
out/target/product/grouper/root/init.usb.rc
6. Flash to device.
At some point in the future I can make a flashable image or patch that will make this easier. In the mean time these steps should do it. Let me know if you have any issues.
nextelbuddy said:
I'm very curious and I have asked this so many times and no one has answered me.
Why would you want to tether your device? your device cant and does note generate its own Mobile internet service like a 3G/4G device. its wifi only so why would you want to share your devices wireless connectivity?
the only thing I can think of is if you have a desktop or laptop that does NOT have a wireless card and you want to use your Nexus 7 as a wireless card essentially and then plugging it in via USB to your desktop/laptop?
what other reason could you have for wanting to share your devices wireless connectivity?
Click to expand...
Click to collapse
One reason would be If you wanted to communicate between a PC and an Android device without being wireless. This could be to hide the connection or reduce the impact of RF interference. Not all applications need internet access...it might be just to send data between two end points.
USB interface and addressing specifics
For those of you who are interested...
If the Nexus 7 is acting as a USB device you can turn USB tethering on from the settings menu. The Android device automatically assigns its USB interface a hard coded IP address and starts DHCP server to hand out an address to the USB host at the other end.
If you want to change the IP address that the Android assigns itself you can modifiy the USB_NEAR_IFACE_ADDR constant in following file:
frameworks/base/services/java/com/android/server/connectivity/Tethering.java
If you want to disable the DHCP server, you can simply remove the address space you are using from the mDhcpRange array in the same file.
If the Nexus 7 is acting as a USB host (using USB OTG) then you must manually bring up the USB interface (ifconfig rndis0 x.x.x.x) since the USB menu settings will not do anything.
As an aside, am I the only one surprised to find hard coded IP addresses deep in the Android code?! haha
I've found some other gems like "shoud not get here" lines and c/c++ goto statements.
Hey folks,
I took cbdonohue's modifications and built them into CM10 and it works like a charm! I took the liberty of uploading the ZIP to dev-host:
http://d-h.st/KIr
All credit goes to cbdonohue for finding and creating the modification. I just built it

[Q] IR Remote Programming Help

Hi guys. I am using Smart IR Remote and can't get it (or any other app) to learn the color codes for an LED strip I bought from eBay. It's a generic strip that comes with a remote and a receiver. I was able to get the app to learn the "on" and "off" commands after a few tries, but the colors just won't program in. I believe that the problem is that the codes are too long for the receiver to read.
The developer of Smart IR Remote backs this up , "If the colors aren't working, that's probably because their IR codes are somehow incompatible with the phone's IR Blaster / Learner. That can either be caused by a frequency that can't be handled by the phone, or a command length that's too long for the phone's blaster. It's something we've seen happen with other LED strips as well." They let me know that they are currently looking into this.
I need to get the commands in Pronto HEX format to use with the app, but have no idea how to do this without using the IR receiver.
Is anyone able to make any suggestions about how to get the codes (without purchasing hardware) or another app that may work temporarily? I have also tried ONEtrtaV2 from XDA which wouldn't learn any of the commands.
I have used Smart IR Remote to record another remote that worked fine.
I am using a Google Edition HTC One running Android 4.3.
Thanks in advance for any help!
Smart IR Remote Link: For some reason the links are currently broken.
Hi mate, I'be just downloaded the same app on my htc one but don't know how to programme it even if just for on and off for my led stripe. Could you tell me how u did it please?
Did you figure it out?
benblb said:
Hi guys. I am using Smart IR Remote and can't get it (or any other app) to learn the color codes for an LED strip I bought from eBay. It's a generic strip that comes with a remote and a receiver. I was able to get the app to learn the "on" and "off" commands after a few tries, but the colors just won't program in. I believe that the problem is that the codes are too long for the receiver to read.
The developer of Smart IR Remote backs this up , "If the colors aren't working, that's probably because their IR codes are somehow incompatible with the phone's IR Blaster / Learner. That can either be caused by a frequency that can't be handled by the phone, or a command length that's too long for the phone's blaster. It's something we've seen happen with other LED strips as well." They let me know that they are currently looking into this.
I need to get the commands in Pronto HEX format to use with the app, but have no idea how to do this without using the IR receiver.
Is anyone able to make any suggestions about how to get the codes (without purchasing hardware) or another app that may work temporarily? I have also tried ONEtrtaV2 from XDA which wouldn't learn any of the commands.
I have used Smart IR Remote to record another remote that worked fine.
I am using a Google Edition HTC One running Android 4.3.
Thanks in advance for any help!
Smart IR Remote Link: For some reason the links are currently broken.
Click to expand...
Click to collapse
Could you please let me know if you figured it out? I have the exact same problem. I fixed on/off and ONE of the color buttons, but I can't figure out the rest. I've emailed the supplier to get the hex codes, so we'll see. Please get back to me

Remote steering wheel control ( v1.2.1 ) based on Arduino + (BT)?

I'm grad to release my app for managing remote control of a steering wheel.
solution based on arduino and my own app for Nexus 7 tablet. (sure it could be used any where else)
I'm used Arduino mini (not the best option, but this is what I had). and Arduino usb adapter (for serial communication)
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Arduino diagram:
R1 - could lower than 50kOm, but not bigger (if used on-board power)
R1 - should be bigger than max resistor in buttons set.
I've used ~47kOm
Click to expand...
Click to collapse
sketch for arduino based on carlynorama / Arduino-Library-Button
you can find sketch in attachmanets
also as RemoteInputsMgr app.
App is very simple in usage
very option for selecting usb device (in case if you have more than one usb serial adapter )
App supports running applications, changing volume, control media, running Tasker tasks.
Support click and hold actions then could be set individually for each button.
requiremens:
min Android version 4.2.2
usb host mode or Bluetooth
Click to expand...
Click to collapse
if you have a problems with app, try to install Usb serial monitor and check is there any messages in Serial,
my app uses the same lib
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
version 1.1:
arduino connected to HC-06:
+ good strong signal
+ TX,RX signal accepted in 5v
- need 3.3v power supply
Click to expand...
Click to collapse
added Bluetooth support
changed service implementation
added notification in status bar (not removable)
added freetronics support
--
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
version 1.2:
updated to 1.2
fixed restoring connection after deep sleep
fixed issues with connecting to Arduino Micro and Leonardo.
fixed handling usb detach action when used Bluetooth
--
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
version 1.2.1:
updated to 1.2.1
fixed executing Hold event
--
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
version 1.2.2:
updated to 1.2.2
fixed issues related to using of FTDI devices
--
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
version 1.3.0:
updated to 1.3.0
added support bluetooth devices in master mode (in general much better then use look device conncetion)
connection fixes for bluetooth
added broadcasting data recive action for communicating with external apps
action: org.kangaroo.rim.action.ACTION_DATA_RECEIVE
exrta: org.kangaroo.rim.device.EXTRA_COMMAND, org.kangaroo.rim.device.EXTRA_ARGS
data format that accepted from device "<extra_command:extra_args>"
added support recive data from external apps for sending to device
action: org.kangaroo.rim.action.ACTION_DATA_SEND
exrta: org.kangaroo.rim.device.EXTRA_COMMAND, org.kangaroo.rim.device.EXTRA_ARGS
data format that will be sent to device "<extra_command:extra_args>"
master device configuration:
//AT+ROLE=1 - master
//AT+CMODE=1 - connect to all device (or yse could use 0 with BAT+BIND=mac,of,you,device)
//AT+SENM=3,0 - allow to connect to tablet after pair even table if hidden
//AT+IAC=9e8b33 - stay visible
device init code for arduino:
PHP:
void setup()
{
pinMode(KPin, OUTPUT);
pinMode(SPin, INPUT);
Serial.begin(115200);
while (!Serial);
Serial.flush();
digitalWrite(KPin, HIGH);
delay(500);
Serial.print("AT+RESET\r\n");
Serial.flush();
delay(1000);
Serial.print("AT+INIT\r\n");
Serial.flush();
delay(1000);
Serial.print("AT+INQ\r\n");
Serial.flush();
digitalWrite(KPin, LOW);
}
example for testing external comminication with tasker:
--
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
version 1.3.1:
updated version to 1.3.1
added no history and no recent for app
compiled for api 16
--
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
version 1.3.2:
updated version to 1.3.2
fixed broadcast intents for custom commands
Nice work! My steering wheel lacks media/call buttons so I can't test it but I bet it's useful for those that have multifunction steering wheels!
Skickat från min Nexus 5 via Tapatalk
_crue_ said:
I'm grad to release my app for managing remote control of a steering wheel.
solution based on arduino and my own app for Nexus 7 tablet. (sure it could be used any where else)
I'm used Arduino mini (not the best option, but this is what I had). and Arduino usb adapter (for serial communication)
schematic is very simple, I will upload it later if some one will be interest in it
sketch for arduino based on carlynorama / Arduino-Library-Button
you can find sketch in attachmanets
also as RemoteInputsMgr app.
App is very simple in usage
very option for selecting usb device (in case if you have more than one usb serial adapter )
App supports running applications, changing volume, control media, running Tasker tasks.
Support click and hold actions then could be set individually for each button.
requiremens:
usb host mode
Click to expand...
Click to collapse
Cruz awesome app. If I go out and buy a arduino mini will I be able to interface directly or would I need another part for my steering wheel controls. By direct I mean canbus hi and low from my steering controls to arduino. USB out to tablet? Thank you
b3ltazar said:
Cruz awesome app. If I go out and buy a arduino mini will I be able to interface directly or would I need another part for my steering wheel controls. By direct I mean canbus hi and low from my steering controls to arduino. USB out to tablet? Thank you
Click to expand...
Click to collapse
I'm not sure,as I have simple resistance controls, to get it to work with canbas, check firstly ways to snif canbas with arduino. If it's possible, then you can try, but you will need your own sketch for arduino. Mine version of sketch is very simple and does'nt support canbus.
http://forum.arduino.cc/index.php?topic=82239.0
Here is a link, hope it will helps you to find a solution, looks like it possible
_crue_ said:
I'm not sure,as I have simple resistance controls, to get it to work with canbas, check firstly ways to snif canbas with arduino. If it's possible, then you can try, but you will need your own sketch for arduino. Mine version of sketch is very simple and does'nt support canbus.
http://forum.arduino.cc/index.php?topic=82239.0
Here is a link, hope it will helps you to find a solution, looks like it possible
Click to expand...
Click to collapse
I have a way of converting my canbus to a one wire resistive signal. Its a steering wheel control module. Made to control aftermarket decks.Would I have program the audrino or just plug in then run the app. Sorry for all the questions I am just very interested in this project.
b3ltazar said:
I have a way of converting my canbus to a one wire resistive signal. Its a steering wheel control module. Made to control aftermarket decks.Would I have program the audrino or just plug in then run the app. Sorry for all the questions I am just very interested in this project.
Click to expand...
Click to collapse
In any case if you use Arduino you have to upload a sketch on it
there attached arduino sketch exactly for one wire resistive signal, check it.
_crue_ said:
In any case if you use Arduino you have to upload a sketch on it
there attached arduino sketch exactly for one wire resistive signal, check it.
Click to expand...
Click to collapse
I don't see the sketch. Would u have time to help answer some questions if I have any during the install. Thanks again I use the pwrmgr apk too works great. Thank you
b3ltazar said:
I don't see the sketch. Would u have time to help answer some questions if I have any during the install. Thanks again I use the pwrmgr apk too works great. Thank you
Click to expand...
Click to collapse
first post:
ATTACHED FILES
ResistantButtonsTest.7z - this is zipped sketch
will glad to help
_crue_ said:
first post:
ATTACHED FILES
ResistantButtonsTest.7z - this is zipped sketch
will glad to help
Click to expand...
Click to collapse
I really appreciate it. I will always be available if u need someone to test any apps.
_crue_ said:
first post:
ATTACHED FILES
ResistantButtonsTest.7z - this is zipped sketch
will glad to help
Click to expand...
Click to collapse
Hey mate!
I tried to install your apk to my Android 4.2.2 USB ROM and I've got syntax error. Could you build an apk for 4.2.2 support? Or make proper ROM for 4.4.2 with USB DAC on boot/hotplug, OTG+charge and DAC volume )
Just joking. I want your apk for 4.2.2. I will try to adapt my CANBUS adapter to use with your program.
NoXXX said:
Hey mate!
I tried to install your apk to my Android 4.2.2 USB ROM and I've got syntax error. Could you build an apk for 4.2.2 support? Or make proper ROM for 4.4.2 with USB DAC on boot/hotplug, OTG+charge and DAC volume )
Just joking. I want your apk for 4.2.2. I will try to adapt my CANBUS adapter to use with your program.
Click to expand...
Click to collapse
For 4.2.2 use Timur's solution, it's pretty good in all senses. All my code for later roms
This app I will rebuild, but later when will find and fix bugs
Check skech to get know what should be send to serial
Also give me vendor id, I will check does serial lib support this type of ueb to serial adapter
NoXXX said:
Just joking. I want your apk for 4.2.2. I will try to adapt my CANBUS adapter to use with your program.
Click to expand...
Click to collapse
I've rebuilt apk, new apk in first post.
_crue_ said:
For 4.2.2 use Timur's solution, it's pretty good in all senses. All my code for later roms
This app I will rebuild, but later when will find and fix bugs
Check skech to get know what should be send to serial
Also give me vendor id, I will check does serial lib support this type of ueb to serial adapter
Click to expand...
Click to collapse
I already checked the sketch and modified mine, but it doesnt work with you app. I tried on Note 3.
What vendor ID should I give you? Of my iteaduino leonardo?
Also, if you use fixed install Nexus 7, what rom and kernel do you use? I want 4.4.2 in my car, but there's no rom+kernel like Timur's one (frim sleep and so on), but 4.4.2
---------- Post added at 11:12 PM ---------- Previous post was at 11:11 PM ----------
_crue_ said:
I've rebuilt apk, new apk in first post.
Click to expand...
Click to collapse
Thanks! I'll try it tomorow.
NoXXX said:
I already checked the sketch and modified mine, but it doesnt work with you app. I tried on Note 3.
What vendor ID should I give you? Of my iteaduino leonardo?
Also, if you use fixed install Nexus 7, what rom and kernel do you use? I want 4.4.2 in my car, but there's no rom+kernel like Timur's one (frim sleep and so on), but 4.4.2
---------- Post added at 11:12 PM ---------- Previous post was at 11:11 PM ----------
Thanks! I'll try it tomorow.
Click to expand...
Click to collapse
I'm using kang-aroo kernel, also could be used oxydo kernel
stock ROM this is only one reason why I'm starting writing my own app
because I'm using table not only in the car, so for me it should be always up to date
uno
will a arduino uno do the job
b3ltazar said:
will a arduino uno do the job
Click to expand...
Click to collapse
yes but it's big
better use something small
http://arduino.cc/en/Main/ArduinoBoardMicro
http://arduino.cc/en/Main/ArduinoBoardNano
both boards has on board usb to serial controller for flashing and communicating
also you can chech chines copies of arduino
_crue_ said:
yes but it's big
better use something small
http://arduino.cc/en/Main/ArduinoBoardMicro
http://arduino.cc/en/Main/ArduinoBoardNano
both boards has on board usb to serial controller for flashing and communicating
also you can chech chines copies of arduino
Click to expand...
Click to collapse
i want to thank you for your quick responses! im buying from radio shack all they have in stock localy is the uno. size isnt a issue i have tons of space behind my dash. I no nothing arduinos at rhe moment but hoping to learn how to program them. i have been installing tablets like crazy in cars and your apps are awsome.
Just tried to use your app again and I failed again. It doesnt want to get those <click:1000> events
_crue_ said:
yes but it's big
better use something small
http://arduino.cc/en/Main/ArduinoBoardMicro
http://arduino.cc/en/Main/ArduinoBoardNano
both boards has on board usb to serial controller for flashing and communicating
also you can chech chines copies of arduino
Click to expand...
Click to collapse
iught the micro i try and upload scetych and get a error [button does not name a type
ResistantButtonsTest.ino: In function 'void setup()':
ResistantButtonsTest:13: error: 'button' was not declared in this scope
ResistantButtonsTest.ino: In function 'void loop()':
ResistantButtonsTest:19: error: 'button' was not declared in this scope
b3ltazar said:
iught the micro i try and upload scetych and get a error [button does not name a type
ResistantButtonsTest.ino: In function 'void setup()':
ResistantButtonsTest:13: error: 'button' was not declared in this scope
ResistantButtonsTest.ino: In function 'void loop()':
ResistantButtonsTest:19: error: 'button' was not declared in this scope
Click to expand...
Click to collapse
There is a link on lib that should be used. Dowload and add it to Arduino ide

Usb on P30 Pro

I want to start using USB OTG on my P30 Pro which has EMUI 10.0.0. I have ordered a suitable cable and while waiting for it went to set it up in settings. I understood I should be looking for it in 'more settings' or 'additional settings' but my main settings menu has neither of those. I enabled developer settings but couldn't see anything there. Is OTG enabled by default or is there a setting I'm not finding?
what do you want to use the OTG for?
standard storage appears after connecting (similar to memory card)
OTG is enabled by default, there's no need to change any additional settings. Once you connect a USB storage device, it should show up under the file browser app.
My father has a Huawei p30 pro.standard storage appears after connecting,He likes to store photos
Same for other USB-OTG features such as GPS dongles, HDMI cables and so forth. Just plug and go. Welcome to the 21st century.

Categories

Resources