Installing the USB Driver on Windows & Serial Debugging

NOTE: These steps are outdated and no driver is required for the latest Windows 10 !!!

This installer will clean up old drivers and install a combined driver though if you’d like to try it:
https://github.com/particle-iot/windows-device-drivers/releases/tag/v6.1.0.68


Here are the steps I took to install my Spark Core or Photon USB Driver on Windows 7 / 8.1 pro when I could not find a device in Device Manager.

  • Download the driver: https://s3.amazonaws.com/spark-website/Spark.zip (unzip this on your computer somewhere)
  • Download Tera Term VT for windows http://logmett.com/index.php?/download/tera-term-486-freeware.html
  • Plug in your Core or Photon via USB cable.
  • Put your Core or Photon in Listening Mode (aka Smart Config) by holding the Mode button until the RGB LED starts blinking Blue (about 3 seconds). The Mode button (Core) or Setup button(Photon) is the one on the side with the analog pins.
  • Open the Device Manager (press Windows Key + Pause Key then click Device Manager)
  • Go to the Action menu and select Scan For Hardware Changes.

You should see this pop up…

Just let it fail…

You should now see the Spark Core with WiFi device listed.

Right click on it and select Update Driver Software.

Select “Browse my computer for driver software”

Select “Let me pick”

Click “Have Disk”

Click “Browse”

Browse to wherever you downloaded the spark_driver.inf file, and click Open.

  • After it finds the driver, it’s not digitally signed yet so select “Install this driver software anyway”

Note: If you encounter an error at this point because you have Windows 8/8.1

You’ll need to disable your digitally signed driver enforcement policy temporarily. See this guide for the long list of wacky steps to do this: http://www.howtogeek.com/167723/how-to-disable-driver-signature-verification-on-64-bit-windows-8.1-so-that-you-can-install-unsigned-drivers/

Once you do that, start over from the Update Driver Software step. We are working on getting these drivers signed so you won’t have to do this anymore :thumbsup:

Bingo, bango!

Device Manager now shows:

Now you can follow this guide here to Connect your Core to your network over USB:

http://docs.spark.io/#/connect/connecting-your-core-connect-over-usb

DRIVER INSTALLED!!! NOW LET’S USE IT!

  • You can try Arduino IDE’s serial monitor, Putty or I found Tera Term VT to be a GREAT alternative to both of these on windows.

What I have to do is a bit hacky, but it works.

  1. Close Serial Terminal Software (I’m using Tera Term VT 4.80)
  2. Flash Core with code that enables Serial in setup(), but waits for a character before it continues.
  3. Wait till Core reboots and connects to the Cloud (Breathing Cyan)
  4. Open Serial Terminal Software.
  5. Open a Serial Connection at the correct baud, 8 bits, no parity, 1 stop, no flow control.
  6. Press Enter.
  7. Bingo bango, kiss the screen! You have serial debugging over USB. Have a :beer: or :beers:


uint32_t counter = 0;
void setup()
{
  pinMode(D7,OUTPUT);         // Turn on the D7 led so we know it's time
  digitalWrite(D7,HIGH);      // to open the Serial Terminal.
  Serial.begin(9600);         // Open serial over USB.
  while(!Serial.available())  // Wait here until the user presses ENTER 
    Spark.process();          // in the Serial Terminal. Call the BG Tasks
                              // while we are hanging around doing nothing.

  digitalWrite(D7,LOW); // Turn off the D7 led ... your serial is serializing!
}
    
void loop() 
{
  Serial.print("Spark Core or Photon says Hello over USB! ");
  Serial.println(counter++);
  digitalWrite(D7,HIGH);
  delay(500);
  digitalWrite(D7,LOW);
  delay(500);
}

I initially had a timer and state machine in the main loop, but this is way more efficient and has no effect on the user code once you are out of setup(). This is nice because it calls the background tasks while we are sitting there waiting for the terminal program to open, so you could effectively still reprogram your Spark Core while it’s in this waiting loop.

If you do use Putty, make sure you are using Serial under the Session tab

Not the Connections tab… or it will DING at you. :slight_smile: I learned that the hard way… thanks to @Dave

12 Likes

Thanks for this awesome walkthrough BDUb, this helped me out a lot. A quick note for those using Windows 8, you will need to follow these steps to install the driver.

Also, I found that you need to close Putty (or other serial terminal) and then reset your Core before trying to flash new code onto it or else you will run into multiple different issues. If your serial terminal is complaining about the port being in use or that it cannot connect, try closing it, resetting your Core, then starting the terminal again once the RGB LED starts breathing cyan (connected).

1 Like

great write up, I’ve set up the USB serial but due to the reset each time the core resets i get the same problem. I don’t really have a work around for that, its best to close the serial monitor while the core reflashes and open it up again once it goes cyan. I’ve found it easier to use the Serial1 and a separate USB to serial adapter. Which for those who don’t know are super cheap, this is the one i use. Overall it works better when you are constantly reflashing the core over WiFi.

Actually the Arduino IDE does perform an Arduino AutoReset each time the a sketch is about to be uploaded or Serial Monitor gets started.
This is achieved by pulling DTR to LOW, which fortunately happens implicitly when an USB-Serial connection gets initiated (at least for Linux, MacOS and in my case on a Win8 tablet, too).
I don’t know if the Core would react to this the same way, but it might be a feature for future Core designs if not already implemented.

