Windows 7: COM Port for Model 01 not showing up

1st Edit (2017-10-29 17:45 EDT) - Fixed some typos. Improved instructions based on some feedback.
2nd Edit (2017-10-39 18:32 EDT) - Fixed some additional typos, some of which were introduced in my 1st edit :slight_smile: Added an additional screenshot.
3rd Edit (2017-10-29 20:18 EDT) - Added a statement asking folks to let us know if just plugging the keyboard in once in bootloader mode solves things
4th Edit (2017-10-29 20:50 EDT) - Added a potential simple solution
5th Edit (2017-11-01 17:40 EDT) - Added note about new Wiki pages that cover this information.

================================

The information discussed in this post has been formalized at the Keyboardio Wiki. The Wiki will be updated as needed, whereas this post will not, and will thus the Wiki will contain the latest & best information. You can access the information at:

================================

Potential Simple Solution
It’s possible we have a very simple solution to this issue. Please try this first. And please post a reply in the comments as to whether or not the the simply solution worked for you. If it does not, use the workaround below (and let us know in your reply if that worked for you.)

  1. Close the Ardunio IDE
  2. If you have not already, install the Keyboardio Model 01 USB driver that Jesse provided above in the ZIP file
  3. Unplug your Model 01 from the computer. Wait for a good 10 seconds. You should hear the standard USB disconnect sound.
  4. Hold the prog key down on the Model 01 and plug it back in while you hold the prog key down. Once the red light under the prog key turns on, you can let go of the key. (This attaches the Model 01 in bootloader mode. And it lets the bootloader’s COM port be registered in Windows.)
  5. Wait for the red led light to go out. When it does, you should here the USB disconnect sounds (this is the bootlader USB device disconnecting), and then a few seconds later the USB connecting sound. (This is the Model 01 connecting as a keyboard).
  6. Start the Arduino IDE and follow the steps outlined in the “Install Arduino support on Windows” guide. Run through “Step Two” again to make sure the COM port is still selected. And try to upload the Firmware as described in “Step Three”

If this works, please let us know! If not, here’s the workaround…

The Workaround… keep in mind, as I noted in my previous post, this is a workaround and not necessarily a final solution. Workarounds by definition can be “clunky”. And this one certainly is. Please try and it and post your results. This has worked for me on two different Window 7 systems.

Part 0: Prerequisites

  1. Install the Keyboardio Model 01 USB driver that Jesse provided above in the ZIP file
  2. Run through the “Install Arduino support on Windows” “Step One” (Install the Arduino IDE) and “Step Two” (Install Keyboardio support to Arduino IDE). You can skip “Step Three” given that this is the part that is failing.

Part 1: Determine Bootloader’s COM port

  1. Open window’s Device Manager (either via the control panel, or search for Device Manager in the start menu)
  2. Expand the “Ports (COM & LPT)” node:
    01
  3. Unplug your Model 01 from the computer. Wait for it to disappear from the list of COM ports and the Device Manager screen to refresh
  4. Keep an eye on the Device Manager screen as you do the following… Hold the prog key down on the Model 01 and plug it back in while you hold it down. (Once the red light under the prog key comes on, you can release it.) Watch the Device Manger. It will refresh a couple of times. At one point it will briefly show the Booltloader COM port. You need to make a mental note (or grab a screen shot via Print Screen) In this case, it shows that it is on COM6
    02
  5. Make a note of this COM port as the booloader COM port.

