"UDP Message Bus" plugin

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
FanOfHue
Normal user
Posts: 96
Joined: 06 Oct 2018, 10:08

"UDP Message Bus" plugin

#1 Post by FanOfHue » 22 Nov 2018, 18:29

I wanted a really simple way of distributing sensor data across the local network to be consumed by different clients. MQTT could have been an option but i liked a more simple broker-less approach with lower overhead. I ran some tests using the Generic UDP protocol to send data towards the broadcast address 255.255.255.255 and this works really cool. I can also easily monitor it using tools like powershell or wireshark. I now that ESP Easy has some dedicated protocol to interconnect units but i did not like that approach.

So i developed a plugin to capture the UDP messages send by the UDP generic controller C010 plugin and act like a dummy sensor on other ESP units.
They can also capture messages send from powershell on my local PC. All Philips Hue bridge sensor data and events are also send on the Message Bus by a unit that has the Hue plugin.

The plugin also has a new lean and mean web root page, but it requires a change in the webserver.ino to redirect the root page to this plugin. It maintains its own node list based on names instead of unit's, sorted by name. Other Non-ESP devices can announce themselves using simple text messages.

My scope is a bit bigger than ESP only so having a simple Message Bus makes life more easy.
_P253_MSGBus.zip
(4.13 KiB) Downloaded 201 times

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

Re: "UDP Message Bus" plugin

#2 Post by grovkillen » 22 Nov 2018, 18:51

Cool, will test it out.
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:

FanOfHue
Normal user
Posts: 96
Joined: 06 Oct 2018, 10:08

Re: "UDP Message Bus" plugin

#3 Post by FanOfHue » 22 Nov 2018, 20:19

Thanks for your reaction. Like to see if others are interrested in this Message Bus idea.

The web page i've created tries to mimic an app style minimalistic interface, see sample:
RootWeb.png
RootWeb.png (13.94 KiB) Viewed 2776 times
Each ESP unit displays it's main sensorvalue to the main screen using a rules command and i can quickly cycle through my list of sensors and their values.
I had to change the "handle_root" in webserver.ino to get this working. Is there another way to implement custom main screen?

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

Re: "UDP Message Bus" plugin

#4 Post by grovkillen » 22 Nov 2018, 20:50

I wouldn't put too much time until a custom page. I'm working on a new GUI engine which will allow for custom pages.
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:

FanOfHue
Normal user
Posts: 96
Joined: 06 Oct 2018, 10:08

Re: "UDP Message Bus" plugin

#5 Post by FanOfHue » 19 Dec 2018, 15:13

Nice, when you guys have finished that, i will have a look at the code.
In the mean time, i implemented just two small Rule commands to add text and buttons to the tiny web gui that i want:

webPrint <text>
webButton <classname>;<linkref>;<button caption>

This is sufficient for my personal need. I don't want a fullblown webgui because i don't need it for my "Message Bus" Nodes.
Just a list of nodes, bare sensor data and optionally one or two buttons to have local GPIO control as a fallback procedure.

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests