I have installed PLatformIO in a Virtual Machine (W2012R2) which run on a HyperV W 2012 R2.
The physical USB Serial device is connected on the Host. It is detected as COM3.
On the host, I can run putty and manually type COM3 : I can see the string coming from my Arduino device.
I use RDP with the parameter “PORTS” checked in RDP Local resource.
On the VM, I start Putty and manually type COM3 : I can see the string comming from my Arduino device.
So, the serial port is working in the VM.
I also checked the COM3 with Aduino IDE which detect the port COM3. It work with Arduino IDE.
Unfortunately, PLatformIO doesn’t detect this port. I suppose this is because the COM port isn’t visible in “device Manager” of the VM. I can only see the COM port in REGEDIT.
Question : how can I force PLatformio to use COM3 : is it possible in a ini file?
I found that I can run monitor with this command : pio device monitor --port COM3
It works
Question : why COM 3 isn’t detected by PlatformIO.
How can I set COM3 as the SERIAL by default so I don’t need to use command line every time I need to do something?
It’s my first step with platformio and I don’t know if I’ll be able to download application in arduino device…
Thank for your advice.
I made several test with PlatformIO installed on a HyperV Virtual Machine (VM).
As already explained , the issue is with the programmer Upload of the Arduino target (TinyUSB or ArduinoISP).
I can connect the HOST COM3 (which is a FTDI USB<>UART Breakout Board) on the VM in two different way :
With RDP redirect option :
With this mode, the COM PORT isn’t show in device manager (normal with HyperV gen2) but I can see it in REGEDIT (HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM\device\VCP0=COM3)
I’m able to connect the COM3 with : PUTTY, Arduino IDE Monitor, PIO Monitor (if I set upload_port = COM3)
I’m able to program the target with Arduino IDE but not with PIO (I don’t know which parameter to program for COM) pio device list Show nothing
With pipe redirection
In this case, I create a new pipe for the VM COM1 which is available on the host and I redirect this pipe to the HOST COM3
In this case, the COM1 in the VM is created in device manager.
For Arduino IDE, it detect COM1 and I can use monitor but Uplaod target doesn’t work.
For PIO I don’t need to set “upload_port = COM3” as it detect the COM1 in device manager. PIO monitor is working well, but not upload.
Putty is working too.
After test, this mode seems worse than standard RDP redirection.
But I can see COM with command :
pio device list
COM1
Hardware ID: ACPI\PNP0501\1
Description: Communications Port (COM1)
COM2
Hardware ID: ACPI\PNP0501\2
Description: Communications Port (COM2)
Conclusion :
As it work for Arduino IDE, the first solution (RDP redirection) should work.
But PIO device list only detect device manager COM port and doesn’t work with avrdude…
The problem is that the baudrate need to be specified too.
Otherwhise you receive message like this :
Looking for upload port…
Use manually specified: COM3
Uploading .pioenvs\moteino\firmware.hex
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
Oups, it’s a mistake.
It work only if I set upload_speed to 57600. I didn’t try 115200.
Is it possible to have a monitor_port + Monitor_speed ?
It’s annoying to wait the popup and select COM port (more, I can’t select COM3 because this virtual port is not in device Manager)
I am using MACOS 10.12.5 , ATOM 1.18.0 , PlatformIO, version 3.5.0a4 and Moteino R5-USB .
I faced the same problem when loading the software
Looking for upload port…
Auto-detected: /dev/cu.usbserial-DA01I8AV
Uploading .pioenvs/moteino/firmware.hex
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xbc
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xad
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x1d
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x09
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x09
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xbc
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xad
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x1d
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x0a
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xbc
To MAP a serial port in a VM which is not detected in Device manager (so can’t be used in VSC)
The solutions to map such SERIAL port to SERIAL 1 with the command :
change port [=| /d | /query
You can MAP a serial with the command : change port COM1=COM4