Windows 7: COM Port for Model 01 not showing up

Is it giving any specific error message? It’s possible the temp directory changed. You can try restarting the Aurduino IDE and starting over (with Part 2). Keep in mind you will need to recopy the command as the temp directory it uses will change after the restart. Also make sure you saved the example sketch to a different directory (Part 2 Step 3). I had an issue it would not run for the example sketch in the default location since it’s a read only file. Try those things and if still no luck let us know if there is a specific error message, or describe what happens.

1 Like

It says C:program is not recognized as an internal or external command, operable program, or batch file. Can I install the program somewhere else besides there? Is that the issue?

sounds like you need to set that in your path env or run it from that directory

edit: or run as administrator?

Strange it’s doing that. But I think I see why. In the command in notepad, sesrch for forward slash / and replace with a back slash \ Then paste that into the comand line. If that doesn’t work we can do some quoting of the command and arguments. Let me know if it doesn’t work and I’ll tell you how to do the quoting.

I keep getting the same thing but I can’t use the keyboard to hit enter so i lose some time with the on-screen one and I did try running as administrator as well.

Ah, ok. I’m just about leave to head home. When I get home I can write up some alternative steps for you.

Try putting your pathes in quotation marks. Its the space that breaks it. Try it like this

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude" -C"C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -patmega32u4 -cavr109 -PCOM5 -b57600 -D -Uflash:w:C:\Users\Gaye\AppData\Local\Temp\arduino_build_830835/Model01-Firmware.ino.hex:i

See where i put the quotation marks? (You will probably have to change the path to the hhex file since this one is prolly gone by now)

It shouldn’t cause any issues to have your old keyboard plugged in as well as the Keyboardio, if that would help with the copy/paste and you have a spare usb port.

Now it says it can’t open device COM5. Can’t find the file

Edit: Now it’s saying can’t set com state for COM5

@Gaye - It looks like you are hitting two speed bumps in the road to success here.

The first issue you are running into is that (for some reason) the Arduino IDE is running the command from a different directory than it does for me. And in your case, the path to that directory has spaces in it. Spaces in command line commands are a problem. So to work around that, we need to surround the paths with the spaces in quotes as @rumpel mentioned. I would also replace the forward slashes with back slashes. So the command for you becomes:

"C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude" -C"C:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf" -v -patmega32u4 -cavr109 -PCOM5 -b57600 -D -Uflash:w:C:\Users\Gaye\AppData\Local\Temp\arduino_build_830835\Model01-Firmware.ino.hex:i

You may need to update the number in the build_830835 part if you have restarted the Arduino IDE at all.

The second issue is that you said you cannot hit enter on the keyboard to run the command. I’ve edited the main instructions above so it has a “Part 4: Run the command” Option B You do not have a second keyboard you can plug in and are not on a laptop or your laptop keyboard does not work section that should help you run the command. Unfortunately there is a little acrobatics involved in that you need to get the command to start running as quickly as possible after the prog light come on.

I know these instructions can be daunting for people that are not use to using the command line. For us programmers or “power users” it is second nature. And this is a convoluted workaround that we hope to simplify soon. But until we do, it’s the best we have. I’m happy (as are other community members) to help work through this with you until we get it up and running for you.

Give the command I show above a try. If it doesn’t work, I’d recommend starting from the very beginning of my instructions and slowly working through them. Ultimately, your command should look like the one I just posted in this reply with only the number in the arduino_build_830835 directory changing. If you still have issues, just let us know what is happening and we’ll try and help you out.

1 Like

now it says filename, directory name, or volume label syntax is incorrect. probably took it from the wrong folder. I’ve lost track of what’s what here. That’s okay. I’ll try after supper.

:slight_smile: yeah, that’s not uncommon when following a long set of instructions and then going back to change things after it fails at some point. Experience has taught me in such situations the best thing is to start fresh from the beginning and go through everything slowly and carefully. We developers even have a joking expression for this: "fdisk and start over!!" (the fdisk command is used to completely wipe a hard drive clean, that is to delete everything on it.) It’s easy to miss something or misremember something as you go through it again. Trust me, I and many programmers out there have wasted a lot of time in our careers because of that :wink: So take it slow and read each step. And hopefully supper will refresh you.

1 Like

Well, by golly, I think I did it but I’ve lost my modified plan so now I’ll have to redo it and I’ll let you know …

2 Likes

As I thought about it, a PowerShell script would be much better. Besides being the modern way to write Windows scripts, it does have a more powerful language than batch files, and it offers things like opening dialog boxes for a better user experience. (See Break Your Batch Habit and Move to PowerShell )

I’ve done a little PowerShell scripting. I’ve got a basic one started that can loop until a COM port is available. I’ll do a little more work on it and then get it into Git. I can likely get it so there is a lot less hoop jumping for people. People can paste the command the Arduino IDE outputs into a dialog box and the script can normalize and escape it as necessary and then run it with directional GUI prompts. (If there is an Ardunio IDE log file we can parse to get the command, all the more better, @jesse, know of any?) The more we can folks away form the command line, the better I think.

2 Likes

It worked and I didn’t have to do the cmd thing. It changed the port number and just … worked. Everything just started flashing and it was done. Thank you ever so much. Now I have no excuse not to work … LOL I knew it wouldn’t last

3 Likes

I’m starting to wonder if all we need to do is plug the Model 01 in one time in bootloader mode so Windows registers the COM port for it. Boy, wouldn’t that be nice. I added a comment n the instructions asking people to leave a comment if that is all they needed to do. I have an old Win 7 box in the closet. If I get a chance, I’ll break it out as a “never been touched” test bed and see if just doing that works.

Edit I just remembered I had another Win 7 laptop at hand. After installing @jesse’s driver, I tried uploading firmware on it… It failed. Then all I did was close the IDE, attach the Model 01 in bootloader mode once, restarted the IDE, and was able to successfully upload the firmware!!

I updated my post above with a “Potential Solution” prior to the workaround. I have high hopes this is the fix. It makes sense that all we need to do is get the bootloader (and its COM port) registered as a USB device in Windows. I’ll still test this on my other system (from the closet) some time tomorrow as an additional data point. But I’m hopeful this is the solution. :man_dancing:

2 Likes

@Javaru If that’s the case, then it should be as simple as trying to flash a couple times, Possibly quitting Arduino after the first one. The act of trying to flash with the “Prog” key held down causes the device to disconnect and reconnect in bootloader mode.

@jesse I think it’s a case that during the upload process via the IDE, Windows does not detect the bootloader as a new device and install the USB drivers for it. It goes back to your theory of Windows not having enough time.

In the test I just did on the second laptop, I had upload verbose output turned on. The first time the IDE (well avrdude) only tried to connect to the Keyboard COM port. It never logged an attempt to connect to (what ultimately was) the bootloader’s COM port. Moreover, I never saw the bootloader’s COM port show/flash in the device manager. After attaching the keyboard in bootloader mode once, the IDE/avrdude did try the bootloader’s COM port and I’m pretty sure it flashed in the device manager briefly. I’ll record a screencast of the whole process when I try it on another system. Also Tuesday at my Robotics team meeting I’ll have access to 3 Win 7 laptops to test it on.

1 Like

You can avoid dealing with temp files if you export the binary via the “Sketch” menu - it places a .hex file in the same directory as your .ino file.

1 Like

Good to know. I just revised my file and tried again and the first two times it failed and the third it worked without copying to cmd, etc