DroidScript Arduino board not detected

703 views
Skip to first unread message

Diogo Pata

unread,
Oct 18, 2015, 10:54:12 AM10/18/15
to AndroidScript
Hi there, 

is there any plugin needed to communicate with arduino boards?
I've tried the example app "USB Arduino" with both Uno and Leonardo boards, but it couldn't detect the boards ("Please connect your Arduino and restart").

Tested with:
Sony xperia
Android v: 5.0.2
USB debug mode enabled

Just as a remark, I've tried communication btw android and arduino through usb using the 'BlueAct' app and it worked out. Suggesting that this is not a hardware issue.


Thanks in advance

Charles Wilt

unread,
Oct 18, 2015, 4:35:00 PM10/18/15
to AndroidScript
Is it a genuine Arduino or a knock off?

Diogo Pata

unread,
Oct 18, 2015, 4:41:43 PM10/18/15
to AndroidScript
Both are genuine Arduino boards.

Dave Smart

unread,
Oct 19, 2015, 4:12:06 AM10/19/15
to androi...@googlegroups.com
Hi Diogo,

Are you using an OTG cable at the phone end?

What  baud rate are you using on the Arduino end?

Diogo Pata

unread,
Oct 19, 2015, 5:44:36 AM10/19/15
to AndroidScript
Hi Dave, 

yes, I'm using an OTG cable and using 9600 b.r. on the arduino. 
As I commented before, when using the 'BlueAct' app for serial communication, it works as expected. Thus I don't think it is a hardware problem.
The only thing I find suspicious is that when I plug the usb OTG cable, 'BlueAct' asks for using usb permissions, while DroidScrip doesn't.

Dave Smart

unread,
Oct 19, 2015, 6:16:55 AM10/19/15
to AndroidScript
Yes, it is suspicious that DS does not ask permissions... 

- Do you have the latest DroidScript installed (1.29b)?
- Can you find out the vendor and product Id's of your boards please (plug into windows and check device manager).

- Note: you should set 115200 as your board rate if you are using the DS sample App.

Diogo Pata

unread,
Oct 19, 2015, 7:00:11 AM10/19/15
to AndroidScript
Hey Dave, 

- Do you have the latest DroidScript installed (1.29b)?
   Yes, I have the latest DroidScript installed

- Can you find out the vendor and product Id's of your boards please (plug into windows and check device manager).
Thats the system_profiler output in mac (with the Leonardo board):

              Arduino Leonardo:

              Product ID: 0x8036

              Vendor ID: 0x2341

              Version: 1.00

              Speed: Up to 12 Mb/sec

              Manufacturer: Arduino LLC

              Location ID: 0xfd130000 / 5

              Current Available (mA): 500

              Current Required (mA): 500


Thats the system_profiler output in mac (with the Uno board):

            Communication Device:


              Product ID: 0x0043

              Vendor ID: 0x2341

              Version: 0.01

              Serial Number: 55431313338351316201

              Speed: Up to 12 Mb/sec

              Manufacturer: Arduino (www.arduino.cc)

              Location ID: 0xfd130000 / 5

              Current Available (mA): 500

              Current Required (mA): 100



- Note: you should set 115200 as your board rate if you are using the DS sample App.
Just tested it with 115200 baud rate in both boards.


Dave Smart

unread,
Oct 19, 2015, 10:26:29 AM10/19/15
to AndroidScript
Hi,

Your ID's look ok.  

