Go Down

Topic: How to upload ready HEX file using processing or java? (Read 1 time) previous topic - next topic

4ntoine

I'd like to upload ready HEX file to Arduino board. How can i do that in java code?
Should i implement stk500 protocol in java? Are there any working solutions or examples in java? Thank a lot!

PS. I've found stk500 implementation in Erlang (https://github.com/msantos/stk500) but i don't know it.

pylon

You can call avrdude from java. Why do you need to circumvent avrdude? You need native code anyways (for accessing the serial interface), so why don't you wanna use avrdude?

4ntoine

#2
Jan 30, 2013, 06:07 pm Last Edit: Jan 30, 2013, 06:10 pm by 4ntoine Reason: 1
The idea was to upload Arduino sketch right from Android device via USB, Ethernet or Bluetooth.
I can use native code using NDK but it should be not console app and it's not good to use arch-dependent code in java app in general.

I tend to write stk500 implementation as it seems to be pretty simple protocol.
But i agree that it's better to use smth ready and bugs-free instead of reinventing the wheel.

So what do you think about it?

PS. Serial interface is available in java code too

pylon

Quote
PS. Serial interface is available in java code too


Interfaces: yes, but you don't have support for it in the JVM, you need an external native library (like RXTXcomm or javax.com, but javax.com is available only on Unix platforms). To be a little picky: Dalvik (the vm for running code on Android) is not Java.

I guess, to emulate avrdude on Android and update Arduinos over Ethernet or Bluetooth, stk500 is not your biggest challenge.

4ntoine

#4
Jan 31, 2013, 02:30 pm Last Edit: Jan 31, 2013, 02:37 pm by 4ntoine Reason: 1
Okay, let's say i already know how to pass bytes array to bootloader (via Serial, Bluetooth, Ethernet, etc, etc). Serial at least for sure.
Uploading via Bluetooth example:
http://www.youtube.com/watch?v=i-69D0iDVxE

The problem is how to interact with it in optimal way..

Go Up