Windows 7: COM Port for Model 01 not showing up

Is that LEGO First? My son was involved when he was younger, and I worked with a team about ten years ago that was sponsored by my employer. An amazing program. :slight_smile:

1 Like

It’s FIRST Robotics Competition (FRC) which is the high school level. FRIST Lego League (FLL) is at the elementary and middle school level. And yeah, it’s a great program. Great to see students get excited about academic/technology challenges.

2 Likes

Yup! Same program. My son participated through middle school, mostly to humor me, I think. He’s graduating high school this year and is interested in history, psychology, and teaching, not math/science/engineering. He’s social, outgoing, and musically inclined. Weird how different kids can be from parents. :slight_smile:

I wish your team success in the competitons!

3 Likes

I keep getting this:

Sketch uses 18152 bytes (63%) of program storage space. Maximum is 28672 bytes.
Global variables use 1659 bytes (64%) of dynamic memory, leaving 901 bytes for local variables. Maximum is 2560 bytes.
avrdude: ser_open(): can’t set com-state for "\.\COM4"
An error occurred while uploading the sketch

1 Like

I seem to get that same COM-4 message no matter what I do.

1 Like

Now I’m getting this:

Sketch uses 18152 bytes (63%) of program storage space. Maximum is 28672 bytes.
Global variables use 1659 bytes (64%) of dynamic memory, leaving 901 bytes for local variables. Maximum is 2560 bytes.
Forcing reset using 1200bps open/close on port COM4
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
Uploading using selected port: COM4
C:\Program Files (x86)\arduino-1.8.5-windows\arduino-1.8.5\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\arduino-1.8.5-windows\arduino-1.8.5\hardware\tools\avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -PCOM4 -b57600 -D -Uflash:w:C:\Users\Gaye\AppData\Local\Temp\arduino_build_797442/Model01-Firmware_plan1.ino.ino.hex:i

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
Copyright © 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright © 2007-2014 Joerg Wunsch

     System wide configuration file is "C:\Program Files (x86)\arduino-1.8.5-windows\arduino-1.8.5\hardware\tools\avr/etc/avrdude.conf"

     Using Port                    : COM4
     Using Programmer              : avr109
     Overriding Baud Rate          : 57600

avrdude: ser_open(): can’t set com-state for “\.\COM4”

So I installed the driver linked above before I got my keyboard… Device Manager shows Keyboardio Model 01 (COM7). I used driverquery from the cmd prompt to see that the device drive really was installed, since as noted Windows gives no feedback.

I had pulled from master, and updated plugins, which may have been a mistake. I’m generally pretty comfortable with git, but haven’t previously used submodules, so I may be doing something wrong there. Running “Verify” on Model01-Firmware.ino gives me this:

In file included from C:\Users\kajsa\Documents\Arduino\hardware\keyboardio\avr\libraries\Kaleidoscope\src/Kaleidoscope.h:23:0,

             from C:\Users\kajsa\Documents\Arduino\hardware\keyboardio\avr\libraries\Kaleidoscope-MouseKeys\src/Kaleidoscope-MouseKeys.h:3,

             from C:\Users\kajsa\Documents\Arduino\Model01-Firmware\Model01-Firmware.ino:12:

Model01-Firmware:77: error: 'Key_ToggleNumlock' was not declared in this scope

 Macro_Any,       Key_6, Key_7, Key_8,     Key_9,      Key_0,         Key_ToggleNumlock, \

                                                                      ^

C:\Users\kajsa\Documents\Arduino\hardware\keyboardio\avr\libraries\Kaleidoscope-Hardware-Model01\src/Kaleidoscope-Hardware-Model01.h:219:101: note: in definition of macro 'KEYMAP_STACKED'

 {r0c0, r0c1, r0c2, r0c3, r0c4, r0c5, r0c6, r0c7, r0c8, r0c9, r0c10, r0c11, r0c12, r0c13, r0c14, r0c15}, \
                                                                                                 ^
C:\Users\kajsa\Documents\Arduino\Model01-Firmware\Model01-Firmware.ino:86:3: note: in expansion of macro 'QWERTY'
   QWERTY,
   ^
C:\Users\kajsa\Documents\Arduino\Model01-Firmware\Model01-Firmware.ino: In function 'const macro_t* macroAction(uint8_t, uint8_t)':

