I am looking for a solution to updating sketches on an Arduino in a remote location.
I am aware of Codebender remote programming.
Unless I am mistaken, it seems tricky to implement.
I would like something a bit more conventional like....
Option 1:
Have a remote computer at my disposal to which I have Remote Desktop access
Remote computer will be set up with Arduino IDE
Someone at remote computer plugs Arduino into USB port
I edit sketch remotely and upload to the Arduino
Person at remote computer unplugs the Arduino
Option 2:
Have a remote computer at my disposal on a LAN
I join the remote LAN with my computer over the internet
Someone at remote computer plugs Arduino into USB port
I have the remote port the Arduino is plugged into appear as a port on my computer (a bit like mapping a hard disk on a network)
I edit the sketch on my computer
I upload the sketch from my computer to the Arduino
The person at the remote computer unplugs the Arduino
I am in South East Asia and the Arduino will be in North America.
I am pretty sure Option 1 is doable, but my preference would be something like Option 2.
Is anyone else doing remote programming?
If so, how are u doing it? - appreciate if you would share.
Are you looking for security (remote person doesn't ever hold a copy of your source code)? Or are you looking for simplicity (remote person can't do anything more complex than plugging in a USB)?
MorganS:
Are you looking for security (remote person doesn't ever hold a copy of your source code)? Or are you looking for simplicity (remote person can't do anything more complex than plugging in a USB)?
Simplicity - person could be a secretary with zero technical knowledge.
I am actually building the unit to be remotely programmed at the moment.
I was looking at this method for remote programming.
Referring to your below post from this thread on the face of it, your method seems easier, so I would like to know more.
john1993:
for my method you need an arduino with rx and reset connected to tx and an io pin on the esp8266. those are the only two signals required. for software the arduino must have a simple bootloader installed and the esp a small lua script. at the other location a regular internet browser running on cell, tablet, or pc.
for long distance there must be a router or other hot spot nearby. for local no ap, they can just talk to each other direct.
when i get a chance i will put up some attachments. probably start a thread to avoid hijacking.
For the remote Arduino, do Rx and Reset only have to be connected to TX/ESP8266 pin for programing? i.e. is it a temporary connection? If so, I am thinking along the lines of using an external switch which can be flicked to enter programming mode.
Read the blog, the bit about the hardware anyway and skimmed through the software part.
Seems very complicated and not stable.
I agree, lets see what john1993 can teach us.
Today in my spare time at work I loaded the ESP8266 firmware as instructed on this page using serial connection and ESP8266Flasher.exe.
I have connected to it through WIFI to get the configuration web page where I specified the module type (ESP-01) and the baud rate needed. I then connected to a pro-mini that was running the basic blink sketch with added code to just print an incrementing number to serial. Through the web interface I can see the serial numbers incrementing and can also reset the pro-mini.
I have yet to try uploading a new sketch and have not found a way to view the serial stream in anything other than the web interface. I tried telnet but got nothing and I suspect the problem may be the wireless network at work so will have to wait till I'm home with time to spare (probably Wednesday/Thursday now) and a wifi network I can manage.
After connecting to home WIFI I managed to read serial data using Putty configured to Telnet port 23 so work WIFI was holding be back.
The next step of programming the pro-mini over WIFI proved to be a bit of a ball ache but not because the method was complex and difficult to do but because it turns out the Windows version of avrdude does not support network programming, only the Linux version does.
Because of this I had to download and install a Linux distro (ubuntu) into a virtual machine. Then (after problems with display resolution that took a bit of sorting) install Arduino IDE and grab the verbose upload command line when trying to upload over serial, change it to suit network upload and paste into terminal window and bingo. Hex file upload over WIFI worked a treat using the cheap ESP-01 module.
Riva:
After connecting to home WIFI I managed to read serial data using Putty configured to Telnet port 23 so work WIFI was holding be back.
The next step of programming the pro-mini over WIFI proved to be a bit of a ball ache but not because the method was complex and difficult to do but because it turns out the Windows version of avrdude does not support network programming, only the Linux version does.
Because of this I had to download and install a Linux distro (ubuntu) into a virtual machine. Then (after problems with display resolution that took a bit of sorting) install Arduino IDE and grab the verbose upload command line when trying to upload over serial, change it to suit network upload and paste into terminal window and bingo. Hex file upload over WIFI worked a treat using the cheap ESP-01 module.
Thanks for the update. I must say it all sounds rather daunting.
It looks like I will inevitably have to brush up on my Linux skills.
Assuming the target Arduino it remote from you, what would be required to hook up the target Arduino in order to be programmed?
aisc:
Thanks for the update. I must say it all sounds rather daunting.
It looks like I will inevitably have to brush up on my Linux skills.
Assuming the target Arduino it remote from you, what would be required to hook up the target Arduino in order to be programmed?
Not daunting to setup.
Just correctly connect the ESP8266 in programming mode to an FTDI device or use an Arduino (I used my 3.3V Arduino UNO).
Use ESP8266Flasher to upload the 3x bin files.
Re-boot the ESP into non programming mode and connect to it's wireless access point over WIFI.
Open a web browser to 192.168.4.1 and from the web pages select the WIFI network you want to connect to and it's password.
Either here or after connecting to the other wifi network configure the device type and serial programming speed.
That's it done for the ESP8266, every time it's powered up it will try to connect to the configured network.
I think you would need the wireless router the remote arduino is connected on to allow port forwarding so it can get out to the internet and connections can get in.
I am doing lots of remote Firmware changes. The easiest way for me is an Raspberry Pi Zero W. The Arduino is simply programmed via AVR Dude and the upload process is started via a PHP page that is accessible from the outside. This page has some authentication and will on success launch a background avrdude process if none is running already.
Pretty easy