Avr dude can't get com-state for COM8

Hello,

I am currently using an arduino uno with a Open electrons NXShield attached to grant me usage of LEGO Mindstorms Servo motors. I have edited an example code provided by the open electrons site to make a LED change brightness in accordance to the output of the rotation sensor built into Mindstorms motors.

But when I attempt to download, The IDE throws this error:

avrdude: ser_open can’t set com-state for //./COM8

I have research it heavily and found that many people have had similar problems but none of the fixes suggested by those forums has worked.

Also , after avrdude throws that error, the IDE says it is still uploading on the right side of the green download status bar, but there is no progress bar or ‘copy to clipboard’ buttons on the left side. The IDE isn’t frozen, because I can still edit the code when it says uploading, but it doesn’t stop uploading until I save it or compile it.

On that note, the program compiles just fine.

Here is my code:

#include <Wire.h>
#include <AngleSensor.h>
#include <NXShield.h>

NXShield nxshield; 
AngleSensor angle1;

void setup(){
  Serial.begin(9600);
  delay(500);
  Serial.println('Serial has begun');
  nxshield.init(SH_HardwareI2C);
  Serial.println('nxshield has been initialized');
  Serial.println('Press Go');
  nxshield.waitForButtonPress(BTN_GO);
  Serial.println("go pressed");
  angle1.init(&nxshield,SH_BBS1);
  Serial.println('Angle senor initialized on port BBS1');
  pinMode(13,OUTPUT);
  Serial.println('pinmode initialized,testing light on pin 13. If success, press go. otherwise,Put the wire in the right spot.');
  digitalWrite(13,HIGH);
  nxshield.waitForButtonPress(BTN_GO);
  Serial.println('apperntly a success.Continuing on that port.');
  delay(1000);
}
void loop(){
  Serial.println('Oh wait! there is nothing programmed.Darn.');
  nxshield.waitForButtonPress(BTN_GO);
  Serial.println('sorry!GO still does nothing.');
  delay(4000000);
};

You’ll notice I added some extra serial print stuff in case I display this to my robotics club.

You’ll also notice that I added some pin identification stuff because the pins might get taken out and put back in the wrong spot.

And there is nothing in the void loop yet.

There are no pictures because I can’t figure out how to upload a picture to this forum.

And please be easy on the answer! I just started with the arduino a month ago and barely know much more then what AVRdude and baud rate are. And I’m twelve.

Thank you!

The hermanoid

hermanoid:
There are no pictures because I can’t figure out how to upload a picture to this forum.

So, the "Upload Attachments" tab doesn't give you any clues whatsoever?

oh. hmm. thank you skimask.

I posted a little to soon. after updating arduino a re-restarting the computer, the file does finish uploading. Or would, I think, if this error would go away. It did let me in to copy the error message to clipboard:

Arduino: 1.6.4 (Windows 8.1), Board: "Arduino Uno"

Using library Wire in folder: C:\Users\Lucas\Downloads\arduino-1.6.4\hardware\arduino\avr\libraries\Wire 



C:\Users\Lucas\Downloads\arduino-1.6.4\hardware\tools\avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10604 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\Lucas\Downloads\arduino-1.6.4\hardware\arduino\avr\cores\arduino -IC:\Users\Lucas\Downloads\arduino-1.6.4\hardware\arduino\avr\variants\standard -IC:\Users\Lucas\Downloads\arduino-1.6.4\hardware\arduino\avr\libraries\Wire C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\finding_I2c_adress.cpp -o C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\finding_I2c_adress.cpp.o 

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\Wire\Wire.cpp.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\Wire\utility\twi.c.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\hooks.c.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\WInterrupts.c.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\wiring.c.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\wiring_analog.c.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\wiring_digital.c.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\wiring_pulse.c.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\wiring_shift.c.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\abi.cpp.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\CDC.cpp.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\HardwareSerial.cpp.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\HardwareSerial0.cpp.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\HardwareSerial1.cpp.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\HardwareSerial2.cpp.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\HardwareSerial3.cpp.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\HID.cpp.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\IPAddress.cpp.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\main.cpp.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\new.cpp.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\Print.cpp.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\Stream.cpp.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\Tone.cpp.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\USBCore.cpp.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\WMath.cpp.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\WString.cpp.o

Using previously compiled file: C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\core.a

C:\Users\Lucas\Downloads\arduino-1.6.4\hardware\tools\avr/bin/avr-gcc -w -Os -Wl,--gc-sections -mmcu=atmega328p -o C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp/finding_I2c_adress.cpp.elf C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\finding_I2c_adress.cpp.o C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\Wire\Wire.cpp.o C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp\Wire\utility\twi.c.o C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp/core.a -LC:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp -lm 

C:\Users\Lucas\Downloads\arduino-1.6.4\hardware\tools\avr/bin/avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp/finding_I2c_adress.cpp.elf C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp/finding_I2c_adress.cpp.eep 

C:\Users\Lucas\Downloads\arduino-1.6.4\hardware\tools\avr/bin/avr-objcopy -O ihex -R .eeprom C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp/finding_I2c_adress.cpp.elf C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp/finding_I2c_adress.cpp.hex 



Sketch uses 4,138 bytes (12%) of program storage space. Maximum is 32,256 bytes.

Global variables use 508 bytes (24%) of dynamic memory, leaving 1,540 bytes for local variables. Maximum is 2,048 bytes.

C:\Users\Lucas\Downloads\arduino-1.6.4\hardware\tools\avr/bin/avrdude -CC:\Users\Lucas\Downloads\arduino-1.6.4\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM8 -b115200 -D -Uflash:w:C:\Users\Lucas\AppData\Local\Temp\build2561530836571937091.tmp/finding_I2c_adress.cpp.hex:i 



avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58

         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         Copyright (c) 2007-2009 Joerg Wunsch



         System wide configuration file is "C:\Users\Lucas\Downloads\arduino-1.6.4\hardware\tools\avr/etc/avrdude.conf"



         Using Port                    : COM8

         Using Programmer              : arduino

         Overriding Baud Rate          : 115200

avrdude: ser_open(): can't open device "\\.\COM8": The system cannot find the file specified.






avrdude done.  Thank you.



Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

The Url at the bottom is didn’t help at all.

Thank you!

the Hermanoid

Check this site for possible solution:

http://forum.arduino.cc/index.php?topic=185594.0

Another link to possible solution:

http://stackoverflow.com/questions/2571 … the-system

Thank you DanV!

That worked perfectly!

The hermanoid