Différences entre les versions de « Domotech esp8266 api »
| Ligne 261 : | Ligne 261 : | ||
** ''2'' → AP mode | ** ''2'' → AP mode | ||
** ''3'' → AP_STA (both) | ** ''3'' → AP_STA (both) | ||
| − | *''sta_ssid'' : SSID of the AP to connect to (''wifimode'' must be 1) | + | *''sta_ssid'' : SSID of the AP to connect to (''wifimode'' must be 1 or 3) |
| − | *''sta_pwd'' : | + | *''sta_pwd'' : password of the AP to connect to (''wifimode'' must be 1 or 3) |
| − | *''ap_ssid'' | + | *''ap_ssid'' : AP SSID (''wifimode'' must be 2 or 3) |
| − | *''ap_pwd'' | + | *''ap_pwd'' : AP password (''wifimode'' must be 2 or 3) |
| − | *''ap_pwr'' | + | *''ap_pwr'' : AP output power (''wifimode'' must be 1 or 3) |
| − | *''ipconfig'' | + | *''ipconfig'' : ip configuration, ''0'' for DHCP, ''1'' for static |
| − | *''ipaddr'' | + | *''ipaddr'' : ip address (''ipconfig'' must be ''1'') |
| − | *''netmask'' | + | *''netmask'' : ip netmask (''ipconfig'' must be ''1'') |
| − | *''gateway'' | + | *''gateway'' : ip gateway (''ipconfig'' must be ''1'') |
| − | *''dns'' | + | *''dns'' : ip dns (''ipconfig'' must be ''1'') |
| − | *''to_apply'' | + | *''to_apply'' : will apply configuration by rebooting the device |
| − | *'' | + | *''disabled'' : if ''1'' disable the module otherwise module is active with ''0'' |
| − | + | *''is_temp'' : if ''1'' temperature sensor will be active, otherwise ''0'' to disable | |
| − | *''is_temp'' | + | *''temp_pin'' : GPIO to look |
| − | *''temp_pin'' | ||
*''isr'' | *''isr'' | ||
*''is_serial'' | *''is_serial'' | ||
Version du 13 septembre 2018 à 08:11
Commandes
Déclaration de cette API dans le fichier ApiCommandServer.cpp.
| URL | Corps | Verbe | Action | Code retour | Implémentée |
|---|---|---|---|---|---|
|
/api/cmd/locate |
|
GET |
Fait clignoter la led (D4) présente sur le module |
|
|
|
/api/cmd/reboot |
|
GET |
Redémarre le module |
|
|
|
/api/cmd/disable |
|
GET |
Désactive le module. Un module désactivé ne répondra plus à aucun ordre, notamment de modification de GPIO. |
|
|
|
/api/cmd/enable |
|
GET |
Active le module. |
|
GPIO
Déclaration de cette API dans le fichier ApiGpioServer.cpp.
| URL | Corps | Verbe | Action | Code retour | Implémentée |
|---|---|---|---|---|---|
|
/api/gpio |
|
GET |
Affiche l'état des broches |
|
|
|
/api/gpio/mode |
|
GET |
Modifie le mode d'une broche |
|
|
|
/api/gpio/state |
|
GET |
Récupère / modifie l'état d'une broche |
|
|
|
/api/gpio/toggle |
|
GET |
Permet de basculer l'état d'une broche |
|
|
|
/api/gpio/time |
|
GET |
Permet de basculer l'état d'une broche pendant un certain nombre de secondes |
|
|
|
/api/gpio/isr |
|
GET |
Attache une interruption sur une broche |
|
|
|
/api/gpio/serial |
|
GET |
Démarre / stop la lecture sur le port série ou envoie / retourne les données dans le tampon du port série (UART) |
|
Température
Déclaration de cette API dans le fichier ApiTempServer.cpp.
| URL | Corps | Verbe | Action | Code retour | Implémentée |
|---|---|---|---|---|---|
|
/api/temp |
|
GET |
Affiche les températures de tous les thermomètres ou false si aucun thermomètre n'est présent |
|
|
|
/api/temp/res |
|
GET |
Affiche la résolution si le paramètre res est absent
Configure la résolution si le paramètre res est présent |
|
|
|
/api/temp/addr |
|
GET |
Affiche les adresses des thermomètres |
|
Configuration
Déclaration de cette API dans le fichier ApiConfigServer.cpp.
| URL | Corps | Verbe | Action | Code retour | Implémentée |
|---|---|---|---|---|---|
|
/api/conf |
|
GET |
|
||
|
/api/conf/apply |
|
GET |
|
||
|
/api/conf/save |
|
GET |
|
||
|
/api/conf/reset |
|
GET |
|