I’ve installed the driver as i’m meant to, but whenever i go to putty and try to open the port (while it’s flashing blue) i just get a beep from my pc suggesting its not going to let it happen but nothing pops up to say why.

I had the same issue and kind of just gave up on it for the moment… but I’m really wishing I had Serial debugging over USB right about now.

Just got it working with Arduino. It appeared to be easy and i dont have a clue what im doing, just here to tinker! I’d give up on Putty and download arduino and do as above.

I don't have a problem flashing new firmware with a Putty console connected. However, if you leave the console open, you'll have a hard time getting reconnected! If I close the Putty console BEFORE the core completely reboots, I'm fine. If, however, the Spark serial com port is initialized while the old console is still open, (I suspect this is what you're talking about), then you are indeed a bit stuck.

One workaround is to open the device manager (I'm in Win7), right click the Spark Serial COM port and select "Disable". You'll hear the USB "fail" tone (I think three low tones?). Then right click and select "Enable". You should hear the USB connection tone (low high). I am then able to reconnect with Putty without having to reset the Spark.

Dave O

1 Like

I’ll have to try that @dorth , but I couldn’t even get Putty to work with my FTDI friend (TTL Serial) device hooked to the TX pin and GND on the Core. It works perfectly in the Arduino IDE’s serial monitor, but Putty just makes a computer “beep” anytime I try to open a serial port. I think I spent about 30mins this morning messing with it, and searching the web. I couldn’t really find a good reason why it just “beeps” and doesn’t connect. The Arduino IDE is ok, but that’s kind of more memory hogging than I want for just a serial monitor.

In my opinion… Serial debugging over USB should be a fairly high priority to get working well for everyone… because once you go a little beyond dead simple programs, you need visibility of your code variables and execution state to figure out why something isn’t working. I’ve always loved real time debugging ability that about the Arduino provides, something even the fancy expensive Microchip dev tools can’t do. Even if you set up a UART on your PIC uC, the Real ICE and ICD3 and MPLAB IDE can’t handle monitoring the data, even though it’s already connected to the computer via USB.

2 Likes

Any workaround for people on Win 8/8.1? Since the driver isn’t digitally signed, can’t use it unless you disable the verification.

Just disable it, its not that hard to do, takes 10seconds really.

If you trust the author, The Spark Team… then proceeding with an unsigned driver is not a big deal. Just click Install This Driver Software Anyway. It’s only $300 - $400 dollars to get a driver signed so eventually I would think they would be signed but in this early stage it’s probably not wise to spend the money.

10 secs? Could you elaborate how?
The method I found required 2 reboots.

@BDub Yep - I know it’s a waste of money getting the drivers signed, just looking to see if there is a workaround - didn’t feel like 2 reboots in the middle of work.

Oh you’re on Win8… sorry I’m staying far away from 8 at the moment. Win 7 Ultimate all the way! Hopefully @Narom will chime in with his tricks.

Probably embellishing a bit, but i’ve got an SSD, booting to desktop takes me 6 seconds.

But in metro, type advanced startup options, click restart, then just press i think was number 7 to boot without driver enforcement,boots back in and then just install the .inf file.

1 Like

@DBub: I’m totally with you. I think there are (besides debugging) a lot of scenarios where you have a laptop connected for Serial.print-logging with beta firmware running, but you want to do remote flashing without running to the core to reset it after flashing, and/or even restart putty or Hyperterminal for logging.

All I am getting with the Spark plugged into USB in listening mode is “Unknown Device” on the USB controller instead of anything looking like a Spark device. The root problem of this being that Windows 7 64 will not look at the spark driver at all. Have tried numerous times with numerous ports and numerous resets on the Spark.

Since the Android app is still yielding a “No cores found.” even after the Spark successfully connects to internet (breathing cyan), I am very stuck! Any suggestions? Thanks in advance!

@Craigjones
I know this may not sound like the idea solution, but do you have access to any other computer with a different operating system to try on?

Some other things to try:

  1. If you connect and disconnect the Core from a windows computer numerous times, its advisable to restart the PC
  2. Always make sure that you have the RGB led flashing blue - indicating that its in the smart config mode and therefore will show up on the PC as a serial port.

As far as the Android app goes, were you able to claim your core?

Thanks for the info, but have worked through everything pretty systematically (computer reboots, different computer, ensured RGB is flashing blue, reset the Spark) and always get “unknown device” under USB devices on the hardware manager.

Wasn’t able to get the core claimed with android. Its sending the network info fine and connects up to a breathing cyan status, but Android (HTC One with Android 4.3) gives “No Cores Found” even while cyan breathing; hence, trying to connect via USB.

Any other thoughts? Please don’t tell me I have to go admit failure to a friend running iWhatever :wink: Thanks again.

Bumping this thread because I’m having an issue similar where one of my cores would not connect to the cloud so I performed a factory reset on it. Now I’m trying to get a serial connection open to it so I can reenter my SSID and password - but the core only shows up as Unknown Device in the device manager. This has not happened previously.

Reboots, different usb ports, all resulting in unknown device. The core is flashing blue.

Any ideas?