Part 2:Get The Command Needed
In the below discussion, UserName is used as a generic user name. It will obviously be different on your PC. Make the change as appropriate. Also, the name of your sketch may be different, In my case I saved it as MY_Model01-Firmware and that name shows up in the examples I pasted. Your sketch name may (or likely will) be different. More is discussed about such in the steps.

  1. If it is already running close Arduino IDE (we need a fresh run)
  2. Start the Arduino IDE
  3. Open the sketch
    • IMPORTANT If opening the example sketch, Go to File > Save As (or type Ctrl+Shift+S) and save the sketch. You may get “read only” issues if you use the example sketch directly. Plus, eventually you will want to edit the sketch to suit your needs, So you might as well save it now. By default, it will save the sketch in C:\Users\UserName\Documents\Arduino. It will save it in a sub-directory with the name you chose to save it as. In my case, I saved it as “MY_Model01-Firmware” and it was saved in C:\Users\UserName\Documents\Arduino\MY_Model01-Firmware. That name and path appears in the sample output I show below.
  4. Go to File > Preferences (or type Ctrl+Comma). On the settings tab, turn on verbose output for Upload:
  5. Make sure that under Tools > Boards that “Keyboardio Model 01” is selected as the board and that the correct port is selected. This will be the port of your “Keyboardio Model 01” and not of the bootloader we determined previously. See the “Install Arduino support on Windows” for more information.
  6. Run Verify using the check mark button. verify
  7. If you get errors, you need to fix the sketch. If you just saved the Example Sketch and did not edit it, you should not get any errors. After a successful “verify” (a.k.a. compile), Click the Upload button (the right facing arrow button) upload then press and hold the prog button on your Model 01. This step may fail, and in fact most likely will fail. This is what this workaround is trying to fix. But we need information from this step’s output, so we have to run it.
    • Sometimes this step works. I think the act of plugging the keyboard in via boot mode resets something. (When it works, the bootloader’s COM port is shown in the command used where as normally it shows the Model 01’s COM port).
    :exclamation: If loading your firmware now works without proceeding any further, please add a reply telling us this. It’s possible all we need to do is plug the Model 01 into windows one time in bootloader mode so Windows registers the COM port. If that is indeed the case, that would make this a MUCH simpler process than having to continue with all the steps below. Thanks!
  8. Within the verbose output – after the list PORTS {COM1, COM7, } / {COM1, COM7, } => {} outputs – there will be the command that the uploader runs. It will look something like this:
    C:\Users\UserName\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9/bin/avrdude -CC:\Users\UserName\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9/etc/avrdude.conf -v -patmega32u4 -cavr109 -PCOM6 -b57600 -D -Uflash:w:C:\Users\UserName\AppData\Local\Temp\arduino_build_651045/MY_Model01-Firmware.ino.hex:i

  1. Copy that command. You can use your mouse to select it and then Ctrl+C to copy it. It’s a long command, so be sure to get it all. It should end with ...ino.hex:i
  2. IMPORTANT : This command will not be the same each time you do this. It contains a temp directory as one of the arguments. (for example ...Local\Temp\arduino_build_651045... The number in that directory (and thus the actual directory name) will change each time you restart Ardunio IDE. You can use it for a session. But you will need to rerun the upload to get the updated command again after a restart and then repeat Part 3 below.

Part 3: Prep/Edit the command

  1. Paste the command from the previous section in a Plain Text Editor like Notepad (built into Windows) or EditPad, notepad++, UltraEdit, etc. Do not use a word processor like Word.
  2. In the command text, you will find the -P switch which sets the port. It will look like this -PCOM7. The actual port number may vary on your system. It should be the port you selected in the Tools menu above. Change the number to the COM port of the bootloader we determined in Part1 above. So in my case I edited it from -PCOM7 (my “Keyboardio Model 01” port) to -PCOM6 (my “Keyboardio Model 01 Bootloader” COM port I determined via the steps in Part 1).
  3. Using your editor’s search and replace, Edit > Replace in Notepad, (or doing it manually) replace all forward slashes / with back slashes \ For example, avrdude\6.3.0-arduino9/bin/avrdude will become avrdude\6.3.0-arduino9\bin\avrdude. If you are doing this manually double check yourself as it’s easy to miss one. (been there, done that, got the T-Shirt).
    08b
  4. While this step is not always necessary, it has proved to be for some people. If any paths in the command has spaces in it, we need to quote those values. The first one will be the actual command. In the example command I show above, there are no spaces. But one user had, after replacing the slashes, the command:
    C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf -v -patmega32u4 -cavr109 -PCOM5 -b57600 -D -Uflash:w:C:\Users\UserName\AppData\Local\Temp\arduino_build_830835\Model01-Firmware.ino.hex:i.
    First we need to quote the command. So, in this example:
    C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude
    becomes
    "C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude".
    Next, for the -C swtich argument, we need to quote that path. So this:
    -CC:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf
    becomes
    "-CC:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf"
    Finally, we should escape the path for the flash file. In the example we have here, there is no space in this path. But there could be. We want to quote before the C:\ and then close the quote at the end of the .ino.hex.i, So this:
    -Uflash:w:C:\Users\UserName\AppData\Local\Temp\arduino_build_830835\Model01-Firmware.ino.hex:i
    becomes:
    -Uflash:w:"C:\Users\UserName\AppData\Local\Temp\arduino_build_830835\Model01-Firmware.ino.hex:i"
    Thus the finally command 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\UserName\AppData\Local\Temp\arduino_build_830835\Model01-Firmware.ino.hex:i"
    Note: I know this can be a bit confusing and over-wheeling for people who are not use to using a command line. Sorry about that. But it is unfortunately what we need to do right now to workaround this issue. We (the community and Keyboardio) hope to have at a minimum a better workaround, or more preferably a solution, soon.

Part 4: Run the command

Option A - You have a second keyboard you can plug in or are on a laptop and your laptop keyboard works

  1. Copy the edited command back into your clipboard. (Use Edit > Select All and then Edit > Copy) Try to copy it so you do NOT get any ending new-line/return character.
  2. Open the command window. Do this by searching for cmd in the start menu or type Win+R and enter cmd in the “Run” dialog and click OK.
  3. Paste the command into the command window after the C:\Users\UserName> prompt (the actual prompt may vary. It doesn’t matter.) Note that Ctrl+V will NOT work in the command window. Instead, right click in the window and select Paste from the context menu:
    05
  4. If you successfully did not copy the new-line/return character, the command will not be actually run yet. If you did and the command ran, just hit the up arrow to get the command back at the command prompt.
  5. Unplug your Model 01 from PC. Wait a good 10 seconds. You should hear the standard USB disconnect tone. If you want to be absolutely sure, make sure that the “Keyboardio Model 01” no longer shows under “Ports (CON & LPT)” in Device Manager
  6. Get ready for some acrobatics… Make sure the command window has focus. You need to hold down the prog key on your keyboard and plug it into the PC. As soon as you see the red light under the prog key come on, hit enter on your second keyboard so the command we pasted into the command line window runs. We want to start the Flash command as quickly as possible due to a time limit we are up against. (You can let go of the prog key)
  7. Your firmware should upload successfully. If so, take a moment and do a Snoopy Dance. If not try again. If you still have problems, post the error message you get and we will try to help.
  8. For me, once I have done this, I am able to then do the uploads via the Arduino IDE until I restart it again. My guess is that the bootloader COM port is getting set in a config or settings file somewhere. I hope to hunt down what/where that is and perhaps we could just edit it rather than going through all the above.

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

  1. In the plain text editor, place your cursor at the end of the command. (so after the ...ino.hex:i) and hit enter so we get a new line character.
  2. Use the menu Edit > Select All to ensure we get everything including the new-line/return character we just entered,
  3. Select Edit > Copy to copy the command and the new-line/return into your clipboard.
  4. Open the command window. Do this by searching for cmd in the start menu or type Win+R and enter cmd in the “Run” dialog and click OK.
  5. Unplug your Model 01 from PC. Wait a good 10 seconds. You should hear the standard USB disconnect tone. If you want to be absolutely sure, make sure that the “Keyboardio Model 01” no longer shows under “Ports (CON & LPT)” in Device Manager
  6. Get ready for some advanced acrobatics… Make sure the command window has focus. You need to hold down the prog key on your keyboard and plug it into the PC. As soon as you see the red light under the prog key come on, right click with your mouse in the command line window, and select paste:
    05
    This will paste the command into the command window. And since we copied a new-line/return at the end, it should run. If it does not run, then you likely did not get the new-line/return character copied into your clipboard. Go to Step 1 of this Part 4 Option B section and try again. Note: you can let go of the prog key as soon as the light comes on. But not at the cost of slowing you down on pasting the command, We need to run the command as quickly as possible after the red light turns on.
  7. Your firmware should upload successfully. If so, take a moment and do a Snoopy Dance. If not try again. If you still have problems, post the error message you get and we will try to help.
  8. For me, once I have done this, I am able to then do the uploads via the Arduino IDE until I restart it again. My guess is that the com port is getting set in a config or settings file somewhere. I hope to hunt down what/where that is and perhaps we could just edit it rather than going through all the above.

Again, I/we know these instructions can be daunting for people that are not use to using the command line. For us programmers and “power users” it is second nature. I’ve tried to make the instructions as clear as possible for folks that are not use to using the command line. But I may have missed something or could make them clearer. If you do not understand something, just ask. And again, this is hopefully a temporary workaround. We (i.e. the community and Jesse at Keyboardio) hope to come up with something better and simpler. But this at least gives us a way to flash our Model 01’s in the meantime.

5 Likes