Spark is a wireless microcontroller platform started as a Kickstarter project. It uses an ARM Cortex M3 microcontroller with more memory and faster clock speed than an Arduino. The Spark Core connects to WiFi and allows wireless programming through the Spark online IDE or command line interface. It can read sensor data and trigger functions remotely through its published variables and functions over HTTP/HTTPS.
1. 1
Getting to know Spark :)
08 September 2014
pre-#startathon workshop
!
@kennethlimcp
2. Who is Spark?
• Started off as Spark Socket, an unsuccessful Kickstarter
project
• 2nd Kickstarter success last June 2013
• Successful company incubated by HAXLR8R, Shenzhen,
China
• Currently a Series A company with US4.9 million funding
2
9. Troubleshoot by colour
Breathing Blue: Wifi On
Blinking Green: Connecting to Wifi
Breathing Cyan: Connected to Spark cloud
Blinking Blue : Listening Mode
Blinking Yellow: DFU Mode
Blinking White: Factory reset
Blinking Red: SOS panic code
Blinking Yellow/Red: Bad keys
10. Factory Reset
• Press BOTH the RST and
MODE button
• hold onto the MODE button for
10 seconds
!
!
** This always works…
11. Listening Mode
• To configure Wifi Credentials
• Either via Mobile App or USB
!
Solid blue: Credentials captured
Flashing green: Connecting to Wi-Fi network
Flashing cyan: Connecting to Spark Cloud
Breathing cyan: Connected to Spark Cloud
!
!
**Try to do one core at a time in a
congested venue
11
15. Spark.variable()
• Allows you to read parameters from the core
itself
• eg. Temperature, battery voltage, motor
status etc.
• Add in the following:
double temperature = 36.95;
Spark.variable("temp", &temperature,
DOUBLE);
• Open Chrome and call the following URL:
https://api.spark.io/v1/devices/core_id/
temp?access_token=your_token
17. Spark.function()
• Calls a corresponding code function
registered to the Spark.function name
• Allows you to execute a command
remotely via API call
Add in the following:
Spark.function("ledlight",ledlight);
• Open Chrome and call the following
URL:
http://jflasher.github.io/spark-helper/
20. Why Spark-Cli?
• Wraps all the long commands into simple syntax
• Saves time and allows code development locally
• Flashes code faster via USB
• It’s fun to learn! :)
21. Spark-CLI
• Let’s do the same activity using
Spark-Cli!
spark setup
spark list
spark get core_id temperature
spark call core_id ledlight on/off
23. System Mode
• This is important to know! Especially in a #startathon
context
• 3 Modes available:
AUTOMATIC, SEMI_AUTOMATIC, MANUAL
• Most user will require “SEMI_AUTOMATIC” for user code to run even
without a Wifi connection
Syntax: SYSTEM_MODE(MODE_SELECTION);
25. DFU Utility
• Built into Spark-Cli tool as well
• Allows us to download firmware binary file via USB
• Access to the entire memory space in the internal and
external flash