I’m new on Arduino’s world, and I have a challenge that may can help almost arduino lovers!
After a deep research, I found a couple of topics in this forum, almost just without any solution maybe because the people just give up.
The idea is basically upload the arduino sketch through the internet or the local lan.
I was thinking about upload the .hex file (generated by the Arduino IDE) to a SD-Card through the internet / LAN.
After the upload is done, arduino could check out for a “Software Update”, and then execute the process to load the .hex file to it self.
Let’s supose that you have an Arduino device that you can connect by the internet, upload a .hex file to the SD, and send a command to arduino to execute the update process and load the .hex file from SD ? Is that possible ?
So you are asking can the chip program itself? The short answer is yes, because that is what the bootloader does. However whether you can fit the code to read from the SD card into the bootloader section, I'm not sure. One possible solution would be to have two chips. One is setup up to program the other one. The programming one saves new code into the SD card, and then when requested puts the second chip into programming mode, and programs it. The drawback is needing two chips, but after all they cost around $5, so it isn't that big a deal.
I seem to remember reading a post from somebody who was talking about work in progress to make it possible to upload sketches via Ethernet using an Ethernet-capable bootloader. I can't remember the details - did I make that up?
I seem to remember reading a post from somebody who was talking about work in progress to make it possible to upload sketches via Ethernet using an Ethernet-capable bootloader. I can’t remember the details - did I make that up?
Thanks Nick / PeterH,
Actually I found in this forum a couple of posts related of this work, but seems without solution…
I have check out how the TFTP bootloader works, and it’s looks like that’s only allow you to upload the sketch for about 5 seconds after the hardware reboot…
I know that in my post I was asking about to use the SD-Card to upload the sketches to the Arduino, but that’s not necessary can work by that way.
The point is that I was thinking about upgrade the sketches remotely, and I put the SD Card on this just to make sure that nothing wrong happens (Let’s supose that during upload the sketch by TFTP for some reason you loose the connection), probably you have to come there to reset the device by hand… and if you use the SD Card, you just will start upload the sketch after you make sure that have been done the download to SD Card!
Please correct me if I’m wrong, as I mentionated the TFTP works only for 5s after the arduino is rebooted or powered on…
Is that possible to configure a kind of command that you can add to the all of sketches to call the TFTP mode to start the download of the new sketch ?
Jumping to address 0 doesn't cause a hardware reset and thus would not enable the bootloader. The watchdog idea could be made to work.
I still think more reliable would be my suggestion of two chips: one to do the work, and the other to reprogram the first one.
Nick, thanks for the suggestion!
Do you have some diagram how to use the two chips and the sketch ?
Your idea is the best and reliable, since we need to make sure that's nothing wrong happens! Otherwise if the hardware is far away and it's crashes, we have to take a ride and fix that by hand!
I'm pretty sure that this idea is going to help a lot of people that have to handle with projects by distance that some times needs a firmware upgrade, and it can be done remotely !