Jump to content

Let's throw a wild party for ninja hackers :-)


Recommended Posts

Guest Fire Ant
Posted

1. For newbies

What is Arduino? a single-board microcontroller easy to program and powerful enough for cool DIY projects.

What is possible? just some examples,

- building a universal remote

- High speed photography

- Home automation

- See more

So what can we do with Vega? It's possible to control Arduino directly.

2. How to start

It seems all Linux kernels that have been built for Vega have the needed modules. Thus, you need to have a rooted Vega with the USB port in host mode and an Arduino, and you're ready for the a weekend DIY project.

I worked on a small project, as you can see in the photo, the Android app has three sliders to control the brightness of the three LEDs on the breadboard:

img1183n.jpg

3. Code

The code is available at https://github.com/fireant/Axum. Though it needs tidying up and definitely Google would cry after seeing the code of the Android app. If you have a question regarding the code feel free to ask here.

Happy hacking :-)

Disclaimer if you damage your Advent or injure yourself trying to connect your device to Arduino, I am not responsible.

Guest MaxiP
Posted

Looks very useful if you have a use for it !! I don't (yet) but can see the potential especially for home automation - control heating / lighting as well as electrical devices from a single location. what about a wireless camera & remote door unlocking for the truely lazy :)

Guest peter a
Posted
Looks very useful if you have a use for it !! I don't (yet) but can see the potential especially for home automation - control heating / lighting as well as electrical devices from a single location. what about a wireless camera & remote door unlocking for the truely lazy :)

Not tried to use the arduido on the vega direct.

I compile the code for it on a pc, and connect it to a sheevaplug.

For me it easier to a web page in python to control it, than making a android app.

Guest Fire Ant
Posted
Not tried to use the arduido on the vega direct.

I compile the code for it on a pc, and connect it to a sheevaplug.

For me it easier to a web page in python to control it, than making a android app.

In case you want for portable projects to connect directly the Arduino to the tablet, you can use Python too. Yesterday I installed SL4A and wrote some scripts. Of course, it's much easier than compiling the Java code on PC and copying each time.

Guest crockwit
Posted (edited)

I have managed to compile your code into an android project and run it on my Vega. The app runs ok (seekbars appear, no error messages) but does not control my arduino. I have tested the sketch and hardware by sending a test string ("0, 50;1, 50;2, 50;") from the serial console on the pc. It lit the leds as expected so I must assume the problem is with the android app. Is there any chance you could provide a complete android project for the code as I am not an experienced android programmer and I may have made a mistake creating the project.

Thanks for the work you have done.

Edit I am using an anduino duemilanove. My Vega is running Paul's 1.08 ROM

Edited by crockwit
Guest Fire Ant
Posted
Is there any chance you could provide a complete android project for the code as I am not an experienced android programmer and I may have made a mistake creating the project.

No problem, I exported the project, not sure this is the right way of distributing Android projects, but suppose all needed files are included:

http://goo.gl/y6rq3

The .apk file is also in the /bin directory. My first guess is that you have removed

			dos.writeBytes("cat /dev/ttyUSB0\n");

			dos.flush();

But if you run my apk file and still nothing happens, your kernel doesn't come with the right modules. Though, in that case I can just send you the modules and you copy on your device. Please let me know how it goes.

Guest crockwit
Posted

But if you run my apk file and still nothing happens, your kernel doesn't come with the right modules. Though, in that case I can just send you the modules and you copy on your device. Please let me know how it goes.

Guest Fire Ant
Posted (edited)
No luck running the apk Which ROM are you using ? I can install the same one. Cheers for your quick reply.

I'm using this:

http://android.modaco.com/content/advent-v...ab-from-gojimi/

Just could you please before changing the ROM, open a terminal emulator and then plug the Arduino into the USB, then run dmesg. Is there anything like

"FTDI USB Serial Device converter now attached to ttyUSB0"?

The reason I'm asking is that in the .config file that comes with Paul's 1.08 ROM this module is ticked to be compiled. Thanks.

Edit, two questions, though I guess you know what you're doing, but just to make sure:

1- you know how to switch the USB to host mode?

2- if there is another USB device connected to your tablet there is a small chance ttyUSB0 is pointing to the other device?

Edited by Fire Ant
Guest crockwit
Posted

The usb is in host mode, no other devices attached. results from dmesg regarding usb are

<6>[ 1045.274640] usb 1-1: new full speed USB device using tegra-ehci and address 5

<6>[ 1045.353026] usb 1-1: New USB device found, idVendor=0403, idProduct=6001

<6>[ 1045.359889] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3

<6>[ 1045.367274] usb 1-1: Product: FT232R USB UART

<6>[ 1045.372689] usb 1-1: Manufacturer: FTDI

