Add support for setting Source and Target sysID (#2886)
[ExpressLRS.git] / src / html / index.html
blobe72b3bceab10ecf1d85132ec51cd9c5ef880b725
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 id="has-highpower" class="mui-checkbox" style="display: none;">
85 <input id='unlock-higher-power' name='unlock-higher-power' type='checkbox'/>
86 <label for="unlock-higher-power">Unlock higher power</label>
87 </div>
88 <div class="mui-checkbox">
89 <input id='is-airport' name='is-airport' type='checkbox'/>
90 <label for="is-airport">Use as AirPort Serial device</label>
91 </div>
92 <div class="mui-textfield">
93 <input size='7' id='airport-uart-baud' name='airport-uart-baud' type='text'/>
94 <label for="airport-uart-baud">AirPort UART baud</label>
95 </div>
96 @@else:
97 <div id="baud-config" class="mui-textfield" style="display: block;">
98 <input size='7' id='rcvr-uart-baud' name='rcvr-uart-baud' type='text'/>
99 <label for="rcvr-uart-baud">UART baud</label>
100 </div>
101 <div class="mui-checkbox">
102 <input id='lock-on-first-connection' name='lock-on-first-connection' type='checkbox'/>
103 <label for="lock-on-first-connection">Lock on first connection</label>
104 </div>
105 <div class="mui-checkbox">
106 <input id='is-airport' name='is-airport' type='checkbox'/>
107 <label for="is-airport">Use as AirPort Serial device</label>
108 </div>
109 @@end
110 <button id='submit-options' class="mui-btn mui-btn--primary" disabled>Save</button>
111 <div id="reset-options" style="display: none;">
112 <a class="mui-btn mui-btn--small mui-btn--danger">Reset runtime options to defaults</a>
113 </div>
114 <input type="hidden" id="flash-discriminator" name="flash-discriminator"/>
115 <input type="hidden" id="wifi-ssid" name="wifi-ssid"/>
116 <input type="hidden" id='wifi-password' name='wifi-password'/>
117 </form>
118 </div>
119 @@if isTX:
120 <div class="mui-panel">
121 <h2>Import/Export</h2>
122 <br/>
123 <div>
124 <a href="/config?export" download="models.json" target="_blank" class="mui-btn mui-btn--small mui-btn--dark">Save model configuration file</a>
125 </div>
126 <div>
127 <button class="mui-btn mui-btn--small mui-btn--primary upload">
128 <label>
129 Upload model configuration file
130 <input type="file" id="fileselect" name="fileselect[]" />
131 </label>
132 </button>
133 </div>
134 </div>
135 @@end
136 </div>
138 <div class="mui-tabs__pane" id="pane-justified-2">
139 <div class="mui-panel">
140 <h2>Firmware Update</h2>
141 Select the correct <strong>firmware.bin@@{ ".gz" if (is8285 and not isTX) else "" }</strong> for @@{PLATFORM} otherwise a bad flash may occur.
142 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>.
143 <br/><br/>
144 @@if (is8285 and not isTX):
145 <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>
146 <br/>
147 @@end
148 <button id="upload_btn" class="mui-btn mui-btn--primary upload" style="margin: 0 auto; display:block;">
149 <label>
150 Select firmware file
151 <input type="file" id="firmware_file" name="update[]" />
152 </label>
153 </button>
154 <div id="filedrag">or drop firmware file here</div>
155 <br/>
156 <h3 id="status"></h3>
157 <progress id="progressBar" value="0" max="100" style="width:100%;"></progress>
158 </div>
159 </div>
161 @@if isTX:
162 <div class="mui-tabs__pane" id="pane-justified-3">
163 <div class="mui-panel">
164 <h2>Button Actions</h2>
165 Specify which actions to perform when clicking or long pressing module buttons.
166 <br/><br/>
167 <form class="mui-form" id='button_actions'>
168 <table class="mui-table">
169 <tbody id="button-actions"></tbody>
170 </table>
171 <div id="button1-color-div" style="display: none;">
172 <input id='button1-color' name='button1-color' type='color'/>
173 <label for="button1-color">User button 1 color</label>
174 </div>
175 <div id ="button2-color-div" style="display: none;">
176 <input id='button2-color' name='button2-color' type='color'/>
177 <label for="button2-color">User button 2 color</label>
178 </div>
179 <button id="submit-actions" class="mui-btn mui-btn--primary">Save</button>
180 </form>
181 </div>
182 </div>
183 @@end
184 @@if not isTX:
185 <div class="mui-tabs__pane" id="pane-justified-3">
186 <div class="mui-panel">
187 <div id="model_tab">
188 <h2>PWM Output</h2>
189 Set PWM output mode and failsafe positions.
190 <ul>
191 <li><b>Output:</b> Receiver output pin</li>
192 <li><b>Features:</b> If an output is capable of supporting another function, that is indicated here</li>
193 <li><b>Mode:</b> Output frequency, 10KHz 0-100% duty cycle, binary On/Off, DShot, Serial, or I2C (some options are pin dependant)</li>
194 <ul>
195 <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>
196 </ul>
197 <li><b>Input:</b> Input channel from the handset</li>
198 <li><b>Invert:</b> Invert input channel position</li>
199 <li><b>750us:</b> Use half pulse width (494-1006us) with center 750us instead of 988-2012us</li>
200 <li><b>Failsafe</b>
201 <ul>
202 <li>"Set Position" sets the servo to an absolute "Failsafe Pos"
203 <ul>
204 <li>Does not use "Invert" flag</li>
205 <li>Value will be halved if "750us" flag is set</li>
206 <li>Will be converted to binary for "On/Off" mode (>1500us = HIGH)</li>
207 </ul>
208 </li>
209 <li>"No Pulses" stops sending pulses
210 <ul>
211 <li>Unpowers servos</li>
212 <li>May disarm ESCs</li>
213 </ul>
214 </li>
215 <li>"Last Position" continues sending last received channel position</li>
216 </ul>
217 </li>
218 </ul>
219 <form action="/pwm" id="pwm" method="POST">
220 </form>
221 </div>
222 <form class="mui-form" action='/config' id='config' method='POST'>
223 <h2>Binding Phrase</h2>
224 <div class="mui-select">
225 <select id="vbind" name="vbind">
226 <option value="0">Persistent (Default) - Bind information is stored across reboots</option>
227 <option value="1">Volatile - Never store bind information across reboots</option>
228 <option value="2">Returnable - Unbinding a receiver reverts to flashed binding phrase</option>
229 </select>
230 <label for="vbind">Binding storage</label>
231 </div>
232 <div id="bindphrase">
233 Enter a new binding phrase to replace the current binding information.
234 This will persist across reboots, but <b>will be reset</b> if the firmware is flashed with a binding phrase.
235 Note: The Binding phrase is not remembered, it is a temporary field used to generate the binding UID.
236 <br/><br/>
237 <div class="mui-textfield">
238 <input type="text" id="phrase" name="phrase" placeholder="Binding Phrase" />
239 <label for="phrase">Binding Phrase</label>
240 </div>
241 <div class="mui-textfield">
242 <label for="uid"><span id="uid-text"></span></label>
243 <span class="badge" id="uid-type"></span>
244 <input size="40" id="uid" name="uid" type="text" class="array" readonly/>
245 </div>
246 </div>
247 <div id="serial-config">
248 <h2>Serial Protocol</h2>
249 Set the protocol used to communicate with the flight controller or other external devices.
250 <br/><br/>
251 <div class="mui-select">
252 <select id='serial-protocol' name='serial-protocol'>
253 <option value='0'>CRSF</option>
254 <option value='1'>Inverted CRSF</option>
255 <option value='2'>SBUS</option>
256 <option value='3'>Inverted SBUS</option>
257 <option value='4'>SUMD</option>
258 <option value='5'>DJI RS Pro</option>
259 <option value='6'>HoTT Telemetry</option>
260 <option value='7'>MAVLINK</option>
261 </select>
262 <label for='serial-protocol'>Serial Protocol</label>
263 </div>
264 </div>
265 <div id="serial1-config">
266 <div class="mui-select">
267 <select id='serial1-protocol' name='serial1-protocol'>
268 <option value='0'>Off</option>
269 <option value='1'>CRSF</option>
270 <option value='2'>Inverted CRSF</option>
271 <option value='3'>SBUS</option>
272 <option value='4'>Inverted SBUS</option>
273 <option value='5'>SUMD</option>
274 <option value='6'>DJI RS Pro</option>
275 <option value='7'>HoTT Telemetry</option>
276 <option value='8'>Tramp</option>
277 <option value='9'>SmartAudio</option>
278 </select>
279 <label for='serial1-protocol'>Serial2 Protocol</label>
280 </div>
281 </div>
282 <div id="sbus-config" style="display: none;">
283 <h2>SBUS Failsafe</h2>
284 Set the failsafe behaviour when using the SBUS protocol:<br/>
285 <ul>
286 <li>"No Pulses" stops sending SBUS data when a connection to the transmitter is lost</li>
287 <li>"Last Position" continues to send the last received channel data along with the FAILSAFE bit set</li>
288 </ul>
289 <br/>
290 <div class="mui-select">
291 <select id='sbus-failsafe' name='serial-failsafe'>
292 <option value='0'>No Pulses</option>
293 <option value='1'>Last Position</option>
294 </select>
295 <label for="sbus-failsafe">SBUS Failsafe</label>
296 </div>
297 </div>
299 <h2>Model Match</h2>
300 Specify the 'Receiver' number in OpenTX/EdgeTX model setup page and turn on the 'Model Match'
301 in the ExpressLRS Lua script for that model. 'Model Match' is between 0 and 63 inclusive.
302 <br/><br/>
303 <div class="mui-checkbox">
304 <input id='model-match' name='model-match' type='checkbox'/>
305 <label for="model-match">Enable Model Match</label>
306 </div>
307 <div class="mui-textfield" id="modelNum">
308 <input id='modelid' type='text' name='modelid' value="255" required/>
309 <label for="modelid">Model ID</label>
310 </div>
311 <h2>Force telemetry off</h2>
312 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.
313 <br/><br/>
314 <div class="mui-checkbox">
315 <input id='force-tlm' name='force-tlm' type='checkbox' value="1"/>
316 <label for="force-tlm">Force telemetry OFF on this receiver</label>
317 </div>
318 <button type='submit' class="mui-btn mui-btn--small mui-btn--primary">Save</button>
319 </form>
320 </div>
321 <div class="mui-panel">
322 <a id="reset-model" href="#">Reset all model settings to defaults (includes binding).</a>
323 </div>
324 </div>
325 @@end
327 <div class="mui-tabs__pane" id="pane-justified-4">
328 <div class="mui-panel">
329 <h2 id="apmode" style="display:none;">Currently in Access Point mode</h2>
330 <h2 id="stamode" style="display:none;">Current Home network: <span id="ssid"></span></h2>
331 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,
332 ExpressLRS will automatically connect to it. In Access Point (AP) mode, the network name is ExpressLRS TX or ExpressLRS RX
333 with password "expresslrs".
334 <br/>
335 <br/>
336 <form id="sethome" method="POST" autocomplete="off" class="mui-form">
337 <div class="mui-radio">
338 <input type="radio" id="nt0" name="networktype" value="0" checked>
339 <label for="nt0">Set new Home network</label>
340 </div>
341 <div class="mui-radio">
342 <input type="radio" id="nt1" name="networktype" value="1">
343 <label for="nt1">One-time connect to network, retain Home network setting</label>
344 </div>
345 <div class="mui-radio">
346 <input type="radio" id="nt2" name="networktype" value="2">
347 <label for="nt2">Start AP mode, retain Home network setting</label>
348 </div>
349 <div class="mui-radio">
350 <input type="radio" id="nt3" name="networktype" value="3">
351 <label for="nt3">Forget Home network setting, always use AP mode</label>
352 </div>
353 <br/>
354 <div id="credentials">
355 <div class="autocomplete mui-textfield" style="position:relative;">
356 <div id="loader" style="position:absolute;right:0;width: 28px;height: 28px;" class="loader"></div>
357 <input id="network" type="text" name="network" placeholder="SSID"/>
358 <label for="network">WiFi SSID</label>
359 </div>
360 <div class="mui-textfield">
361 <input size='64' id='password' name='password' type='password'/>
362 <label for="password">WiFi password</label>
363 </div>
364 </div>
365 <button type="submit" class="mui-btn mui-btn--primary">Confirm</button>
366 </form>
367 </div>
368 <div class="mui-panel">
369 <a id="connect" href="#">Connect to Home network: <span id="homenet"></span></a>
370 </div>
371 </div>
372 </div>
373 </div>
374 @@include("footer-template.html")
375 </body>
376 <script src="mui.js"></script>
377 <script src="scan.js"></script>
378 </html>