added a help section about GPIO API, update DE translations

master
Ondřej Hruška 6 years ago
parent 2e014f4312
commit ae38110816
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 14
      lang/de.php
  2. 1
      pages/help.php
  3. 39
      pages/help/iocontrol.php

@ -266,13 +266,13 @@ return [
', ',
'hwtuning.overclock' => 'Auf 160MHz übertakten', 'hwtuning.overclock' => 'Auf 160MHz übertakten',
'gpio2_config' => 'GPIO2 function', // TODO translate 'gpio2_config' => 'GPIO2 Funktion',
'gpio4_config' => 'GPIO4 function', 'gpio4_config' => 'GPIO4 Funktion',
'gpio5_config' => 'GPIO5 function', 'gpio5_config' => 'GPIO5 Funktion',
'gpio_config.off' => 'Disabled', 'gpio_config.off' => 'Deaktiviert',
'gpio_config.off_2' => 'Debug UART Tx', 'gpio_config.off_2' => 'UART Tx Debuggen',
'gpio_config.out_initial0' => 'Output (initial 0)', 'gpio_config.out_initial0' => 'Output (Anfangslevel 0)',
'gpio_config.out_initial1' => 'Output (initial 1)', 'gpio_config.out_initial1' => 'Output (Anfangslevel 1)',
'gpio_config.in_pull' => 'Input (pull-up)', 'gpio_config.in_pull' => 'Input (pull-up)',
'gpio_config.in_nopull' => 'Input (floating)', 'gpio_config.in_nopull' => 'Input (floating)',

@ -18,6 +18,7 @@
<?php require __DIR__ . "/help/cmd_screen.php"; ?> <?php require __DIR__ . "/help/cmd_screen.php"; ?>
<?php require __DIR__ . "/help/cmd_d2d.php"; ?> <?php require __DIR__ . "/help/cmd_d2d.php"; ?>
<?php require __DIR__ . "/help/cmd_system.php"; ?> <?php require __DIR__ . "/help/cmd_system.php"; ?>
<?php require __DIR__ . "/help/iocontrol.php"; ?>
<script> <script>
function hpfold(yes) { function hpfold(yes) {

@ -0,0 +1,39 @@
<div class="Box fold">
<h2>Remote GPIO Control</h2>
<div class="Row v">
<p>
ESPTerm provides a simple API to remotely control and read GPIO pins GPIO2, GPIO4, and GPIO5.
The main use of this API is to remotely reset a device that communicates with ESPTerm
through the UART.
</p>
<p>
GPIO2 is normally used for debug UART, so when used as GPIO, debug logging is disabled. You
can configure the pin functions in <a href="<?= url('cfg_system') ?>">System Settings</a>.
</p>
<p>
The GPIO control endpoint is `/api/v1/gpio`, with optional GET arguments:
</p>
<ul>
<li>`do2=<i>x</i>` - set GPIO2 level. <i>x</i> can be `0`, `1`, or `t` to toggle the pin.
<li>`do4=<i>x</i>` - set GPIO4 level
<li>`do5=<i>x</i>` - set GPIO5 level
<li>`pulse=<i>ms</i>` - the command starts a pulse. After the given amount of time
(milliseconds) has elapsed, the pins are set to the opposite levels than what was specified
(in the case of toggle, the original pin state)
</ul>
<p>
A quick example: <a href="/api/v1/gpio?do4=1&amp;pulse=500">`/api/v1/gpio?do4=1&amp;pulse=500`</a>
sends a 500ms long positive pulse on GPIO4.
</p>
<p>
The GPIO endpoint always returns a JSON object like this: `{"io2":0,"io4":1,"io5":0}`, showing
the current input levels. Input reading works always, regardless of the GPIO settings.
</p>
</div>
</div>
Loading…
Cancel
Save