Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Getting started with the spark core
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
claudiomettler
January 14, 2015
Technology
310
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Getting started with the spark core
For Hackware v0.3
claudiomettler
January 14, 2015
More Decks by claudiomettler
See All by claudiomettler
On-demand image scaling with AWS Lambda and S3
claudiomettler
0
170
Terraform in 5 minutes
claudiomettler
0
750
Intro to Xdebug
claudiomettler
0
250
chef talk at DevOps Singapore
claudiomettler
0
160
Other Decks in Technology
See All in Technology
AI駆動開発を通して感じた、 AI時代のデザイナーの役割変化
whisaiyo
3
2.1k
2026TECHFRESH畢業分享會 - AI 時代的人生存檔點
line_developers_tw
PRO
0
970
【NRUG vol.18】KubernetesにおけるNew Relicデータ取得量削減の考え方
nrug_member
0
110
脆弱性対応、どこで線を引くか
rymiyamoto
1
380
ルールやカスタム機能、どう活かす?ハンズオンで体感するIBM Bobの出力コントロール
muehara
1
150
AIネイティブな開発のサプライチェーンリスク対策 〜激動の開発現場でリスクに立ち向かう〜【ZennFes】
cscengineer
PRO
2
120
200個のGitHubリポジトリを横断調査したかった
icck
0
120
フロンティアAIのゲート化と地政学リスク
nagatsu
0
130
SONiCのLinuxベースを活かしたZabbix監視
sonic
0
140
小さく始める AI 活用推進 ― 日経電子版 Web チームの事例/nikkei-tech-talk47
nikkei_engineer_recruiting
0
260
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
6
1.5k
RAG を使わないという選択肢
tatsutaka
1
220
Featured
See All Featured
Building Applications with DynamoDB
mza
96
7.1k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
1.7k
Being A Developer After 40
akosma
91
590k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
150
WENDY [Excerpt]
tessaabrams
11
38k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
770
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
22k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
200
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
730
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
Exploring anti-patterns in Rails
aemeredith
3
410
Transcript
getting started with the spark core 1
2
hardware • 72MHz ARM Cortex M3 • TI CC3000 WiFi
• 7 analog IO (pwm out), 7 digital IO • ~ S$ 55 • coming soon: Photon, 120MHz, Broadcom Wifi, half the price 3
setup, the easy and unreliable way • install smartphone app
• power up spark • use smartphone app to create cloud account and register the core 4
setup, the better way (USB) npm install spark-cli spark setup
5
ready? • your spark core should have a name and
be breathing cyan by now 6
the tinker firmware • default firmware of spark core •
allows access to all inputs/outputs 7
let’s ask the cloud export SPARK_CORE_ID=53ff71065075535128311587 export SPARK_ACCESS_TOKEN=[get this from
https://spark.io/ build or “spark login”] 8
let’s ask the cloud curl -H "Authorization: Bearer $SPARK_ACCESS_TOKEN” https://
api.spark.io/v1/devices/$SPARK_CORE_ID/ Alternatively include the token in the URL: https://api.spark.io/v1/devices/$SPARK_CORE_ID/?access_token= $SPARK_ACCESS_TOKEN 9
output { "id": "53ff71065075535128311587", "name": "schnitzel", "connected": true, "variables": {},
"functions": [ "digitalread", "digitalwrite", "analogread", "analogwrite" ], "cc3000_patch_version": "1.29" 10
using functions curl https://api.spark.io/v1/devices/$SPARK_CORE_ID/ digitalwrite?access_token=$SPARK_ACCESS_TOKEN -d params=D7,LOW or include access_token
in POST data: curl https://api.spark.io/v1/devices/$SPARK_CORE_ID/ digitalwrite -d access_token=$SPARK_ACCESS_TOKEN -d params=D7,LOW 11
response { "id": "53ff71065075535128311587", "name": "schnitzel", "last_app": null, "connected": true,
"return_value": 1 } 12
the cloud API • events, functions, variables • http://docs.spark.io/api/ 13
the javascript API • runs in browser and in nodejs
• (npm|bower) install spark • http://docs.spark.io/javascript/ 14
voodoospark • alternative firmware • faster communication through local TCP
connection • npm client module • still uses cloud for facilitating local connection 15
DIY, noob mode 16
DIY, noob mode #2 17
DIY spark compile myapp.ino spark flash firmware_1421160254713.bin 18
DIY, hardcore mode brew tap PX4/homebrew-px4 brew update brew install
gcc-arm-none-eabi-48 brew install dfu-util git clone https://github.com/spark/core-firmware.git git clone https://github.com/spark/core-common-lib.git git clone https://github.com/spark/core-communication-lib.git 19
DIY, hardcore mode 20
DIY, hardcore mode cd core-firmware/build make 21
flash via USB • press&hold mode button, tap and release
RST button until LED flashes yellow • spark core is now in DFU mode 22
flash via USB make program-dfu 23
flash via cloud make program-cloud 24
create your own app mkdir core-firmware/applications/myapp vim core-firmware/applications/myapp/application.cpp cd core-firmware/build
make APP=myapp make APP=myapp program-dfu # or program-cloud 25
app structure #include "application.h" int example(String command); void setup(){ //
set up cloud functions & variables, IO pin modes Spark.function("example", example); pinMode(D7, OUTPUT); } void loop(){ // called continuously } int example(String command){ digitalWrite(D7, HIGH); delay(2000); digitalWrite(D7, LOW); return 1; } 26
app structure { "id": "53ff71065075535128311587", "name": "schnitzel", "connected": true, "variables":
{}, "functions": [ "example" ], "cc3000_patch_version": "1.29" 27
documentation • http://docs.spark.io/firmware/ 28
my current project 29
my current project • websockets • static site hosted on
S3 • direct connection from browser to spark • https://github.com/ponyfleisch/cloudlamp 30