wifi通断器
<h2>WiFi易微联版本继电器</h2>
<p>激活消息:按WiFi产品激活协议</p>
<p>离线遗嘱</p>
<pre><code class="language-c">主题:/xm/sh/will/mqtt/1510100110134691/1020/v2
内容:offline</code></pre>
<p>上线消息:</p>
<pre><code class="language-c">主题:/xm/sh/online/mqtt/1510100110134691/1020/v2
内容:{&quot;header&quot;:{&quot;timeStamp&quot;:&quot;5&quot;},&quot;payload&quot;:{&quot;devices&quot;:[{&quot;nodeid&quot;:&quot;000&quot;,&quot;action&quot;:&quot;online&quot;,&quot;params&quot;:null}]}}</code></pre>
<p>同步消息:</p>
<pre><code class="language-c">主题:/xm/sh/response/mqtt/1510100110134691/1020/v2
内容:{&quot;header&quot;:{&quot;timeStamp&quot;:&quot;6&quot;},&quot;payload&quot;:{&quot;devices&quot;:[{&quot;nodeid&quot;:&quot;000&quot;,&quot;action&quot;:&quot;sync&quot;,&quot;serviceid&quot;:&quot;10200101&quot;,&quot;params&quot;:{&quot;11&quot;:false,&quot;15&quot;:99}}]}}
15参数:WiFi信号强度</code></pre>
<p>继电器状态切换消息:</p>
<pre><code class="language-c">主题:/xm/sh/response/mqtt/1510100110134691/1020/v2
内容:{&quot;header&quot;:{&quot;timeStamp&quot;:&quot;9&quot;},&quot;payload&quot;:{&quot;devices&quot;:[{&quot;nodeid&quot;:&quot;000&quot;,&quot;action&quot;:&quot;command&quot;,&quot;params&quot;:{&quot;11&quot;:false}]}}</code></pre>
<p>继电器控制消息:</p>
<pre><code class="language-c">主题:/xm/sh/request/mqtt/1510100110134691/1020/v2
内容:{&quot;header&quot;:{&quot;timeStamp&quot;:&quot;&quot;},&quot;payload&quot;:{&quot;devices&quot;:[{&quot;action&quot;:&quot;command&quot;,&quot;params&quot;:{&quot;11&quot;:true,&quot;46&quot;:5}}]}}
46参数:不带按默认保持时间,携带则非0有效,0常开,1~0x68D7A3有效,超过则按最大值定时</code></pre>
<p>配置读写、读取WiFi、重启等指令参加WiFi dtu协议</p>
<p>注意事项:
支持433无线控制,但启用433时,原来led接口用作433接收,led切换到14端口。
ota及web页面ota还需测试----<<<
继电器控制11值是bool还是1/0还需确认-----<<<</p>
<hr />
<h2>迅鸣版本-自保持继电器+时钟模块</h2>
<p><code>基础指令参照上述版本,下面是增加内容。</code></p>
<pre><code class="language-c">参数说明:
1、&quot;writeconfig&quot;指令:
&quot;writeTime&quot;:写入当前时间,时间戳(单位秒)
2、&quot;command&quot;指令:
&quot;expTime&quot;:过期时间,时间戳(单位秒)
3、&quot;readconfig&quot;指令:
&quot;currTime&quot;:时钟模块内读取的当前时间,时间戳(单位秒)
&quot;expTime&quot;:过期时间,时间戳(单位秒)
&quot;writeTime&quot;:设置过期时间时的,时间戳(单位秒)
备注:时间戳获取网站推荐:https://tool.lu/timestamp/</code></pre>
<p>1、写入当前时间,激活时钟模块(一般迅鸣出厂时会激活):</p>
<pre><code class="language-c">/xm/sh/request/mqtt/1510100110135639/1020/v2
{&quot;header&quot;:{&quot;timeStamp&quot;:&quot;&quot;},&quot;payload&quot;:{&quot;devices&quot;:[{&quot;action&quot;:&quot;writeconfig&quot;,&quot;params&quot;:{&quot;writeTime&quot;:1747722491}}]}}</code></pre>
<p>2、业务使用,发送开锁+过期时间:</p>
<pre><code class="language-c">/xm/sh/request/mqtt/1510100110135639/1020/v2
{&quot;header&quot;:{&quot;timeStamp&quot;:&quot;&quot;},&quot;payload&quot;:{&quot;devices&quot;:[{&quot;action&quot;:&quot;command&quot;,&quot;params&quot;:{&quot;11&quot;:true,&quot;expTime&quot;:1747710571}}]}}</code></pre>
<p>3、检查时间配置:</p>
<pre><code class="language-c">发送:
/xm/sh/request/mqtt/1510100110135639/1020/v2
{&quot;header&quot;:{&quot;timeStamp&quot;:&quot;&quot;},&quot;payload&quot;:{&quot;devices&quot;:[{&quot;action&quot;:&quot;readconfig&quot;,&quot;params&quot;:{&quot;currTime&quot;:0,&quot;expTime&quot;:0,&quot;writeTime&quot;:0}}]}}
接收:
/xm/sh/response/mqtt/1510100110135639/1020/v2
{&quot;header&quot;:{&quot;timeStamp&quot;:&quot;222&quot;},&quot;payload&quot;:{&quot;devices&quot;:[{&quot;nodeid&quot;:&quot;000&quot;,&quot;action&quot;:&quot;readconfig&quot;,&quot;params&quot;:{&quot;currTime&quot;:1747723177,&quot;expTime&quot;:1747710571,&quot;writeTime&quot;:946598400}}]}}
说明:
currTime:时钟模块读取的当前时间
expTime:时钟模块内存储的过期时间
writeTime:时钟模块内写入过期时间时的时间</code></pre>