easyesp 命令 esp8266命令 esp01 命令

ESP Easy offers a set of commands to control hardware devices and provide some basic local control using rules. There are several ways to launch commands on ESP Easy:

 

  • Using HTTP: syntax http://<ESP IP>/control?cmd=<command>
  • Using MQTT: send the <command> to topic <MQTT subscribe template>/cmd
  • Using Serial port: just type the <command>
  • Using UDP between ESP units: SendTo <unit nr>, <command> (Setup UDP peer-2-peer first!)
  • Using the Rule engine: just enter the <command> within an event block or conditional block.

 

Commands are divided into several classes: Internal, Rules engine, plugins. The internal commands can only be used from Serial or Rules engine. If you want to use internal commands using HTTP/MQTT, setup an event within the rules section and remotely launch the "event" command.

CommandClassPurposeSyntax
DebugInternalChange Serial port debug levelDebug <1-4>
DelayRulesDelay rule processingDelay <delay in milliSeconds>
EventRulesCreate an eventevent <event>
GPIOPluginDirect control of output pinsSee:GPIO
IPInternalChange IP addressIP <IP address>
LCDPluginWrite text messages to LCD screenSee:LCDDisplay
LCDCMDPluginControl LCD screenSee:LCDDisplay
LongPulsePluginDirect pulse control of output pinsSee:GPIO
MCPGPIOPluginControl MCP23017 output pinsSee:MCP23017
MCPPulsePluginPulse control on MCP23017 output pinsSee:MCP23017
MCPLongPulsePluginLong pulse control on MCP23017 output pinsSee:MCP23017
OLEDPluginWrite text messages to OLED screenSee:OLEDDisplay
OLEDCMDPluginControl OLED screenSee:OLEDDisplay
PCAPWMPluginControl PCA9685 pwm pinsSee:PCA9685
PCFGPIOPluginControl PCF8574 output pinsSee:PCF8574
PCFPulsePluginPulse control on PCF8574 output pinsSee:PCF8574
PCFLongPulsePluginLong pulse control on PCF8574 output pinsSee:PCF8574
PulsePluginDirect pulse control of output pinsSee:GPIO
PublishRulesSend command using MQTT broker servicePublish <topic>, <value>
PWMPluginDirect PWM control of output pinsSee:GPIO
RebootInternalReboot the ESPReboot
ResetInternalReset config to factory defaultReset
SaveInternalSave config to persistent flash memorySave
SendToRulesSend command to other ESP (using UDP)SendTo <unit nr>, <command>
SendToHTTPRulesSend command to other network device using HTTPSendToHTTP <IP address>, <Portnumber>, <command>
SendToUDPRulesSend command to other network device using UDPSendToUDP <IP address>, <Portnumber>, <command>
ServoPluginDirect control of servo motorsSee:GPIO
SettingsInternalShow settings on serial terminalSettings
StatusPluginShow status on previously controlled pinsStatus <device>, <pin>
TimerSetRulesStart a timed eventTimerSet <timernr>,
WifiAPKeyInternalChange AP WPA keyWifiAPKey <WPA key>
WifiConnectInternalConnect to configured wireless networkWifiConnect
WifiDisconnectInternalDisconnect from wireless networkWifiDisconnect
WifiKeyInternalChange WPA keyWifiKey <Wifi WPA key>
WifiScanInternalScan Wireless networksWifiScan
WifiSSIDInternalChange SSIDWifiSSID <SSID>

ESPEasy System Variables

 

Generic: These can be used in templates for HTTP, MQTT, OLED and LCD displays and within rules:

%sysname%   - Name as configured through the webgui
%systime%       - Current time if NTP is enabled
%uptime%        - Uptime in minutes
%ip%            - Current IP address
%vcc%           - VCC value, this needs a custom compiled firmware! (#define FEATURE_ADC_VCC true)

Rules engine specific:

%eventvalue%       - substitutes the event value (everything that comes after the '=' sign)

Sample rules section:

on remoteTimerControl do
  timerSet 1,%eventvalue%
endon

Now send this command to the ESP:

http://<your esp ip>/control?cmd=event,remoteTimerControl=5

and it will set rules timer nr 1 to 5 seconds. Using this technique you can parse a value from an event to the rule engine. (note that 'timerSet' is a rule command and cannot be run directly from a remote command)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值