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

Tradfri #10219

Closed
chiversc opened this issue Oct 29, 2017 · 15 comments
Closed

Tradfri #10219

chiversc opened this issue Oct 29, 2017 · 15 comments

Comments

@chiversc
Copy link

chiversc commented Oct 29, 2017

Home Assistant release (hass --version):
0.56.2
Python release (python3 --version):
3.5
Component/platform:
Raspbery pi model 1, and/or windows 10
Description of problem:
HASS first installed on PI, and runs ok, but discovers nothing. I have added tradfri to configuration yaml. This still doesn't work, and looking at the error messages I can see if seems to be missing DTLSSockets, so I try to install this. After many frustrated hours I find that google advises me to install Cython before installing DTLSSockets. This is the end of the road for my attempt to use HASS on PI, as Cython won't install (after literally hours of waiting it fails to install, citing a lack of memory). So it seems HASS to control Tradfri using PI is a no go.
Now I waste a couple of hours trying to install HASS on my synology NAS. This was even more frsutrating than the PI, and ended when I hit a brick wall as the instructions I was following said to create a daemon file. That totally baffled me, and nowhere can I find advice on how to create a daemon file (and when I say advice, I mean something step by step, inlcuding what file name extension to use, rather than the "create a daemon file" posted by the helpful soul who left their advice on the net), so I gave up on the synology. This is probably something I shouldn't have started, so I wasn't too depressed about this, other than another couple of lost hours. I don't really want to add to the overhead on the NAS any way, so I moved to the much more familiar windows 10. I figure if it works, then maybe I'll splash out on a PI3 and hope for better luck than with the PI. Installation of python and HASS in windows 10 was a breeze ... I mean really quick and easy comparred to the frustrating day I just spent with the PI. But I have the same problem with Tradfri. HASS tells me "The following components and platforms could not be set up: discovery & tradfri" and if I look in the command promt I can see the following errors which seem depressingly familiar