<6>[ 1045.376770] usb 1-1: SerialNumber: A800eGMG

<6>[ 1045.386897] usb 1-1: configuration #1 chosen from 1 choice

Guest Tainlorn
Posted

Nice, will have to dig my arduino out and have a play!

Guest crockwit
Posted

Just tested with the Corvus ROM. It works ! Thanks for your help. I will have a play with it tonight.

Guest Fire Ant
Posted
Just tested with the Corvus ROM. It works ! Thanks for your help. I will have a play with it tonight.

Many thanks for the info. It would be great if you could let us know what project you're working on.

Guest Fire Ant
Posted (edited)
Nice, will have to dig my arduino out and have a play!

It's good to see some Arduino-ers here :-) Any particular project you have in mind?

I'm going to work on a few small medical applications. My girlfriend has low blood pressure her digital device fails to measure the pressure or even sometimes her heart beat rate :-) probably my first project will be something related to that.

Edited by Fire Ant
Guest crockwit
Posted
It's good to see some Arduino-ers here :-) Any particular project you have in mind?

I'm going to work on a few small medical applications. My girlfriend has low blood pressure her digital device fails to measure the pressure or even sometimes her heart beat rate :-) probably my first project will be something related to that.

I have just began to learn Arduino so I am still getting my head around all the basics. I started to learn a bit about android programming but gave up because I could not think of anything useful to write in it. I find Android a bit like Visual Basic, to much time spent with manuals. I am also struggling with XML. Anyway this will motivate me to have another attempt at learning Android. I have factored your writing code out into a seperate class and tested it with a simple button press app, it works fine.

Are you going to be writing any code to allow reading data from the Arduino ?

Guest Fire Ant
Posted
I have just began to learn Arduino so I am still getting my head around all the basics. I started to learn a bit about android programming but gave up because I could not think of anything useful to write in it. I find Android a bit like Visual Basic, to much time spent with manuals. I am also struggling with XML. Anyway this will motivate me to have another attempt at learning Android. I have factored your writing code out into a seperate class and tested it with a simple button press app, it works fine.

Are you going to be writing any code to allow reading data from the Arduino ?

Well you can code in Python, Perl, Lua, and a bunch of other scripting languages if you install SL4A. Though, if we get Android version >= 2.3 on Vega can implement the applications completely in C/C++. Perhaps you already knew that.

On Sunday I'm going back to my place, then will upload the new code that reads data from the Arduino.

Guest crockwit
Posted
Well you can code in Python, Perl, Lua, and a bunch of other scripting languages if you install SL4A. Though, if we get Android version >= 2.3 on Vega can implement the applications completely in C/C++. Perhaps you already knew that.

On Sunday I'm going back to my place, then will upload the new code that reads data from the Arduino.

I will have a look at Python for a start, I have just installed SL4A. No rush with the reading code I have enough new toys to keep me busy. Thanks again for your work.

Guest peter a
Posted
I will have a look at Python for a start, I have just installed SL4A. No rush with the reading code I have enough new toys to keep me busy. Thanks again for your work.

I`m working on a slightly different way to control my Arduino.

But android / java is new to me, so having to learn even the basics of the language.

It`s took me a day to work out how to deal with a key press.

I know now about onclick and onlongclick etc.

I want to click a button or move a slider etc , that event is send via tcpip connection to my sheevaplug (and a daemon writen in python), which talks to the Arduino via usb.

Guest crockwit
Posted

Here is a tip for anyone using Eclipse to write code to control an Arduino. Download adbWireless (free from the market). Use this program to connect your Vega in adb mode before starting Eclipse. Eclipse can now load an apk to the Vega while the Vega is in host mode (ready to test the apk on the Arduino). This saves a lot of rebooting of the Vega.

Guest crockwit
Posted
how did you get the ftdi-chip driver on your advent vega.

I tried Corvus and r8 from Paul - no luck so far.

see my thread:

http://android.modaco.com/content/advent-v...driver-support/

thanks

I did not install any drivers and used a standard USB cable. Try out Fire Ants code posted above. Make sure you use the Corvus ROM Paul's did not work for me. Good luck.

Guest Guschti
Posted
I did not install any drivers and used a standard USB cable. Try out Fire Ants code posted above. Make sure you use the Corvus ROM Paul's did not work for me. Good luck.

thanks for the info.

which Corvus ROM was it... there seem to be at lease two Corvus ROM's around... named v0.5 and something with another guy version 5 or so...

Guest peter a
Posted

Sorry a newbie to android , but I know my way around plain old debian linux , How do you install python ?

Guest crockwit
Posted
thanks for the info.

which Corvus ROM was it... there seem to be at lease two Corvus ROM's around... named v0.5 and something with another guy version 5 or so...

The original Corvus (v0.5 I think)

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.