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

tinydtls won't install on macOS without modifications #64

Closed
morberg opened this issue Oct 8, 2017 · 12 comments
Closed

tinydtls won't install on macOS without modifications #64

morberg opened this issue Oct 8, 2017 · 12 comments
Assignees

Comments

@morberg
Copy link
Contributor

morberg commented Oct 8, 2017

When trying to install tinydtls from git clone --depth 1 https://git.fslab.de/jkonra2m/tinydtls.git on macOS 10.12 it will fail with:

../mc-helper.c:82:35: error: use of undeclared identifier 'IPV6_ADD_MEMBERSHIP' if(setsockopt(fd, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &mreq, sizeof(mreq))){

It seems IPV6_ADD_MEMBERSHIP is deprecated and IPV6_JOIN_GROUP should be used instead (I am way out of my depth here and might be very wrong).

Replacing the three mentions of IPV6_ADD_MEMBERSHIP with IPV6_JOIN_GROUP in mc-helper.c makes it possible to install tinydtls on macOS and tradfri seems to work fine in Home Assistant 0.55.0.

(I also did mv configure.in configure.ac to get rid of a warning from autoconf.)

@lwis
Copy link
Collaborator

lwis commented Oct 8, 2017

@morberg could you approach jkonra2m to discuss the issue further, or update the README here with macOS instructions please?

@morberg
Copy link
Contributor Author

morberg commented Oct 8, 2017

I couldn't link my github account to the gitlab installation where jkonra2m has his tinydtls implementation to submit an issue there. I think jkonra2m is @kabel42 here on github. I'll try to get hold of him to discuss further.

@diplix
Copy link

diplix commented Oct 8, 2017

can confirm what @morberg says, replacing mentions of IPV6_ADD_MEMBERSHIP works with macos 10.11.6 (el capitan), too. altough tinydtls was present and compiled (and worked fine in HA 0.54.0), i had to recompile it after installation of HA 0.55.0.

@kabel42
Copy link

kabel42 commented Oct 8, 2017

Hi,
the Repo https://git.fslab.de/jkonra2m/tinydtls.git is for experiments with multicast DTLS could you try if https://git.fslab.de/jkonra2m/tinydtls-cython works for you? You can also get that one on pypi: https://pypi.python.org/pypi/DTLSSocket/0.1.3

@morberg
Copy link
Contributor Author

morberg commented Oct 8, 2017

I'm not familiar with the history of this project, but it might be that Tradfri needs multicast DTLS. I have seen one mention of the Android Tradfri app using multicast DTLS to find the gateway.

Perhaps @ggravlingen or @lwis know if multicast is needed or if the pypi version of tinydtls-cython would be enough?

@lwis
Copy link
Collaborator

lwis commented Oct 8, 2017

I'm 95% sure we don't need multicast, so we can probably switch to https://git.fslab.de/jkonra2m/tinydtls-cython

@ggravlingen
Copy link
Member

I just read a use case for multicast and it didn't quite seem to apply to Tradfri so I'm prone to agree with @lwis. @morberg are you able to do a test using https://git.fslab.de/jkonra2m/tinydtls-cython?

@balloob
Copy link
Collaborator

balloob commented Oct 10, 2017

Ooh, if we can use DTLSSocket from PyPi, that would be the best.

I am able to install DTLSSocket on my Mac after I installed the cython package. However, I think that this would also require an update to aiocoap to use DTLSSocket instead of plain tinydtls?

@lwis
Copy link
Collaborator

lwis commented Oct 10, 2017

@balloob
Copy link
Collaborator

balloob commented Oct 10, 2017

ooh, when we do a pip3 install aiocoap[tinydtls] it will include the tinydtls dependency. I wonder if we can specify that as a dependency in our setup.py?

@lwis
Copy link
Collaborator

lwis commented Oct 10, 2017

I think we can switch our extras to reference an extra?

https://github.com/ggravlingen/pytradfri/blob/master/setup.py#L8

I'll play around with it later, may also mean we don't have to do the aiocoap patch.

@lwis
Copy link
Collaborator

lwis commented Oct 28, 2017

We no longer need to install tinydtls in this way, as we use DTLSSocket which doesn't have the same problem.

@lwis lwis closed this as completed Oct 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants