Arduino on virtual machine

Hi. Since my Arduino Lilypad doesn't work properly with my Ubuntu machine I set up a Virtual Machine with VirtualBox and installed Windows XP on it.

I installed the Arduino software and the USB-drivers that come with it. Now I'm trying to upload the blink example, but something must have gone wrong... i'ts been uploading for 10 minutes now. There's no error message or anything, just the RX LED on the breakout board blinking all the time.

I also tried pressing the reset button before uploading to the board, didn't help...

Does anyone know how to help me?

I don't know virtualbox; all my vm work has been with VMware.

In general, the problem with VMs are getting the physical peripherals connected to the correct machine. USB can be particularly difficult, as they tend to come and go as they are connected and disconnected, and they show up in different places when they're plugged in to different ports.

Since you're using a lilypad I assume yo have an adapter to connect it. You can test the adapter connectivity on the vm by disconnecting the adapter from the lillypad and connecting the TX and RX pins with a wire (this is called a loopback). Bring up hyperterm (or your favorite terminal app) and every character you type should be echoed back to the screen.

This test will tell you if your lilypad adapter is on the com port you think it is, and is working.

-j

You are either going to need to:- Make Linux give up the USB to Serial device(FT232) and forward the device to your virtual device

I just setup Arduino-16 on my Ubuntu netbook.

What USB<->serial converter are you using?

If you are using an “official” FTDI cable I’m not sure if auto-reset will work. Unofficial cables ( http://www.hvwtech.com/products_view.asp?ProductID=926 ) bring out the DTR pin as opposed to RTS.

Try:- Hit “Upload to IO Board”

  • Then, quickly hit reset(within 1 second)

This is how you upload a program when auto-reset is disabled.

The auto-reset feature is a pretty big mess. When the arduino is rebooted by using the reset button it goes into a mode where it allows uploading of programs for a short time. The “Arduino” way is to connect the serial-port’s DTR pin to the Arduino’s reset button.

One problem is that some cables bring out DTR and others RTS or CTS. Another problem is that these pins can have any value when the serial-port is opened. So if your Mac has RTS low when the port is opened and your Linux box has it high, your Mac will restart the Arduino and your Linux box won’t (low to reset, high to run).

I connected the RX1 and the TX0 pin on my breakout board (picture).

I'm not familiar with Hyperterm so I followed these rules. I selected COM 3 because this is the only port available. When typing into the input field nothing happens (Is the white area with a blinking cursor an input field or do I have to send my data from somewhere else?).

What do I have to do now?

it looks like Virtual-Box just remaps your first 4 serial-ports ( http://techtooltip.wordpress.com/2008/09/12/using-host-serial-port-from-guest-in-virtual-box/ ).

You should be able to just move port-names around to get te serial-port into Virtual box.

sudo mv /dev/ttyS2 /dev/ttyS2old
sudo mv /dev/ttyUSB0 /dev/ttyS2

Anyhoo, you said

I also tried pressing the reset button before uploading to the board, didn’t help…

Which won’t work, You have to hit the reset button AFTER hitting upload in the Arduino-IDE.

It works now, thanks a lot!

It's funny how the auto-reset feature makes things much more and much less complex at the same time. Everything magically works... just not all the time.

I think we would be better off with no auto-reset and a pop-up in the Arduino-IDE that tells you to press the reset button AFTER hitting upload.