Model01-Firmware:100: error: 'TOGGLENUMLOCK' was not declared in this scope

   if (macroIndex == TOGGLENUMLOCK && keyToggledOn(keyState)) {
                     ^
Model01-Firmware:101: error: 'class NumLock_' has no member named 'toggle'

 return NumLock.toggle();
                ^
Multiple libraries were found for "HID.h"
 Used: C:\Users\kajsa\Documents\Arduino\hardware\keyboardio\avr\libraries\HID
 Not used:             
C:\Users\kajsa\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.19\libraries\HIDexit status 1
'Key_ToggleNumlock' was not declared in this scope

When I hacked my way around that to get something that compiled (by disabling numlock), I got something that compiles, but I’m not able to flash successfully.

Global variables use 1697 bytes (66%) of dynamic memory, leaving 863 bytes for local variables. Maximum is 2560 bytes.
avrdude: ser_open(): can't set com-state for "\\.\COM7"
An error occurred while uploading the sketch
Invalid library found in 
C:\Users\kajsa\Documents\Arduino\hardware\keyboardio\avr\libraries\Kaleidoscope-Plugin
1 Like

Thank you for your patience and persistence.

I know this is super frustrating and disheartening to work through, but it will be worth it. I was a PVT user and it took me about a month to get things working for myself, so I’ve been there. Having it all working now, and being able to change what I want the keyboard to do more or less at a whim has been a game changer.

I am certain that Jesse will see this through and make it all right for you. I’m sorry it’s harder than anyone had a reason to expect.

Just in case, I tried checking out v1.19, and get the same problem when trying to flash, but this one doesn’t have the error with numlock.

(The numlock issue is version skew between Kaleidoscope and. the Model 01 Sketch)

1 Like

I figured it was something like that, which is why I wasn’t too worried about it.

1 Like

I tried turning off my firewall. I thought it was worth a shot but i don’t think it helped.

Here are some additional possible fixes:

And, uh, I was wrong. Apparently some Windows firewall software does meddle with serial ports. I had no idea.

1 Like

I’m getting the same issue despite installing the above keyboadio driver first. My Keyboadio shows on COM5 in Device Manager, and my Arduino IDE is set to COM5. Neverthe less, I get
avrdude: ser_open(): can't set com-state for "\\.\COM5"

I tried temporarily turning off the Windows Firewall (not to be confused with MS Essentials mentioned previously which is Antivirus), but still got the error.

@jesse - are you testing on a 32-bit or 64-bit Windows 7 install? Not sure if it plays a factor, but I want to track down any differences between your success and our failures. I’m running 64-bit version. What about you @Gaye and @kajsa.anderson? 32-bit or 64-bit?

1 Like

@Javaru Windows 7 Ulitmate SP1 x64, patched up to current, accepting all Microsoft defaults, but with no third party software other than the Arduino IDE. Windows is not activated, though it worked on the previous build, which was.

If there are windows diagnostic tools I can run that will give you a fuller picture of my system, I’m happy to run them.

OK, that matches me at a high level.

Not easily. You basically need to look at all the patches and see which are installed.

In Device Manager, is your Model01 on COM1? While I’m not seeing it specifically spelled out as such, it seems all the posts I find on this issue, people have the Arduino on some COM port other than 1. And some of the proposed solutions seem aimed at, or at least end up with, getting the Arduino so it is on COM1. And although we are selecting the COM port in the Ardunio IDE, I can’t help but wonder if there’s an issue there. I’m going to fire up my laptop and see if it has any other COM ports in use and try flashing it from there.

I’m also running 64-bit and it’s COM-4.

Arduino Nano - "avrdude: ser_open():system can't open device "\\.\COM1": the system cannot find the file specified" - Stack Overflow

I have already gone through this one when I was googling the problem a few days back. It was frustrating because their problem seems so simple and has a workable solution. It doesnt work for me, since its a different kind of problem, ie a wrong arduino config.

Right now, I am wondering why everyones error message is different from mine. Got a bunch of new usb c cables today, will try them out.

Edit: I will also try disabling my Windows firewall.

Also @jesse: what was the actual error you reproduced when you were testing it on win7? We seem to have uncovered two problems, com-state and missing file, which may or may not be related.

I was seeing the missing com port issue. I haven’t reproduced the other one.