I just tested it with a SainSmart Uno clone and it worked fine here (I don't have an original to hand at the moment).

Your phone should definitely ask you for permissions when you plug the USB device in.  Maybe another application has been set as the default app for this USB device?  Perhaps try to uninstall the other App which is taking control.

Also, just uninstalling and re-installing DroidScript (Make sure you don't have any old copies of DroidScript installed at the same time too).

Regards
David

Diogo Pata

unread,
Oct 19, 2015, 4:48:02 PM10/19/15
to AndroidScript
Hi Dave, 

just reseted the phone to factory settings so that it would erase any permissions or debugging defaults. 
Installed DroidScript again but no luck....
Don't know what could it be. I'll try with another smartphone to check whether its a Sony Xperia specific problem.

Regards,
Diogo

Diogo Pata

unread,
Oct 20, 2015, 5:22:26 PM10/20/15
to AndroidScript
Hi all, 

just retested the usb serial communication with other smartphone (Nexus) and still no luck. 
Also, got a new OTG USB cable just in case, but again, that was not the problem. 

The fact that droidscript is not popping-up a request for accessing usb devices is quite strange. 
I wonder whether are there any options to allow a specific android app to access usb devices.

Thanks in advance

Dave Smart

unread,
Oct 21, 2015, 4:02:54 AM10/21/15
to AndroidScript
Hi Diogo,

I tried with an Uno R3 original last night and had the same problem, so I think we have a bug in the serial drivers.  I did not have much time to look into it last night, but I will try to sort out this problem in the next few days and give you an update.

Do you know which serial drivers are in use on your boards?  (FTDI or CDC perhaps)

Regards
David 

Dave Smart

unread,
Oct 22, 2015, 9:05:10 AM10/22/15
to AndroidScript
Hi Diogo,

Those figures that you gave me for your boards... were they from the internet or from your actual boards?

The reason I ask is because I just bought a brand new official Uno R3 from Amazon and the vendor Id's are different to expected!

It has 0x2A03 the vendor id and 0x0043 as the product ID and hence does not get detected by DroidScript (as it is not expecting those ID's). My original thought was that I've just been ripped off and got a dodgy clone... but on further investigation, the situation may more complex.



Diogo Pata

unread,
Oct 22, 2015, 9:36:22 AM10/22/15
to AndroidScript
Hi Dave, 

it was taken from my boards.
I think it might be an Android related issue. I just took an older smartphone I had at home and try both droidScript and Protocoder. 
DroidScript, again, didn't request for USB access and thus no communication with the UNO board was performed. However, Protocoder was quite successful in controlling the arduino board. 

My intuition is that the android system is not allowing droidScript to access the usb port. 

Yves Glassner

unread,
Oct 29, 2015, 8:48:40 AM10/29/15
to AndroidScript
Hi,
I have same problem with Note 4 and official Arduino 

Dave Smart

unread,
Oct 29, 2015, 11:09:11 AM10/29/15
to AndroidScript
I'm going to do a new release very soon which supports the 'other' manufacturer.

Was your board made by Arduino S.r.l ?  (it says on the box)

Yves Glassner

unread,
Oct 29, 2015, 1:57:24 PM10/29/15
to AndroidScript
Yes, original Arduino Uno made in Italy.
I tried some software from store, 'arduino servo motor control', no problem to connect OTG and software asked permission to use USB

Dave Smart

unread,
Oct 29, 2015, 2:26:50 PM10/29/15
to AndroidScript
They are both made in Italy... that's the point.  Two Italian manufacturers are fighting over the brand name.


What does it say on your box, Arduino LLC or Arduino SRL ?
Message has been deleted

Yves Glassner

unread,
Oct 30, 2015, 11:21:52 AM10/30/15
to AndroidScript
This one SRL

Dave Smart

unread,
Oct 30, 2015, 2:12:11 PM10/30/15
to AndroidScript
OK, good.  Then your board will work after the next alpha release.

I will send you a copy soon.

Yves Glassner

unread,
Oct 30, 2015, 4:20:27 PM10/30/15
to AndroidScript
Thanks Dave

Schnee Wittchen

unread,
Nov 3, 2015, 1:35:44 PM11/3/15
to AndroidScript
Hello Yves,
hello Dave,

would you mind if I jump in here.

I'm trying to run DroidScript together with a Leonardo and a Leonardo-adaptation made by LittleBits.
I have issues connecting to the boards. My current assumption is that either the "setDTR(true)" issue is the problem, or the ID is not known to DroidScript,
or both.

The vendor ID is 0x02341, the product ID is 0x8036.

Maybe you can have a look into this. The combination of DroidScript with Littlebits would be awesome.

Best regards
Schnee

Dave Smart

unread,
Nov 4, 2015, 4:34:17 AM11/4/15
to AndroidScript
Hi Schnee,

I've talked to the little bits people before and tried to persuade them to cooperate with us, but did not get very far... which is a shame.

Your vendor and product Id's look ok. Presumably you get a security dialog popping up when you plug the OTG cable in right?

It might be the SetDTR issue as you say, have you tried playing around with the usb.SetDTR and usb.SetRTS methods in DroidScript while connected to the Leonardo?

Schnee Wittchen

unread,
Nov 4, 2015, 5:20:07 AM11/4/15
to AndroidScript
Hello Dave,

thanks for your information. I wasn't aware about these methods, so I tried both, but with no success at first glance. However, I used an old Nexus7 with an old AndroidScript ( not yet DroidScript ).
Therefore I will give it another try this evening with an update-to-date Nexus9 with DroidScript 1.29 and hope I have better luck.

Best regards
Schnee

Yves Glassner

unread,
Nov 4, 2015, 12:36:50 PM11/4/15
to AndroidScript
USB on Arduino Uno R3 (SRL)  works fine now :)
Thanks Dave

Schnee Wittchen

unread,
Nov 4, 2015, 1:00:28 PM11/4/15
to AndroidScript
Hello Dave,

so I tried it with the Littlebits Arduino, the Nexus9 running Lollipop and the DroidScript 1.29b with a modified version of the USB Arduino
example, adding the usb.SetDTR and usb.SetRTS.

Unfortunately it still does not work, in the sense that no data are transmitted from the Arduino to the tablet. I'm not sure what the two methods do, but it seems that
the Arduino can't see the effect on the virtual com port. Other Apps like "UsbTerminal" and "Free USB Serial Term" are able to explicitly set the control lines.

Actually I found the place in the Arduino code where it goes wrong. The Arduino simply checks the linestatus > 0 in the CDC.cpp file. So, it
doesn't matter if I set DTR or RTS or both. If none of them is set, a serial error is generated on the Arduino. So, I could hack the code, but basically I like to
avoid this, if possible.

All this seems to be only the case on the Leonardos and some Pro Micros, where the ATmega32u4 is used as processor. That's why Unos and the others
should basically work out of the box.

best regards
Schnee

Dave Smart

unread,
Nov 4, 2015, 1:41:12 PM11/4/15
to androi...@googlegroups.com
Hi Schnee, 

What baud rate are you setting on the Leonardo at the DroidScript end?

Schnee Wittchen

unread,
Nov 5, 2015, 2:13:16 AM11/5/15
to AndroidScript
Hi Dave,

on the Leonardo I set 115200. However, if you look into the source code of the driver you see that this information will be ignored by the Serial.begin function.
In DroidScript I tried both, setting to 115200 and just left empty. No success. Sorry to bother you with that issue.

In the meantime I changed to the Arduino IDE 1.6.6, which provides also some functions to read the status of the DTR and RTS lines on the Leonardo side.

best regards
Schnee

Schnee Wittchen

unread,
Nov 8, 2015, 4:25:52 AM11/8/15
to AndroidScript
Hi,

for the time being I hacked the Arduino code, which is definitely not my preference.

Under ..../arduino-1.6.6/hardware/arduino/avr/cores/arduino change the file CDC.cpp in line 209 or so in the function Serial_::write
Instead of the

    if (_usbLineInfo.lineState > 0)    {

simply replace by

    if ( 1 )    {

This simply ignores the line state for writing data. You can still check the correct line state with if ( Serial ) or by checking the DTR line with if ( Serial.dtr )
in the Arduino code.

I tried this with the Rover example and basically it works ok for me now.
best regards
Schnee


Cody Groshko

unread,
Nov 22, 2015, 4:13:21 PM11/22/15
to DroidScript
Check your USB-Serial i for some reason have a hard time with the CH340 chips on my uno and nano, nano is a clone and uno is a real duino. My mega work's fine using the Atmel chip, so do my pro mini's with the PL2303.

Syed Munawer Hassan

unread,
Jul 12, 2018, 1:41:02 PM7/12/18
to DroidScript
I also tried my app asked for selecting serial communication I select DS but I'm not able to communicate with serial port

Rico

unread,
Aug 25, 2019, 4:08:26 AM8/25/19
to DroidScript
USB Arduino sample with Arduino Uno (under Droidscript) works great but does not work APK files. What to do?
Message has been deleted
Message has been deleted

Steve Garman

unread,
Aug 25, 2019, 4:29:33 AM8/25/19
to DroidScript
It's probably a permissions issu Rico.
I would try adding

_AddOptions("USB")

at the top of the code then rebuild the APK and see if it fixes it.

Rico

unread,
Aug 25, 2019, 10:58:36 AM8/25/19
to DroidScript
Can anyone test whether USB Arduino sample also works with APK files? I didn't succeed in any way

Dave

unread,
Aug 25, 2019, 6:59:37 PM8/25/19
to DroidScript
This might be because you have associated your particular USB device with DS while developing and now it is locked to that app.  

Try uninstalling DS temporarily and then plugging your USB device into the OTG connector.  It should ask you for the app to associate with the device again (at which point you should choose your new app)
Reply all
Reply to author
Forward
0 new messages