I tried different times to use socat and ser2net in order to upload a sketch to an Arduino Uno (connected to a PC) from my laptop, unsuccessfully. Can anyone teach me how to achieve this goal? I use Linux.
-
have not tried it so I wont call it an answer. I see that avrdude support TCP interface. I would try it manually first. Turn on verbose and compile it, find the avrdude command in the verbose. Then go to the output temp directory and issue it manually but replacing the ttyS with the TCP interface with IP and Socket of your ser2net, as found in the avrdude help.mpflaga– mpflaga2015年05月19日 23:27:57 +00:00Commented May 19, 2015 at 23:27
-
Ok, but after that, there is no way to set in Ecipse Arduino Plugin avrude in order to reach an Arduino through IP... or not? :)Patrick Roncagliolo– Patrick Roncagliolo2015年05月20日 05:09:48 +00:00Commented May 20, 2015 at 5:09
3 Answers 3
I've been searching through the net for some days, in order to discover how I could easily upload a sketch to an Arduino that is not phisically connected to my PC, but instead that is connected to an another one, that belongs to the same LAN. I mean:
PC1-SERVER Arduino Uno is connected to this PC with classic USB cable. This PC is running Ubuntu linux, and sees Arduino as a serial port /dev/ttyACM0.
PC2-CLIENT This is the PC where I create and compile the sketch. I want to upload the sketch to the Arduino Uno described above (so, connected to SERVER, port /dev/ttyACM0)
SOLUTION: server-side commands:
Code:
sudo apt-get install ssh-server ser2net
sudo passwd root (to set the root password)
sudo reboot
client-side commands (assuming 192.168.0.7 as IP address of SERVER):
Code:
ssh -L 8086:localhost:8086 [email protected] \
'/usr/sbin/ser2net -d -C "8086:raw:600:/dev/ttyACM0:115200 NONE 1STOPBIT \
8DATABITS -XONXOFF LOCAL -RTSCTS HANGUP_WHEN_DONE "'
you can then upload sketches to arduino doing this:
Code:
avrdude -C /path/to/avrdude.conf -p atmega328p -c arduino -P net:localhost:8086 -U flash:w:/path/to/file.hex:i
NOTE: In Eclipse, if you are using the arduino plugin, just place "net:localhost:8086" in the configuration panel, where "port:" field is required.
This solution was also posted on arduino forum.
You can use an ethernet to ttl adapter and then install a virtual com software.
What i did was the following.
I used an ethernet to 232 converter, and tweaked the board as you can see in the attached photo, I removed the 232 chip and jumpered the ttl directly to the output.
Then I installed USR-VCOM and set a virtual com port that shows in the arduino ide, it works without any software /boot changes
I am not sure how to remote reset the arduino.... Probably someone else knows.
enter image description here
-
One of the 232 signal lines like DTR or could work like a reset. You could also make your Arduino reset if it receives a specific message, and the send the code.aaa– aaa2017年01月12日 06:13:27 +00:00Commented Jan 12, 2017 at 6:13
-
"You could also make your Arduino reset if it receives a specific message" yes, the only problem is that the standard Arduino bootloaders such as optiboot are not activated after a watchdog reset so you would either need to modify the bootloader or do a hardware reset.per1234– per12342017年01月12日 06:57:40 +00:00Commented Jan 12, 2017 at 6:57
Basically it would require another bootloader.
You might want to check this out: http://playground.arduino.cc/Code/TFTPBootloader1
Programming through serial
I don't have the intention to advertise a product, but I worked with an Lantronix xport which was able to receive serial information (or a telnet session) over ethernet. You might want to look into cheaper models of other manufacturers (that do not use modem like commands) you should look for ethernet to serial converters. It should be compatible with: http://blog.solutions-cubed.com/programming-the-arduino-uno-with-a-serial-port/
You might also connect to another PC over ethernet which then programs the arduino
This would require another PC, but can be fairly easy to set up, but cumbersome to use. You could use teamviewer or another remote desktop. Find a way to send your code (or completely program it at the other pc) and then execute the program command. You might even check if it's possible to use an raspberry PI instead of a full PC (always wanted to try this).
Use an arduino to program your arduino
You might use an arduino that receives code and then uploads it to another arduino. Not sure how that works out. Or how to get the code on the first arduino. Should work fine if you've got something like a modificated arduino webserver running.
Also details on programming arduino can be found here: http://www.arduino.cc/en/Tutorial/ArduinoISP
-
Well, you've given me an idea. X tunneling through SSH connection to host, were arduino is connected, than invoke the IDE and use it remotely.Patrick Roncagliolo– Patrick Roncagliolo2015年05月21日 14:47:07 +00:00Commented May 21, 2015 at 14:47
-
Yup, my answer was just some "brainstorming" if I re-read them, most of them wouldn't really work or just barely. But they indeed give a view on the possibilities. Creating a custom solution, to fit your needs would indeed be the best. If you want to not use another PC, you should check on how an arduino is programmed, how to send the program over ethernet and how to mimic the programming on the other side. But establishing a connection with a PC over ethernet, and than program it through that would be the best, but a lot of options are possible here also.aaa– aaa2015年05月22日 06:26:01 +00:00Commented May 22, 2015 at 6:26