[32m2017-10-29 22:53:43 INFO (SyncWorker_0) [homeassistant.util.package] Attempting install of DTLSSocket==0.1.3[0m
[31m2017-10-29 22:53:44 ERROR (SyncWorker_0) [homeassistant.util.package] Unable to install package DTLSSocket==0.1.3: Command "python setup.py egg_info" failed with error code 1 in C:\Users\User\AppData\Local\Temp\pip-build-0cfktodh\DTLSSocket\[0m
[31m2017-10-29 22:53:44 ERROR (MainThread) [homeassistant.setup] Not initializing tradfri because could not install dependency DTLSSocket==0.1.3[0m
[31m2017-10-29 22:53:44 ERROR (MainThread) [homeassistant.setup] Setup failed for tradfri: Could not install all requirements.[0m

any suggestion how I can simply get homeassistant working with tradfri would be very gratefully received.

@gstevenson
Copy link

Looks like there's additional conversation in #10119 which might be useful.

@gstevenson
Copy link

And more in #9752

@gstevenson
Copy link

Final update from me: looks like this will be fixed in 0.56.3 https://github.com/home-assistant/home-assistant/milestone/96?closed=1

@chiversc
Copy link
Author

Greg, your super quick response if really very helpful, thanks.
Though I'm no expert, I had foudn the first two threads you shared, which led me to understand I needed Cython. That's what led to me discovering the current version of Cython won't install on an original PI.
I am delighted / excited to learn 56.3 will save me !

@ggravlingen
Copy link
Contributor

Is this working now?

@joggs
Copy link

joggs commented Nov 10, 2017

Unfortunately not.
Impossible to install DTLSSocket, no matter version, no matter if cython etc is pre-installed. I have tried many versions of python as well. Testing in windows10

@joggs
Copy link

joggs commented Nov 10, 2017

One example of a verbose dump:

C:\>pip3 install DTLSSocket -v
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
Collecting DTLSSocket
  1 location(s) to search for versions of DTLSSocket:
  * https://pypi.python.org/simple/dtlssocket/
  Getting page https://pypi.python.org/simple/dtlssocket/
  Looking up "https://pypi.python.org/simple/dtlssocket/" in the cache
  Current age based on date: 497
  Freshness lifetime from max-age: 600
  Freshness lifetime from request max-age: 600
  The response is "fresh", returning cached response
  600 > 497
  Analyzing links from page https://pypi.python.org/simple/dtlssocket/
    Found link https://pypi.python.org/packages/05/aa/2ce2b75307a9293d02dec980d2fbac2187175840c64e3b7c232fd04b14b9/DTLSSocket-0.1.0.tar.gz#md5=c5d7d2c7d8505973282fcfeefa28d549 (from https://pypi.python.org/simple/dtlssocket/), version: 0.1.0
    Found link https://pypi.python.org/packages/0c/3f/f65ca50a68b2e4d993e09fec508a65f85529fa9e0a07347ed1a73b7d3732/DTLSSocket-0.1.2.tar.gz#md5=08ea55c4968b3d4e68bd592ac3e1b6be (from https://pypi.python.org/simple/dtlssocket/), version: 0.1.2
    Found link https://pypi.python.org/packages/28/ea/9a8f0a55cfb06643c9ca6533d0fab63c413caf4e67cfbbc88b23436dbcf4/DTLSSocket-0.1.3.tar.gz#md5=3f38a270ca4ade57f18e3030b209a7de (from https://pypi.python.org/simple/dtlssocket/), version: 0.1.3
    Found link https://pypi.python.org/packages/3a/c1/d1f41b90a58fcba9202bf649be117abbed884176260302fed5e1144f09f6/DTLSSocket-0.1.4.tar.gz#md5=bcef26a5320348905e3df61d65e983c3 (from https://pypi.python.org/simple/dtlssocket/), version: 0.1.4
    Found link https://pypi.python.org/packages/ef/38/2442b0bccd2dbf2b2dcc472612a061b3479d40f82feebba864b44dd65983/DTLSSocket-0.1.1.tar.gz#md5=91a349d31ea48e5f5068719c1b96e986 (from https://pypi.python.org/simple/dtlssocket/), version: 0.1.1
  Using version 0.1.4 (newest of versions: 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.1.4)
  Looking up "https://pypi.python.org/packages/3a/c1/d1f41b90a58fcba9202bf649be117abbed884176260302fed5e1144f09f6/DTLSSocket-0.1.4.tar.gz" in the cache
  Current age based on date: 1149397
  Freshness lifetime from max-age: 31557600
  The response is "fresh", returning cached response
  31557600 > 1149397
  Using cached DTLSSocket-0.1.4.tar.gz
  Downloading from URL https://pypi.python.org/packages/3a/c1/d1f41b90a58fcba9202bf649be117abbed884176260302fed5e1144f09f6/DTLSSocket-0.1.4.tar.gz#md5=bcef26a5320348905e3df61d65e983c3 (from https://pypi.python.org/simple/dtlssocket/)
  Running setup.py (path:C:\Temp\pip-build-z2pekt7c\DTLSSocket\setup.py) egg_info for package DTLSSocket
    Running command python setup.py egg_info
    Compiling DTLSSocket/dtls.pyx because it depends on c:\python35-32\lib\site-packages\Cython\Includes\libc\stdint.pxd.
    [1/1] Cythonizing DTLSSocket/dtls.pyx
    running egg_info
    creating pip-egg-info\DTLSSocket.egg-info
    writing dependency_links to pip-egg-info\DTLSSocket.egg-info\dependency_links.txt
    writing requirements to pip-egg-info\DTLSSocket.egg-info\requires.txt
    writing pip-egg-info\DTLSSocket.egg-info\PKG-INFO
    writing top-level names to pip-egg-info\DTLSSocket.egg-info\top_level.txt
    writing manifest file 'pip-egg-info\DTLSSocket.egg-info\SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'pip-egg-info\DTLSSocket.egg-info\SOURCES.txt'
    writing manifest file 'pip-egg-info\DTLSSocket.egg-info\SOURCES.txt'
  Source in c:\temp\pip-build-z2pekt7c\dtlssocket has version 0.1.4, which satisfies requirement DTLSSocket from https://pypi.python.org/packages/3a/c1/d1f41b90a58fcba9202bf649be117abbed884176260302fed5e1144f09f6/DTLSSocket-0.1.4.tar.gz#md5=bcef26a5320348905e3df61d65e983c3
Requirement already satisfied: Cython==0.27.2 in c:\python35-32\lib\site-packages (from DTLSSocket)
Installing collected packages: DTLSSocket
  Running setup.py install for DTLSSocket ...     Running command c:\python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Temp\\pip-build-z2pekt7c\\DTLSSocket\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Temp\pip-hy3omw78-record\install-record.txt --single-version-externally-managed --compile
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.5
    creating build\lib.win32-3.5\DTLSSocket
    copying DTLSSocket\__init__.py -> build\lib.win32-3.5\DTLSSocket
    copying DTLSSocket\DTLSSocket.py -> build\lib.win32-3.5\DTLSSocket
    running build_ext
    Running: autoconf
    error: [WinError 2] The system cannot find the file specified
error
Cleaning up...
  Removing source in C:\Temp\pip-build-z2pekt7c\DTLSSocket
Command "c:\python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Temp\\pip-build-z2pekt7c\\DTLSSocket\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Temp\pip-hy3omw78-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Temp\pip-build-z2pekt7c\DTLSSocket\
Exception information:
Traceback (most recent call last):
  File "c:\python35-32\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "c:\python35-32\lib\site-packages\pip\commands\install.py", line 342, in run
    prefix=options.prefix_path,
  File "c:\python35-32\lib\site-packages\pip\req\req_set.py", line 784, in install
    **kwargs
  File "c:\python35-32\lib\site-packages\pip\req\req_install.py", line 878, in install
    spinner=spinner,
  File "c:\python35-32\lib\site-packages\pip\utils\__init__.py", line 707, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command "c:\python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Temp\\pip-build-z2pekt7c\\DTLSSocket\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Temp\pip-hy3omw78-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Temp\pip-build-z2pekt7c\DTLSSocket\

@ggravlingen
Copy link
Contributor

Can you please try again after installing autoconf?

@joggs
Copy link

joggs commented Nov 11, 2017

I have tried it from cygwin with autoconf installed and also tried with some old autoconf gnu setup and getting the result pasted above

@joggs
Copy link

joggs commented Nov 11, 2017

I think it has to do with that pip removes the tempdir, ie /pip-build-z2pekt7c/ after a failed build, so the error comes a bit earlier in the chain

@joggs
Copy link

joggs commented Nov 11, 2017

if i modify the command, it seems like the pyx file is missing... Maybe error in the cythonization?

python.exe -u -c "import setuptools, tokenize;__file__='C:\\dtlssocket\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Temp\install-record.txt --single-version-externally-managed --compile
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\dtlssocket\setup.py", line 56, in <module>
    undef_macros = [ "NDEBUG" ],
  File "C:\Python35-32\lib\site-packages\Cython\Build\Dependencies.py", line 920, in cythonize
    aliases=aliases)
  File "C:\Python35-32\lib\site-packages\Cython\Build\Dependencies.py", line 800, in create_extension_list
    for file in nonempty(sorted(extended_iglob(filepattern)), "'%s' doesn't match any files" % filepattern):
  File "C:\Python35-32\lib\site-packages\Cython\Build\Dependencies.py", line 125, in nonempty
    raise ValueError(error_msg)
ValueError: 'DTLSSocket/dtls.pyx' doesn't match any files

@chiversc
Copy link
Author

Success. Tradfri working with home assistant on PI !
Strangely the key to this seemed to be installing Python twice, as the first install seemed to miss some file, then installing down level yarl 0.13.0.
Sorry I am not knowledgeable enough to know why this worked

@sholzmayer
Copy link

After a few hours of waisting my time, the manual installation of pytradfri worked for me. You need step one of the Readme at pytradfri's repo.

@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@balloobbot
Copy link

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍

@home-assistant home-assistant locked and limited conversation to collaborators Jul 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants