Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardized way to recognize and setup clients #18

Open
johan-bjareholt opened this issue Mar 2, 2016 · 3 comments
Open

Standardized way to recognize and setup clients #18

johan-bjareholt opened this issue Mar 2, 2016 · 3 comments
Labels

Comments

@johan-bjareholt
Copy link
Collaborator

We currently have the DeviceMonitor which checks if the homebrain ports on any devices on the local network are open which can detect clients. This makes us able to know which clients are out there, but homebrain still has absolutely no idea about what kind of client it is, what kind of input it accepts and therefore not what it's supposed to do with it.

For everything that listens for events it's a must for a good experience; having to manually enter IPs and ports is a hassle. I have an implementation idea, not sure if it's the best one but it would work.

As soon as a client connects to the network it should send a "Hello" message as a UDP broadcast including the connection type (rest, websock, udp), port and event types, name etc so homebrain can know what to do with the node. This would be a step forward to make the output of #17 more interesting.

Any additional ideas about this solution? Alternative ways to solve it?

@ErikBjare ErikBjare added the story label Mar 2, 2016
@ErikBjare
Copy link
Member

I think UDP broadcasts are the goto way to announce availability of a service on a local network (this is how Steam's In-home Streaming does it for instance). But one broadcast likely isn't enough (imagine for instance if the Homebrain core is momentarily offline when the client connects to the network), and an alternative might be for the Homebrain core to do the broadcasting instead of the clients who will instead respond to the broadcast with information about themselves, effectively registering themselves via the REST API.

@ErikBjare
Copy link
Member

Another potential way would be to look for clients using nmap.

@johan-bjareholt
Copy link
Collaborator Author

Alot of progress has been made on this.

The udp broadcaster is working and the clients (simulatedlamp and ttsclient) can now find the homebrain server automatically. They also register themselves at the homebrain server by sending a "add_lamp" or "add_tts" message which a new devicemanager handles and sets them up.

What i don't like about this solution is that lamps and tts are always set up the same way, a chain with a ID filter with a default name and then the agent. Currently it's only possible to add tts and lamps, i would like a dynamic system where you can specify what kind of events the clients accepts and sends.

If these two things are fixed, we can start working on the web interface for configuring clients and agents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants