IP and Reeboot over MQTT-Topic

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
AndyUM61
New user
Posts: 3
Joined: 25 Mar 2017, 10:22

IP and Reeboot over MQTT-Topic

#1 Post by AndyUM61 » 25 Mar 2017, 10:36

Hello,

is it possible to write the current IP in an MQTT-topic?
And, could a reeboot be triggered via an MQTT-topic subscribe(e.g., RESET)?
If yes how?

Thank you!

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: IP and Reeboot over MQTT-Topic

#2 Post by grovkillen » 25 Mar 2017, 19:37

I use "MQTT import" for this, plus using rules.

Link to picture with my device for MQTT import.

Rules:

Code: Select all

on System#Boot do
 Publish %sysname%/status,Booted
 Publish %sysname%/IP,%ip%
endon

on sniff#cmdMQTT=1 do
  Publish %sysname%/IP,%ip%
endon

on sniff#cmdMQTT=2 do
  Publish %sysname%/Time,%systime%
endon

on sniff#cmdMQTT=3 do
 Publish %sysname%/status,Rebooting
 Reboot
endon
So whenever I want to know the IP, systime or reboot ALL NODES I just publish the cmdMQTT-topic with corresponding number.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

AndyUM61
New user
Posts: 3
Joined: 25 Mar 2017, 10:22

Re: IP and Reeboot over MQTT-Topic

#3 Post by AndyUM61 » 26 Mar 2017, 12:47

Excellent!
The first part works perfectly.

But unfortunately I get the MQTT import plugin not integrated :(.
Compailing always aborted with an error message.
> Redefinition of 'float string2float (String)'
Therefore, the second part does not work.

I use the Arduino IDE 1.8.0 and have tried with ESP EASY R120 and R147_RC8.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: IP and Reeboot over MQTT-Topic

#4 Post by grovkillen » 26 Mar 2017, 13:43

You got PM with the compiled file.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

AndyUM61
New user
Posts: 3
Joined: 25 Mar 2017, 10:22

Re: IP and Reeboot over MQTT-Topic

#5 Post by AndyUM61 » 26 Mar 2017, 13:51

Great.
Thank you very much!

Post Reply

Who is online

Users browsing this forum: No registered users and 49 guests