Device/event framework optimisation (#3049)
[ExpressLRS.git] / src / html / index.html
blob30d95189fb990329b6ea573caf501abe8a88f5b5
1 @@require(PLATFORM, VERSION, isTX, hasSubGHz, is8285)
2 <!DOCTYPE HTML>
3 <html lang="en">
5 <head>
6 <title>Welcome to your ExpressLRS System</title>
7 <meta charset="utf-8" />
8 <meta name="viewport" content="width=device-width, initial-scale=1" />
9 <link rel="stylesheet" href="elrs.css" />
10 </head>
12 <body>
13 <header class="mui-appbar mui--z1 mui--text-center elrs-header">
14 @@include("logo-template.svg")
15 <h1><b>ExpressLRS</b></h1>
16 <span id="product_name"></span><br/>
17 <b>Firmware Rev. </b>@@{VERSION} <span id="reg_domain"></span>
18 </header>
19 <br/>
20 <div class="mui-container-fluid">
21 <div class="mui-panel mui-col-sm-10 mui-col-sm-offset-1">
23 <ul class="mui-tabs__bar mui-tabs__bar--justified">
24 @@if not isTX:
25 <li><a data-mui-toggle="tab" data-mui-controls="pane-justified-3">Model</a></li>
26 @@end
27 <li><a data-mui-toggle="tab" data-mui-controls="pane-justified-1">Options</a></li>
28 <li><a id="network-tab" data-mui-toggle="tab" data-mui-controls="pane-justified-4">WiFi</a></li>
29 @@if isTX:
30 <li id="button-tab"><a data-mui-toggle="tab" data-mui-controls="pane-justified-3">Buttons</a></li>
31 @@end
32 <li><a data-mui-toggle="tab" data-mui-controls="pane-justified-2">Update</a></li>
33 </ul>
35 <div class="mui-tabs__pane" id="pane-justified-1">
36 <div class="mui-panel">
37 <h2>Runtime Options</h2>
38 This form <b>overrides</b> the options provided when the firmware was flashed. These changes will persist across reboots, but <b>will be reset</b> when the firmware is reflashed.
39 @@if isTX:
40 Note: The Binding phrase is <b>not</b> remembered, it is a temporary field used to generate the binding UID.
41 <br/><br/>
42 <div class="mui-textfield">
43 <input type="text" id="phrase" name="phrase" placeholder="Binding Phrase" />
44 <label for="phrase">Binding Phrase</label>
45 </div>
46 <form id='upload_options' method='POST' action="/options">
47 <div class="mui-textfield">
48 <label for='uid'><span id="uid-text"></span></label>
49 <span class="badge" id="uid-type"></span>
50 <input size='40' id='uid' name='uid' type='text' class='array' readonly/>
51 </div>
52 @@else:
53 <br/><br/>
54 <form id='upload_options' method='POST' action="/options">
55 @@end
56 @@if hasSubGHz:
57 <div class="mui-select">
58 <select id='domain' name='domain'>
59 <option value='0'>AU915</option>
60 <option value='1'>FCC915</option>
61 <option value='2'>EU868</option>
62 <option value='3'>IN866</option>
63 <option value='4'>AU433</option>
64 <option value='5'>EU433</option>
65 <option value='6'>US433</option>
66 <option value='7'>US433-Wide</option>
67 </select>
68 <label for="domain">Regulatory domain</label>
69 </div>
70 @@end
71 <div class="mui-textfield">
72 <input size='3' id='wifi-on-interval' name='wifi-on-interval' type='text' placeholder="Disabled"/>
73 <label for="wifi-on-interval">WiFi "auto on" interval in seconds (leave blank to disable)</label>
74 </div>
75 @@if isTX:
76 <div class="mui-textfield">
77 <input size='5' id='tlm-interval' name='tlm-interval' type='text'/>
78 <label for="tlm-interval">TLM report interval (ms)</label>
79 </div>
80 <div class="mui-textfield">
81 <input size='3' id='fan-runtime' name='fan-runtime' type='text'/>
82 <label for="fan-runtime">Fan runtime (s)</label>
83 </div>
84 <div class="mui-checkbox">
85 <input id='is-airport' name='is-airport' type='checkbox'/>
86 <label for="is-airport">Use as AirPort Serial device</label>
87 </div>
88 <div class="mui-textfield">
89 <input size='7' id='airport-uart-baud' name='airport-uart-baud' type='text'/>
90 <label for="airport-uart-baud">AirPort UART baud</label>
91 </div>
92 @@else:
93 <div id="baud-config" class="mui-textfield" style="display: block;">
94 <input size='7' id='rcvr-uart-baud' name='rcvr-uart-baud' type='text'/>
95 <label for="rcvr-uart-baud">UART baud</label>
96 </div>
97 <div class="mui-checkbox">
98 <input id='lock-on-first-connection' name='lock-on-first-connection' type='checkbox'/>
99 <label for="lock-on-first-connection">Lock on first connection</label>
100 </div>
101 <div class="mui-checkbox">
102 <input id='is-airport' name='is-airport' type='checkbox'/>
103 <label for="is-airport">Use as AirPort Serial device</label>
104 </div>
105 @@end
106 <button id='submit-options' class="mui-btn mui-btn--primary" disabled>Save</button>
107 <div id="reset-options" style="display: none;">
108 <a class="mui-btn mui-btn--small mui-btn--danger">Reset runtime options to defaults</a>
109 </div>
110 <input type="hidden" id="flash-discriminator" name="flash-discriminator"/>
111 <input type="hidden" id="wifi-ssid" name="wifi-ssid"/>
112 <input type="hidden" id='wifi-password' name='wifi-password'/>
113 </form>
114 </div>
115 @@if isTX:
116 <div class="mui-panel">
117 <h2>Import/Export</h2>
118 <br/>
119 <div>
120 <a href="/config?export" download="models.json" target="_blank" class="mui-btn mui-btn--small mui-btn--dark">Save model configuration file</a>
121 </div>
122 <div>
123 <button class="mui-btn mui-btn--small mui-btn--primary upload">
124 <label>
125 Upload model configuration file
126 <input type="file" id="fileselect" name="fileselect[]" />
127 </label>
128 </button>
129 </div>
130 </div>
131 @@end
132 </div>
134 <div class="mui-tabs__pane" id="pane-justified-2">
135 <div class="mui-panel">
136 <h2>Firmware Update</h2>
137 Select the correct <strong>firmware.bin@@{ ".gz" if (is8285 and not isTX) else "" }</strong> for @@{PLATFORM} otherwise a bad flash may occur.
138 If this happens you will need to recover via USB/Serial. You may also download the <a href="firmware.bin" title="Click to download firmware">currently running firmware</a>.
139 <br/><br/>
140 @@if (is8285 and not isTX):
141 <div class="mui-panel" style="background-color: #fcecae;text-align:center;">Do NOT decompress/unzip/extract the firmware.bin.gz file. Upload the file as it is.</div>
142 <br/>
143 @@end
144 <button id="upload_btn" class="mui-btn mui-btn--primary upload" style="margin: 0 auto; display:block;">
145 <label>
146 Select firmware file
147 <input type="file" id="firmware_file" name="update[]" />
148 </label>
149 </button>
150 <div id="filedrag">or drop firmware file here</div>
151 <br/>
152 <h3 id="status"></h3>
153 <progress id="progressBar" value="0" max="100" style="width:100%;"></progress>
154 </div>
155 </div>
157 @@if isTX:
158 <div class="mui-tabs__pane" id="pane-justified-3">
159 <div class="mui-panel">
160 <h2>Button Actions</h2>
161 Specify which actions to perform when clicking or long pressing module buttons.
162 <br/><br/>
163 <form class="mui-form" id='button_actions'>
164 <table class="mui-table">
165 <tbody id="button-actions"></tbody>
166 </table>
167 <div id="button1-color-div" style="display: none;">
168 <input id='button1-color' name='button1-color' type='color'/>
169 <label for="button1-color">User button 1 color</label>
170 </div>
171 <div id ="button2-color-div" style="display: none;">
172 <input id='button2-color' name='button2-color' type='color'/>
173 <label for="button2-color">User button 2 color</label>
174 </div>
175 <button id="submit-actions" class="mui-btn mui-btn--primary">Save</button>
176 </form>
177 </div>
178 </div>
179 @@end
180 @@if not isTX:
181 <div class="mui-tabs__pane" id="pane-justified-3">
182 <div class="mui-panel">
183 <div id="model_tab">
184 <h2>PWM Output</h2>
185 Set PWM output mode and failsafe positions.
186 <ul>
187 <li><b>Output:</b> Receiver output pin</li>
188 <li><b>Features:</b> If an output is capable of supporting another function, that is indicated here</li>
189 <li><b>Mode:</b> Output frequency, 10KHz 0-100% duty cycle, binary On/Off, DShot, Serial, or I2C (some options are pin dependant)</li>
190 <ul>
191 <li>When enabling serial pins, be sure to select the <b>Serial Protocol</b> below and <b>UART baud</b> on the <b>Options</b> tab</li>
192 </ul>
193 <li><b>Input:</b> Input channel from the handset</li>
194 <li><b>Invert:</b> Invert input channel position</li>
195 <li><b>750us:</b> Use half pulse width (494-1006us) with center 750us instead of 988-2012us</li>
196 <li><b>Failsafe</b>
197 <ul>
198 <li>"Set Position" sets the servo to an absolute "Failsafe Pos"
199 <ul>
200 <li>Does not use "Invert" flag</li>
201 <li>Value will be halved if "750us" flag is set</li>
202 <li>Will be converted to binary for "On/Off" mode (>1500us = HIGH)</li>
203 </ul>
204 </li>
205 <li>"No Pulses" stops sending pulses
206 <ul>
207 <li>Unpowers servos</li>
208 <li>May disarm ESCs</li>
209 </ul>
210 </li>
211 <li>"Last Position" continues sending last received channel position</li>
212 </ul>
213 </li>
214 </ul>
215 <form action="/pwm" id="pwm" method="POST">
216 </form>
217 </div>
218 <form class="mui-form" action='/config' id='config' method='POST'>
219 <h2>Binding Phrase</h2>
220 <div class="mui-select">
221 <select id="vbind" name="vbind">
222 <option value="0">Persistent (Default) - Bind information is stored across reboots</option>
223 <option value="1">Volatile - Never store bind information across reboots</option>
224 <option value="2">Returnable - Unbinding a receiver reverts to flashed binding phrase</option>
225 </select>
226 <label for="vbind">Binding storage</label>
227 </div>
228 <div id="bindphrase">
229 Enter a new binding phrase to replace the current binding information.
230 This will persist across reboots, but <b>will be reset</b> if the firmware is flashed with a binding phrase.
231 Note: The Binding phrase is not remembered, it is a temporary field used to generate the binding UID.
232 <br/><br/>
233 <div class="mui-textfield">
234 <input type="text" id="phrase" name="phrase" placeholder="Binding Phrase" />
235 <label for="phrase">Binding Phrase</label>
236 </div>
237 <div class="mui-textfield">
238 <label for="uid"><span id="uid-text"></span></label>
239 <span class="badge" id="uid-type"></span>
240 <input size="40" id="uid" name="uid" type="text" class="array" readonly/>
241 </div>
242 </div>
243 <div id="serial-config">
244 <h2>Serial Protocol</h2>
245 Set the protocol used to communicate with the flight controller or other external devices.
246 <br/><br/>
247 <div class="mui-select">
248 <select id='serial-protocol' name='serial-protocol'>
249 <option value='0'>CRSF</option>
250 <option value='1'>Inverted CRSF</option>
251 <option value='2'>SBUS</option>
252 <option value='3'>Inverted SBUS</option>
253 <option value='4'>SUMD</option>
254 <option value='5'>DJI RS Pro</option>
255 <option value='6'>HoTT Telemetry</option>
256 <option value='7'>MAVLINK</option>
257 <option value='8'>DisplayPort</option>
258 </select>
259 <label for='serial-protocol'>Serial Protocol</label>
260 </div>
261 </div>
262 <div id="serial1-config">
263 <div class="mui-select">
264 <select id='serial1-protocol' name='serial1-protocol'>
265 <option value='0'>Off</option>
266 <option value='1'>CRSF</option>
267 <option value='2'>Inverted CRSF</option>
268 <option value='3'>SBUS</option>
269 <option value='4'>Inverted SBUS</option>
270 <option value='5'>SUMD</option>
271 <option value='6'>DJI RS Pro</option>
272 <option value='7'>HoTT Telemetry</option>
273 <option value='8'>Tramp</option>
274 <option value='9'>SmartAudio</option>
275 <option value='10'>DisplayPort</option>
276 </select>
277 <label for='serial1-protocol'>Serial2 Protocol</label>
278 </div>
279 </div>
280 <div id="sbus-config" style="display: none;">
281 <h2>SBUS Failsafe</h2>
282 Set the failsafe behaviour when using the SBUS protocol:<br/>
283 <ul>
284 <li>"No Pulses" stops sending SBUS data when a connection to the transmitter is lost</li>
285 <li>"Last Position" continues to send the last received channel data along with the FAILSAFE bit set</li>
286 </ul>
287 <br/>
288 <div class="mui-select">
289 <select id='sbus-failsafe' name='serial-failsafe'>
290 <option value='0'>No Pulses</option>
291 <option value='1'>Last Position</option>
292 </select>
293 <label for="sbus-failsafe">SBUS Failsafe</label>
294 </div>
295 </div>
297 <h2>Model Match</h2>
298 Specify the 'Receiver' number in OpenTX/EdgeTX model setup page and turn on the 'Model Match'
299 in the ExpressLRS Lua script for that model. 'Model Match' is between 0 and 63 inclusive.
300 <br/><br/>
301 <div class="mui-checkbox">
302 <input id='model-match' name='model-match' type='checkbox'/>
303 <label for="model-match">Enable Model Match</label>
304 </div>
305 <div class="mui-textfield" id="modelNum">
306 <input id='modelid' type='text' name='modelid' value="255" required/>
307 <label for="modelid">Model ID</label>
308 </div>
309 <h2>Force telemetry off</h2>
310 When running multiple receivers simultaneously from the same TX (to increase the number of PWM servo outputs), there can be at most one receiver with telemetry enabled.<br>Enable this option to ignore the "Telem Ratio" setting on the TX and never send telemetry from this receiver.
311 <br/><br/>
312 <div class="mui-checkbox">
313 <input id='force-tlm' name='force-tlm' type='checkbox' value="1"/>
314 <label for="force-tlm">Force telemetry OFF on this receiver</label>
315 </div>
316 <button type='submit' class="mui-btn mui-btn--small mui-btn--primary">Save</button>
317 </form>
318 </div>
319 <div class="mui-panel">
320 <a id="reset-model" href="#">Reset all model settings to defaults (includes binding).</a>
321 </div>
322 </div>
323 @@end
325 <div class="mui-tabs__pane" id="pane-justified-4">
326 <div class="mui-panel">
327 <h2 id="apmode" style="display:none;">Currently in Access Point mode</h2>
328 <h2 id="stamode" style="display:none;">Current Home network: <span id="ssid"></span></h2>
329 Here you can join a network and it will be saved as your Home network. When you enable WiFi in range of your Home network,
330 ExpressLRS will automatically connect to it. In Access Point (AP) mode, the network name is ExpressLRS TX or ExpressLRS RX
331 with password "expresslrs".
332 <br/>
333 <br/>
334 <form id="sethome" method="POST" autocomplete="off" class="mui-form">
335 <div class="mui-radio">
336 <input type="radio" id="nt0" name="networktype" value="0" checked>
337 <label for="nt0">Set new Home network</label>
338 </div>
339 <div class="mui-radio">
340 <input type="radio" id="nt1" name="networktype" value="1">
341 <label for="nt1">One-time connect to network, retain Home network setting</label>
342 </div>
343 <div class="mui-radio">
344 <input type="radio" id="nt2" name="networktype" value="2">
345 <label for="nt2">Start AP mode, retain Home network setting</label>
346 </div>
347 <div class="mui-radio">
348 <input type="radio" id="nt3" name="networktype" value="3">
349 <label for="nt3">Forget Home network setting, always use AP mode</label>
350 </div>
351 <br/>
352 <div id="credentials">
353 <div class="autocomplete mui-textfield" style="position:relative;">
354 <div id="loader" style="position:absolute;right:0;width: 28px;height: 28px;" class="loader"></div>
355 <input id="network" type="text" name="network" placeholder="SSID"/>
356 <label for="network">WiFi SSID</label>
357 </div>
358 <div class="mui-textfield">
359 <input size='64' id='password' name='password' type='password'/>
360 <label for="password">WiFi password</label>
361 </div>
362 </div>
363 <button type="submit" class="mui-btn mui-btn--primary">Confirm</button>
364 </form>
365 </div>
366 <div class="mui-panel">
367 <a id="connect" href="#">Connect to Home network: <span id="homenet"></span></a>
368 </div>
369 </div>
370 </div>
371 </div>
372 @@include("footer-template.html")
373 </body>
374 <script src="mui.js"></script>
375 <script src="scan.js"></script>
376 </html>