velbus / velbus-tcp-snap

Snap package for python-velbustcp
5 stars 1 forks source link

{Feature request} SSDP protocol for auto discovery #10

Closed MDAR closed 2 years ago

MDAR commented 2 years ago

Hi

I'm getting great responses from Control4 installers, the subject of Auto Discovery of the Velbus-TCP server keeps coming up.

Is it possible to add SSDP to Velbus-TCP ?

(Or is it called SDDP - Simple Device Discovery Protocol???)

https://en.m.wikipedia.org/wiki/Simple_Service_Discovery_Protocol

https://www.control4.com/docs/product/simple-device-discovery-protocol/brochure/latest/

Apparently there is a document to help in the process.

dukeofphilberg commented 2 years ago

Hi @MDAR

This is a great idea, but we have currently no plan to integrate SSDP support in the snap.

For the time being you can use Avahi (deb package or snap) with the following service file.

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
 <name replace-wildcards="yes">Velbus bus connection</name>
  <service>
   <type>_velbus._tcp</type>
   <port>27015</port>
   <txt-record>authentication=true</txt-record>
   <txt-record>ssl=true</txt-record>   
  </service>
</service-group>

This is the route we are going with for the Signum, so if we implement it in the snap it will be the same. Change the parameters as it fits.

MDAR commented 2 years ago

Okay, that's an option.

I'll have to read up on Avahi.

https://snapcraft.io/avahi

Thanks for the XML file, that makes life a lot easier. (I've just got to work out where to put it 🤦‍♂️)


10 minutes later...

"however services can be published using an XML service definition placed in /etc/avahi/services".

http://avahi.org/

http://avahi.org/doxygen/html/index.html#good_publish


10 minutes after that... I've installed the Avahi snap package and it seems that the .service files are located here

/snap/avahi/277/etc/avahi/services

Or here

/var/snap/avahi/common/etc/avahi/services

I'll assume the latter is the common location, so I'll put a file in there and see what happens.

dukeofphilberg commented 2 years ago

/var/snap/avahi/common/etc/avahi/services is the correct place to put it as /snap/ is read-only 😄

Due to the nature of snaps (and their sandboxing) /var/snap/avahi/common/etc/avahi/services is effectively /etc/avahi/services

MDAR commented 2 years ago

/var/snap/avahi/common/etc/avahi/services is the correct place to put it as /snap/ is read-only 😄

Due to the nature of snaps (and their sandboxing) /var/snap/avahi/common/etc/avahi/services is effectively /etc/avahi/services

Do you fancy testing out this script to see if it installs velbus-tcp and avahi correctly?

http://www.mdar.co.uk/dl/velbus/velbus-tcp.sh

I can't seem to see any difference. My Bonjour scanner doesn't reveal anything new and exciting.

Cheers Stuart

MDAR commented 2 years ago

Is there any news on this?

dukeofphilberg commented 2 years ago

We don't have any plans to support SSDP in the snap (or python-velbustcp application itself) yet.