SevenW/Plugwise-2-py

Installation manual not working for Ubuntu 16.04

gruijter opened this issue · 16 comments

First of all: Great work and good documentation! I would really like to use Plugwise-2-py, so I have tried to install it using the described process. I first tried under Windows 10, but I get an error when running python get-pip.py (yes, python 3.5 is installed correctly). So then I tried under Ubuntu 16.04. There I run into multiple rights issues when installing and trying to run. I'm a noob in both python and Linux/Ubuntu, but I think your manual describes the installation for a raspberry Pi. Could you make a noob-proof installation description that works for Ubuntu 16.04?

Much appreciated !

So some more details on the issues I run into when installing:

pw@ubuntu:~$ sudo python3 get-pip.py
[sudo] password for pw: 
The directory '/home/pw/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

ubuntu 32-2016-09-04-10-56-25

Edit: I found out that if I use python 2.7 (in stead of 3.5) all dependencies are installed.

I see three issues:

  1. get-pip.py cannot access /home/pw
  2. the python module to use the serial ports does not find a proper version
  3. the plugwise2py conf files are pointing to /home/pi in places, while it should be /home/pw, as pw is your user.

problem 1 seems not to be fatal.
problem 2 needs to be resolved. I will look into that
problem 3 looks for the moment simple, but we need a fix for 2 first.

problem 1:
Can you first try to run it with python in stead of python3?
And also use the -H flag as suggested in the error message?

so:
sudo -H python get-pip.py

problem 2 is "collateral damage" from installing pip with python3. It tries to install a python3 version of pyserial, which may have been renamed.

Let me know if you can remove pip for python3, and get it installed with python (2.7)

Yes, installed with python 2.7 and -H flag. But when I run plugwise2py i get the permission denied /home/pi as shown in image above. Also trying to run the webbrowser results in an error as shown above

Did pyserial install well?
your user name is pw, and not pi.
Therefore edit hostconfig file and replace /home/pi with /home/pw

In file config/pw-hostconfig.json:

{"permanent_path": "/home/pi/datalog", "tmp_path": "/tmp", "log_path": "/home/pi/pwlog", "serial": "/dev/ttyUSB0"}

should become

{"permanent_path": "/home/pw/datalog", "tmp_path": "/tmp", "log_path": "/home/pw/pwlog", "serial": "/dev/ttyUSB0"}

YES! Definitely making progress now. I get logs that make sense. I will now try to configure further. Thx for your help so far!

Edit: I messed up my Ubuntu install with all that I tried, so I have to reinstall Ubunt :). But I did manage to get the webserver running. And it really looks good! I think I now know how to install it, and will start from scratch again...
ubuntu 32-2016-09-04-16-56-06
ubuntu 32-2016-09-04-16-55-58

Ok, reinstalled ubuntu and the whole shebang. Got the webinterface running and configured the macaddresses etc. But I do not get any data. In the PWlogger it keeps saying:
2016-09-04 19:37:48,648 - pw-logger - INFO - Reconnecting to serial device
and the PWcommunication log only has one item: 2016-09-04 19:36:37,459 - pwcomm - logging started

In the config I used "serial": "/dev/ttyUSB0"
this should be the right one I think. When I use $ dmesg | grep tty I get:

[    0.000000] console [tty0] enabled
[    1.323928] 00:01: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[   13.175232] usb 3-1: FTDI USB Serial Device converter now attached to ttyUSB0

Any insights you have on this issue? Thx!

maybe it is about privileges for /dev/ttyUSB0. Can you try
sudo adduser pw dialout

assuming pw is still your username. Maybe you have to reboot after this.

Yes, that did it! :)

Thanks for helping out a noob!

Ok, so I let it run for an hour or two. This is really a great job! Nice webinterface and I think I will play around with the mqtt interface.

But.... I get intermittent weird readings. I know I have a 'difficult' network with 12 circles in a concrete house. But with the source software the readings were always stable. And I'm running it from the same pc, so no change in hardware or location or the usb plug. Is there any chance you can further improve readings from weak networks?

@gruijter please open a separate issue for the intermittent weird readings. Thanks.