Connecting the Spark Core Using a Mac (OS X)

by Hal-9K in Circuits > Microcontrollers

4802 Views, 13 Favorites, 0 Comments

Connecting the Spark Core Using a Mac (OS X)

IMG_0099.jpg

There are quite a bit of resources out there on how to connect your Spark to the Internet or how to connect to your network however they all seemed missing some steps, some of the things you will most certainly run into. I hope to capture these while showing how I connected my SparkCore.


The first step is to part the device into listening mode. There are a couple ways this can be done.

Listen Mode

IMG_0103.jpg

The default first step is to put the device into "Listen Mode".

The sign that this has been completed is an illuminated blue LED in the center of your Spark Core.

At this point it is time to connect your device to WiFi.

WiFi Connection (Easy Way)

IMG_0124.png

Connecting using this method appears to be the Spark recommended fashion although there are missing details in some of what I've read.

  1. From either Apple or Google app stores download the Spark application.
  2. Open the application and you will be prompted with two dialog boxes.

You will need the SID (Wireless name) and password of the network you want to connect the Spark too.

After you have filled out both items hit the "Connect" button and watch for the colored LED on the core to change, if after a minute or two the LED has not changed or the application times-out double check:

  • The WiFi password you entered is correct
  • Your device is on the same WiFi that you are going to use for the Spark.
  • Your Wifi uses an access frequency channel that is lower then 11.

Note: If you run into issues here or can't get connected it is recommended to do a hard Factory Reset.

If you are not able to connect at this point, continue to the "Medium Method". If you are able to connect continue to "Logging In"

WiFi Connection (The Medium Way)

Screen Shot 2014-11-10 at 9.35.48 PM.png
Screen_Shot_2014-11-10_at_9_37_21_PM.png
Screen_Shot_2014-11-10_at_7_53_17_PM.png

If the first connection method does not work, which it did not for me then I suggest you try the command line method using the Spark software.

If this approach does not work the final way is the serial method.

  1. Prior to installing the software to communicate with the Spark you must have Node.js installed. (I found the version for the MAC installed via Home Brew did not seem to work cleanly).

Once you have confirmed that Node is installed, run the command:

sudo npm install -g spark-cli

While you will see the error as noted the command should still complete successfully. If you see anything other then warnings (as seen in the attached screen captures), retry your command.

A safe way to remove Node, say if it's from Home Brew etc. if needed (from your MAC)

lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done

sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*

WiFi Connection - Medium Way Step 2

Screen Shot 2014-11-10 at 9.44.19 PM.png

Once the command line installer (via Node) has completed, you should see something ver close to the screenshot above.

If you are not able to connect at this point, continue to the "Hard Method". If you are able to connect continue to "Logging In"

Wifi Connection (The Hard Way)

Screen Shot 2014-11-10 at 7.18.11 PM.png

If at this point you have still not been able to connect your device to WiFi there is one last possible step before contacting support.

You will need a serial emulator and a comfort level with devices to accomplish this step.

  1. Download / Install a Serial USB emulator, I recommend Cool Edit (there should be no special drivers).
  2. Open a standard terminal Window once installed open a Terminal window and issue the command:

ls /dev/cu.*

This should yield items in your directory that begin with "cu" in the name. The Spark will be named something similar to cuXXX.umodem. (Ex: /dev/cu.usbmodem1411)

Connect to this device in the next step.


WiFi Connection (The Hard Way - Step 2)

Screen Shot 2014-11-10 at 7.18.00 PM.png

In your terminal application select the device you want to connect and confirm you are setup to 9600 N-8-1 (eight (8) data bits, no (N) parity bit, and one (1) stop bit).

WiFi Connection - (The Hard Way Step 3)

Screen_Shot_2014-11-10_at_7_22_02_PM.png
IMG_0116.jpg
IMG_0119.jpg

Once you are connected to the device, select W first to configure the wireless settings and fill in the information as prompted.

  1. Enter your SSID (must be on a lower channel then 11).
  2. Enter your security type (WEP, WPA, WPA2)
  3. Followed by your password

The Spark application will attempt a connection turning the LED light to green while saving and validating the WiFi connection and then to a cyan with a slow flash to show it is connected.

Login to Your Spark

Screen_Shot_2014-11-10_at_10_09_05_PM.png

At this point you should be able to type spark at the command line and have the command options returned to you.

If this works you can login by entering spark cloud login which should allow you to login and control your device.

And if the 3 other ways to set up your wireless did not work your final shot is here by typing spark setup which should prompt you for the same items as you did with the serial connection.

Finally - SHOUTING RAINBOWS

Screen Shot 2014-11-10 at 10.29.35 PM.png

At this point you should be setup, logged in an "shouting rainbows" (multi color LED) from your core.

Reset Mode

To factory reset your Spark is a trivial task but must be done in the correct order.

  1. Press and hold both buttons (mode on the left / reset on the right) down at the same time.
  2. A small blue LED will light on the far tip above and to the right of the buttons your holding, the LED in the center will begin to flash yellow, continue holding down the left button (mode).
  3. The center LED will turn solid white, continue holding down the left button (mode).
  4. Next the center LED will begin a flash flash of white, which at this time you can let go of the mode button.