forked from evanxd/sensorweb-frontend
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgetting-started.html
261 lines (251 loc) · 12 KB
/
getting-started.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
<title>Getting Started Guide - Project SensorWeb</title>
<link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="css/tomorrow.css" type="text/css" rel="stylesheet" media="screen,projection"/>
</head>
<body>
<ul id="dropdown" class="dropdown-content">
<li><a href="about.html">English Version</a></li>
<li class="divider"></li>
<li><a href="tw/about.html">中文版</a></li>
</ul>
<div class="navbar-fixed">
<nav class="teal" role="navigation">
<div class="nav-wrapper container">
<a id="logo-container" href="/" class="brand-logo">SensorWeb</a>
<ul class="right hide-on-med-and-down">
<li><a href="projects.html">Projects</a></li>
<li class="active"><a href="getting-started.html">Documentation</a></li>
<li><a href="http://blog.sensorweb.io">Blog</a></li>
<li><a href="about.html">About</a></li>
<!-- Dropdown Trigger -->
<!-- <li><a class="dropdown-button" href="#!" data-activates="dropdown">EN<i id="arrow" class="material-icons right">arrow_drop_down</i></a></li> -->
<!-- <li class="login"><a href="user-detail.html">Log In</a></li> -->
<!-- <li>
<div id="tabzilla">
<a href="https://www.mozilla.org/en-US/" data-link-type="nav" data-link-name="tabzilla">Mozilla</a>
</div>
</li> -->
</ul>
<!-- Mobile Navigation -->
<ul id="nav-mobile" class="side-nav">
<li><a href="projects.html">Projects</a></li>
<li><a href="getting-started.html">Documentation</a></li>
<li><a href="http://blog.sensorweb.io">Blog</a></li>
<li><a href="about.html">About</a></li>
<!-- <li><a href="user-detail.html">Log In</a></li> -->
</ul>
<a href="#" data-activates="nav-mobile" class="button-collapse"><i class="material-icons">menu</i></a>
</div>
</nav>
</div>
<div id="page-container">
<div class="container docs">
<div class="section">
<div class="row">
<div class="col s12 m3 toc">
<div class="collection">
<a href="#getting-started" class="collection-item active"><b>Getting Started</b></a>
<a href="#step-1" class="collection-item">1. Create Account</a>
<a href="#step-2" class="collection-item">2. Create API Key</a>
<a href="#step-3" class="collection-item">3. Setup Sensor Station</a>
<a href="#step-4" class="collection-item">4. See Live Data</a>
<a href="#api-reference" class="collection-item"><b>API Reference</b></a>
<a href="#post-sensor-data" class="collection-item">POST /sensors/{sensor_id}/data</a>
</div>
</div>
<div class="col s12 m9 col-right" id="documentation">
<h3 id="getting-started">Getting Started Guide</h3>
<p class="contents">SensorWeb aims to pave the way for volunteers who is willing to solve
real problems by exposing sensor data to the public. We don't just accept
any random data, we encourage and help people work on shared vision
together to achieve specific goals.</p>
<p class="contents">For instance, our first initiative is to build a crowdsourcing PM2.5
sensor network. With more data published, people would have better
visibility of the air quality in their surroundings. So they can take
actions accordingly.</p>
<p class="contents">Not everyone need to be a contributor. But if your do, tons of people
would benifit from it.</p>
<p class="contents">Excited? Below are 4 steps to get you started.</p>
<h5 id="step-1">Step 1: Create Your SensorWeb Account</h5>
<p class="contents">Fill in the <a href="/#signup">sign up form</a> or just <a href=
"/#login">login</a> with exsiting account. After logged in, a popup will
tell you that you just joined PM2.5 initiative, since it's our only first
initiative for now. Click <strong>OK</strong> will bring you to your
dashboard.</p>
<h5 id="step-2">Step 2: Create a Sensor ID and API Key</h5>
<p class="contents">Click <strong>Add Device</strong>, fill in necessary information about
your sensor and submit. You will see your <code>sensor_id</code> and
<code>api_key</code> in the sensor detail page.</p>
<h5 id="step-3">Step 3: Setup Your Sensor Station</h5>
<p class="contents">Currently we provide some basic software to enable various ways to setup
your sensor station. It might have frictions for non-developers for now. We
will improve the setup process step by step, please <a href=
"http://blog.sensorweb.io/">stay tuned</a> for upcoming releases.</p>
<p class="contents">A sensor station that integrates with our services should have:</p>
<ul>
<li>Sensors connected to it via IO headers/sockets to provide
readings.</li>
<li>Basic ability to process and (temporarily) store the data.</li>
<li>Wired/Wireless internet connection to post to our REST API.</li>
</ul>
<p class="contents">We listed 3 alternative ways below, you might already have some of the
hardware parts, choose the one you comfortable with the most.</p>
<h6>PC-based Sensor Station Setup</h6>
<p class="contents">PC has sufficient computing power, storage, and internet connection, but
to read data from sensors, we need USB adapters to connect to various kind
of sockets/headers. Arduino could do the job in most cases, and for UART
based sensors like some PM2.5 sensor, a simple and cheap (around $5) USB 2
TTL adapter would make it easy.</p>
<ul>
<li>Skills Required: PC software installation, command line interface,
simple wiring.</li>
<li>Hardware Requirement: PC or laptop, USB adapter, Sensors</li>
<li>Instructions: <a href="https://github.com/sensor-web/js-station">
See instructions on github</a>
</li>
</ul>
<h6>Arduino-based Sensor Station Setup</h6>
<p class="contents">With internet-enabled Arduino-like boards, it's perfect for a sensor
station setup since it supports various kind of sensors.</p>
<ul>
<li>Skills Required: PC software installation, command line interface,
wiring Arduino</li>
<li>Hardware Requirement: Arduino compatible board with the capability
or module to connect to the internet, Sensors</li>
<li>Instructions: <a href=
"https://github.com/sensor-web/arduino-station">See instructions on
github</a>
</li>
</ul>
<h6>Raspberry Pi Sensor Station Setup</h6>
<p class="contents">Raspberry Pi is a single board computer with IO pins, therefore it has
the capability we need for a sensor station.</p>
<ul>
<li>Skills Required: command line interface, wiring Raspberry Pi</li>
<li>Hardware Requirement: Raspberry Pi, SD Card, ethernet cable or wifi
dongle, Sensors</li>
<li>Instructions: <a href="https://github.com/sensor-web/pi-station">
See instructions on github</a>
</li>
</ul>
<h6>Using Other Hardware You Prefer</h6>
<p class="contents">If you have other preferred hardware boards, you can build your own and
have it send data to our service by calling our <a href=
"/api-reference.html">REST API</a>.</p>
<h5 id="step-4">Step 4: See Your Live Data</h5>
<p class="contents">After setting up your sensor station properly, it should begin to send
data to SensorWeb. Go back to the sensor detail page you just created in
<a href="#step-2">step 2</a>, you'll see your data being visualized and
updated in realtime.</p><br>
<br>
<hr>
<br>
<h3 id="api-reference">REST API Reference</h3>
<p class="contents">Currently we only expose API for sensor devices to push data to SensorWeb. Stay tuned for query APIs.</p>
<h5 id="post-sensor-data">POST /sensors/<code>sensor_id</code>/data</h5>
<p class="contents">After you <a href="/#login">logged in</a> and created a sensor device,
you can start to send data to SensorWeb with your <code>api_key</code> and
<code>sensor_id</code>.</p>
<h6>Request</h6>
<p class="contents"><strong>POST</strong>
<code>http://api.sensorweb.io/sensors/{sensor_id}/data/</code></p>
<pre><code>?api_key={api_key}&pm2_5={pm2.5_value}
</code></pre>
<h5>Parameters</h5>
<ul>
<li>
<code>sensor_id</code>: Your sensor id, you can find it in <a href=
"/user-detail.html">your dashboard</a>
</li>
<li>
<code>api_key</code>: Your API key to access SensorWeb, you can
find it in <a href="/user-detail.html">your dashboard</a>
</li>
<li><code>pm2_5</code>: PM sensor reading in µg/m³</li>
</ul>
<h5>Headers</h5>
<pre><code>Content-Type: application/x-www-form-urlencoded
Accept: application/json
</code></pre>
<h6>Response</h6>
<pre><code>{
"name": "My First PM2.5 Sensor",
"description": "It's in my work place'",
"address": "No. 106, Section 5, Xinyi Rd, Taipei City, Taiwan 110",
"coordinates": "120.982025, 23.973875",
"latest_update": {
"datetime": "2013-08-25T17:10:00+00:00",
"pm2_5": 11
}
}
</code></pre>
<hr>
</div>
</div>
</div>
</div>
</div>
<!-- Footer -->
<footer class="page-footer teal">
<div class="container">
<div class="row">
<div class="col l3 s12">
<a href="http://mozilla.org" target="_blank"><img class="logo-mozilla" src="images/footer-mozilla-white.png"/></a>
</div>
<div class="col l3 s12">
<h5 class="white-text head">SensorWeb</h5>
<ul>
<li><a class="white-text" href="https://github.com/sensor-web" target="_blank">GitHub</a></li>
<li><a class="white-text" href="privacy.html">Privacy Notice</a></li>
</ul>
</div>
<div class="col l3 s12">
<h5 class="white-text head">Connect</h5>
<ul>
<li><a class="white-text" href="https://wiki.mozilla.org/SensorWeb" target="_blank">Wiki</a></li>
<li><a class="white-text" href="https://wiki.mozilla.org/Connected_Devices/Participation" target="_blank">Participation</a></li>
</ul>
</div>
<div class="col l3 s12">
<h5 class="white-text head">Contact Us</h5>
<ul>
<li><a class="white-text" href="mailto:[email protected]" target="_blank">[email protected]</a>
</li>
</ul>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">
Made by <a class="brown-text text-lighten-3" href="http://materializecss.com">Materialize</a>
</div>
</div>
</footer>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="js/materialize.min.js"></script>
<script src="js/jquery.scrollTo.min.js"></script>
<script src="js/jquery.localScroll.min.js"></script>
<script src="js/jquery.waypoints.min.js"></script>
<script src="js/init.js"></script>
<script src="js/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="js/documentation.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-75308712-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>