executable code uploader

It would be awesome... AWESOME... to be able to export a packaged executable that I can send someone to load up new code onto an arduino without having to duplicate my dev environment.

Presumably, it would need to target specific hardware, and allow for a selection of the serial device as an interface control.

I'm not saying I want to hide or protect my code. I'm all for making the code available. That could be an option, but not one that I would require.

As the arduino moves slowly into new territory, I know that the focus will continue to be on end users as engineers, but also eventually there will be products made with the Arduino as their beating heart. It would be a huge boon to the people making products to be able to provide an easy way to let the end users be able to apply code updates easily.

Check this out:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1260909294

You could deliver just the hex file and instructions on how to get it onto an SD card. End users could update as required.

Confused... I'd have to include an SD card slot on my project?

either that or tell your end user to jack it into a pc and send it over serial

sd would make it easier for anyone to download an update and drop it in the device, but no its not the ONLY way

Good ideas, guys. And, my idea is about letting non-technical end users be able to launch an app and get a program loaded onto an arduino... without having to become technical.

There are people out there who will buy my product (already have, actually), and I'm looking for a way to provide them with a painless and easy solution to getting a firmware update without having to:

  1. download the arduino IDE
  2. download the libraries I'm using
  3. install them where they need to be
  4. load up my sketch
  5. select the right hardware target
  6. select the right serial device
  7. upload to the hardware.

I'm looking for a reduction in number of steps to something like:

  1. launch the pre-packaged executable
  2. select the right serial device
  3. hit "go"

I don't know how much of the arduino IDE is still based on the processing IDE, but they do have an export to executable feature. It's cross platform and super easy. I realize it's not the same thing as what the arduino project is doing ... but I'm just saying "that would be awesome".

The Arduino IDE is a fancy editor that makes calls to the avr-gcc compiler and avrdude to upload the code. There are settings you can add to some configuration file (build.verbose = true, for instance) to see the commands actually being executed on your computer. A search on the forum will provide those details.

Then, you could create a script that took one argument, the serial port name, and executed the upload command for the user to upload your latest and greatest.

I think it could be completely automated if your Arduino side helps a little bit. So the first question is if you want to connect to "naked" Arduinos or preloaded ones.

Suppose first a naked one:

  1. Your Software has to determine the serial/usb port for the Arduino
  2. It must pulse DTR
  3. It must upload the hex file according to the specified protocoll

AFAIK the IDE uses avrdude for step (3) but if you know in advance that you want to talk to arduino with its specific bootloader this could be simplified of course. Especially I think it would be not to hard to package everything into one single executable. (Plus of course the HEX file).

Now suppose the Arduino can be preloaded by you. In this case the executable could pulse DTR for all potential serial devices. At least under linux these can be discovered quite easily. I think in Windows this should be possible as well. Now if your Arduino software will always send a string over serial (during setup) that says "hello, I am an Arduino" then your software would know that this is an Arduino and could connect accordingly.

Maybe this could be further simplified if the bootloader has some specific responses that could be exploitet. But I did not yet analyze the bootloader, but I would guess that it has some exploitable answers.

But I am wondering why a real (non techie) product (and not just a prototype series) should be built around Arduino? Arduino is to expensive once you want to go into production and has some other issues as well (power consumption, board usually not suitable).

In my opinion it is a great prototyping platform but not really suitable for productization.

Cheers, Udo

Well, I would respectfully disagree. It's absolutely perfect for me and my product at my stage of development. I'm not building millions-of my product. I'm aiming for building tens-of. If I get to the point of needing to build thousands of, maybe I'll have the capital to hire an electrical engineer. In the meantime, while I'm refining my product and building a customer base, I can get my head around the arduino IDE and hardware and roll out my product today... instead of never.

Thanks for the continuing stream of good ideas, please do continue!

And honestly, auto-detecting an arduino on the serial chain isn't that important to me. Nice to have, but not something I would expect. The IDE currently doesn't do that, so I wouldn't expect it.

well what is an arduino without the board, a chip and a clock crystal (and power), so yea even running thousands of the things you could still have it based on arduino, which is an appealing factor

Yeah, that's what I was thinking too. Two factors that are appealing: 1. if the arduino mega ever becomes damaged in any way, it can be shipped back to me without having to ship the entire product back. I can provide a replacement arduino mega very quickly if need be. and 2. if for whatever reason you don't want to use my product anymore, you can take out the arduino mega and use it for your own awesome project.

What kind of product are you talking about?

welllll, since you asked: seqr of knowledge

Cool. So would you uploader target just one platform (for example Mac) or has it to run on PC, Mac and others?

ideally it would spit out executables for all platforms the IDE runs on, but I'm probably reaching for the stars on that one. I hate to break a taboo and introduce the concept of paying money for open source things I appreciate, but I would totally pay money for an arduino "pro" IDE that would produce this kind of executable.

No, it depends on the question how you want to support it. You will have to package the HEX file. This is something that can be done with the normal IDE.

Then you have to provide plattform specific code that will be able to push the HEX into the Arduino. The question is here how much installation you want to burden on the end user. Ideally I think it should be no installation at all. Now you need something that abstracts you somehow from the specific platform and allows you to push the HEX file into the arduino.

If you could assume that the target has already something like Perl or Python this could be easier. Otherwise you will most probably have to go for different (C??) executables.

processing, which the ide is written on, will spit out exe's for most platforms, but that doesnt solve the "how to get the hex file uploaded"

But processing will spit out executables for the platform it is running on. He needs an uploader for each platform.

The upload itself should not be that hard. In the end it is a serial protocoll.

Processing will spit out executables for Mac, Windows, and Linux... at least, that's what it does on the mac. I don't know what it does on the other platforms, but the mac version of the IDE spits out three executables.

So obviously I lack some knowledge about processing. How come that it can spit out executables for 3 platforms that can run on three platforms without installation? Or are these executables that require processing to be already installed?