-
Notifications
You must be signed in to change notification settings - Fork 3
/
windows-streaming-server-usage.html
198 lines (153 loc) · 13.2 KB
/
windows-streaming-server-usage.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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Using E4 streaming server</title>
<meta name="description" content="E4 streaming server allows to receive realtime data from multiple Empatica E4 devices.">
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="highlight/styles/github.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/github-dark.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Favicon -->
<link rel="icon" href="//static-content1.empatica.com/YaJqf/img/favicon.png" type="image/png">
<link rel="apple-touch-icon" href="//static-content1.empatica.com/YaJqf/img/favicon.png">
<link href="//static-content1.empatica.com/YaJqf/img/favicon.png" rel="shortcut icon" type="image/x-icon">
<!-- Google Analytics -->
<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-25632719-2', 'auto');
ga('require', 'linkid', 'linkid.js');
ga('require', 'displayfeatures');
ga('send', 'pageview');
</script>
<script src="highlight/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body>
<div id="container">
<div class="inner">
<header>
<p><a href="/">E4 for Developers</a> > <a href="windows-streaming-server.html">E4 streaming server</a> > Using E4 streaming server</p>
<h1>Using E4 streaming server</h1>
<h2>Running on Windows</h2>
<h6>Updated December, 2018</h6>
</header>
<section id="main_content">
<h3>
Requirements
</h3>
<ul>
<li>Windows 7 or higher with Visual C++ Redistributable Package installed (download from <a href="https://aka.ms/vs/15/release/VC_redist.x86.exe">here</a>)</li>
<li>The E4 streaming server is currently working only with <a href="https://www.silabs.com/wireless/bluetooth/bluegiga-low-energy-legacy-modules/device.bled112">Bluegiga Bluetooth Smart Dongle</a>.<br/>A driver/installation guide can be downloaded <a href="https://www.silabs.com/documents/login/software/BLED112-Signed-Win-Drv.zip">here</a> (registration required)</li>
<li>Empatica E4 with firmware build 0.0.1.505+ installed (present if E4 bought after May 2015)</li>
</ul>
<p class="notes warning">
Empatica E4s must be registered to the <a href="https://support.empatica.com/hc/en-us/articles/206397545-Develop-your-own-app">API key</a> owner to be accessible via the E4 streaming server
</p>
<p class="notes">It is strongly advised to upgrade the Bluegiga Bluetooth Smart Dongle to version 1.6 (1.7 exhibits issues) in order to avoid connection issues. Additionally, the firmware can be modified to allow for a simultaneous connection of up to 7 E4s instead of only 3. For more information see <a href="#firmware-upgrade">BLE Dongle Firmware Upgrade</a>.</p>
<h3>
Installation
</h3>
<p>Download the latest release of the E4 streaming server for Windows from <a href="http://get.empatica.com/win/EmpaticaBLEServer.html">here</a></p>
<h3>
Configuration
</h3>
<p>The first time you start the E4 streaming server the settings need to be adjusted. These are reachable through the button in the upper right corner and contains the following configurations:</p>
<ul>
<li>Your Empatica API Key (you can find yours <a href="https://www.empatica.com/connect/developer.php">here</a>, if you don't have one check this <a href="https://support.empatica.com/hc/en-us/articles/206397545-Develop-your-own-app">support article</a></li>
<li>The IP address the server bind to and clients have to connect to, e.g. 127.0.0.1</li>
<li>The port the server is listening on</li>
<li>Manual BTLE: BTLE connections are established manually</li>
<li>Autoreconnect BTLE: automatic reconnection of lost BTLE connections</li>
</ul>
<p></p>
<p>Click the "Apply" button after the configurations are made.</p>
<h3>
Using the server
</h3>
<h4>Connecting an E4</h4>
<p></p>
<p>If the dongle is connected and ready to use, the E4 streaming server will automatically discover and connect to E4 devices within Bluetooth range.</p>
<p>If the dongle is not connected or there is a problem with communication (e.g. missing drivers), the discovery won't start and an indication is given to connect the BLE dongle.</p>
<p>Once the E4 streaming server is discovering, follow these steps to connect an E4:</p>
<ol>
<li>Make sure to keep the E4s not too close to each other and the dongle. The radios can saturate when the antennas are too close, resulting in communication problems.</li>
<li>Turn on your E4. The led starts to blink green.</li>
<li>After few seconds the E4 is visible in the list, showing the device ID and, once bound, the associated TCP connections.</li>
<li>If manual BTLE is disabled, the E4 is automatically connected. Otherwise a button is shown in the "Actions" row to allow for selective connection over BTLE.</li>
<li>While the connection is being established, the E4 led turns light blue. Finally, the led turns blue upon successful connection.</li>
<li>After around 40 seconds, the led will be turned off in order to save battery.</li>
<li>If you want to connect another E4 after the connection is established, then press the "Discover other E4 devices" button and start again from step 1.</li>
<li>When you want to stop streaming from a device, simply turn off your E4 and it will be disconnected.</li>
</ol>
<p></p>
<h4>Connecting a TCP Client and Start Receiving Data</h4>
<p></p>
<p>The following steps need to be taken in order to start receiving data:</p>
<ol>
<li>A TCP client establishes a connection to the E4 streaming server, using the configured connection parameters.</li>
<li>The TCP client binds to a device connected over BTLE through the <a href="windows-streaming-server-commands.html#connect-device">device_connect</a> command.</li>
<li>The bound TCP client subscribes to a channel with the <a href="windows-streaming-server-commands.html#subscribe-receive-data">device_subscribe</a> command.</li>
</ol>
<p>The TCP client will now start receiving the data in the format specified in <a href="windows-streaming-server-data.html">Data Streaming Packets</a>.</p>
<h4>Autoreconnect BTLE</h4>
<p></p>
<p>When the <strong>Autoreconnect BTLE</strong> option is checked, the E4 streaming server will attempt to reconnect to devices that lost BTLE connection. Reasons for connection loss may be obstructions or too long distances between the device and the BTLE dongle, but also devices being turned off through the button. TCP clients that were bound to the reconnected device will continue to receive data according to their subscriptions after reconnection.</p>
<p>Additionally with <strong>Autoreconnect BTLE</strong> set, devices with a firmware version higher than 1.2.4.x will not turn off after BTLE connection is lost but instead will remain discoverable.</p>
<h3>
Running the Server from Other Code or Scripts
</h3>
<p>The E4 streaming server can be run without GUI, passing the connection information and API key as startup arguments:</p>
<p><code>EmpaticaBLEServer.exe <API_KEY> <SERVER_ADRESS> <SERVER_PORT></code></p>
<div class="example">
Example:<br/>
<code>EmpaticaBLEServer.exe 11111111111111111111111111111111 127.0.0.1 8000</code>
</div>
<p></p>
<p>When running the E4 streaming server without GUI, the settings won't be saved and are only active during this execution. Also, BTLE connections have to be handled manually through the commands and automatic reconnection is disabled.</p>
<h3 id="firmware-upgrade">BLE Dongle Firmware Upgrade</h3>
<p class="notes warning">
The following steps only serve as an outline to upgrade the BLE dongle firmware.<br/>Please refer to <a href="https://www.silabs.com/community/wireless/bluetooth/knowledge-base.entry.html/2015/08/06/_how-to_update_the-saZT" target="_blank">this guide</a> to learn about the risks associated with a firmware upgrade and more details of the process.
</p>
<ol>
<li>Download and install <code>Bluetooth Smart Software and SDK</code> version 1.6 (download from <a href="https://www.silabs.com/wireless/bluetooth/bluegiga-low-energy-legacy-modules/device.bled112" target="_blank">here</a>, registration required).</li>
<li>OPTIONAL: create a modified firmware to allow for simultaneous connection of up to 7 E4s
<ol class="sub">
<li>in the installation folder copy the contents of the usbcd example project (<code>example/dkble112/usbcdc</code>) to <code>bin/</code></li>
<li>in the file config.xml change connections value field to 7</li>
<li>open a cmd prompt in <code>bin/</code> and run <code>blegui2.exe</code>with the <code>.bgproj</code> file as argument to build a new firmware <code>.hex</code> file</li>
</ol>
</li>
<li>running <code>blegui2.exe</code>, flash the modified firmware or the firmware from the usbcd example project (<code>example/dkble112/usbcdc</code>)</li>
</ol>
<h3>
Troubleshooting
</h3>
<strong>When I click "Save" in settings panel, I see the "Invalid Api key" message</strong>
<p>Please try to insert again your API Key (you can find your API key <a href="https://www.empatica.com/connect/developer.php">here</a>).<br/>If you have still the issue, please contact our <a href="mailto:[email protected]">support</a> </p>
<strong>When I click "Start", I can't get my E4 connected</strong>
<p>Try to follow these steps in order to get your E4 connected:</p>
<ul>
<li>Launch the E4 streaming server</li>
<li>Check that the dongle is connected (you should see a "Dongle connected" text) at the bottom of the app's window</li>
<li>Click the "Start" button</li>
<li>Turn on your E4</li>
</ul>
<p></p>
<p>If the E4 streaming server can't connect to your E4 before memory mode starts and the led turns red, please contact our <a href="mailto:[email protected]">support</a> writing us your Api key and the serial number of the device you're using. You can find the serial number on the E4 close to sensor's led.</p>
<footer>
<p>Having trouble with Empatica E4 software for Developers? <a href="mailto:[email protected]">Contact Support</a> and we’ll help you sort it out.</p>
</footer>
</section>
</div>
</div>
</body>
</html>