Page 2 of 4

Re: Plugwise-2-py - an evolution of earlier python/linux work

Posted: Wed Jan 21, 2015 9:30 am
by SevenW
nohup always gives such a message. Can you check whether Plugwise-2-py starts by seeing whether it generates logging:

Code: Select all

cat /tmp/pwout.log
Startup error messages should be in there.

Also regular logging is produced in /var/log:

Code: Select all

cat /var/log/pw-logger.log
Let me know what you can find on the startup failure.

SevenW

Re: Plugwise-2-py - an evolution of earlier python/linux work

Posted: Sat Jan 24, 2015 9:44 pm
by Stephan296
This is the log:

Code: Select all

rsync: link_stat "/home/pi/datalog/2015/pwact/pwact-2015-01-24*.log" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1070) [sender=3.0.9]
Traceback (most recent call last):
  File "Plugwise-2.py", line 1296, in <module>
    main=PWControl()
  File "Plugwise-2.py", line 149, in __init__
    sconf = json.load(open(self.staticconfig_fn))
  File "/usr/lib/python2.7/json/__init__.py", line 278, in load
    **kw)
  File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 365, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 383, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Traceback (most recent call last):
  File "Plugwise-2.py", line 65, in <module>
    cfg = json.load(open("config/pw-hostconfig.json"))
  File "/usr/lib/python2.7/json/__init__.py", line 278, in load
    **kw)
  File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 365, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 381, in raw_decode
    obj, end = self.scan_once(s, idx)
ValueError: Expecting , delimiter: line 1 column 131 (char 131)
Traceback (most recent call last):
  File "Plugwise-2.py", line 65, in <module>
    cfg = json.load(open("config/pw-hostconfig.json"))
  File "/usr/lib/python2.7/json/__init__.py", line 278, in load
    **kw)
  File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 365, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 381, in raw_decode
    obj, end = self.scan_once(s, idx)
ValueError: Expecting , delimiter: line 1 column 131 (char 131)

Re: Plugwise-2-py - an evolution of earlier python/linux work

Posted: Sun Jan 25, 2015 9:46 pm
by SevenW
The program has difficulties parsing two of the configuration files. Please check the following files very carefully. You may have accidentally deleted a double quote for a string value, or missed a comma.

Code: Select all

config/pw-conf.json
config/pw-hostconfig.json
If you can not find anything wrong, please post the config file here, or mail me the file (PM or info at sevenwatt dot com)

SevenW

Re: Plugwise-2-py - an evolution of earlier python/linux work

Posted: Sun Jan 25, 2015 11:27 pm
by Stephan296
I missed a comma (my bad) Sorry.

But now the next error:

Code: Select all

rsync: link_stat "/home/pi/datalog/2015/pwact/pwact-2015-01-25*.log" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1070) [sender=3.0.9]
Traceback (most recent call last):
  File "Plugwise-2.py", line 1296, in <module>
    main=PWControl()
  File "Plugwise-2.py", line 149, in __init__
    sconf = json.load(open(self.staticconfig_fn))
  File "/usr/lib/python2.7/json/__init__.py", line 278, in load
    **kw)
  File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 365, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 383, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

Re: Plugwise-2-py - an evolution of earlier python/linux work

Posted: Tue May 26, 2015 11:11 pm
by SevenW
I have made a major update to the web application of Plugwise-2-py.

Changes:
  • Added exception handling to catch broken connections due to hibernating web clients. The web server could become unresponsive.
  • Added support for SSL (https) and password protection.
  • Reconnecting websockets. Power reading updates start automatically after hibernate of web client.
  • MQTT-connection password support. Thanks Anton04.
See (as always)
https://github.com/SevenW/Plugwise-2-py
sevenwatt.com/main/plugwise-2-py-with-r ... ebsockets/

SevenW

Re: Plugwise-2-py - an evolution of earlier python/linux work

Posted: Wed Jul 15, 2015 11:28 pm
by Bwired
Installed this today, i must say this is best (reading of the plugwise stick) solution i have seen!
also the Mqqt options is working perfect.
im testing the options now.......
Many thanks!

Re: Plugwise-2-py - an evolution of earlier python/linux work

Posted: Fri Jul 24, 2015 11:33 am
by dorenberg
I am trying to install it and it seems that I have the same problems as in this thread. Will continue this evening to troubleshoot this.

Did someone already succeeded in the combination of plugwise-2-py --> MQTT --> Domoticz?

Re: Plugwise-2-py - an evolution of earlier python/linux work

Posted: Fri Jul 31, 2015 12:17 pm
by rron
SevenW wrote:nohup always gives such a message. Can you check whether Plugwise-2-py starts by seeing whether it generates logging:

Code: Select all

cat /tmp/pwout.log
Startup error messages should be in there.

Also regular logging is produced in /var/log:

Code: Select all

cat /var/log/pw-logger.log
Let me know what you can find on the startup failure.

SevenW
Hello,
Perhaps you can give me a hint because I'm stuck. I did all the above but when do

Code: Select all

cat /var/log/pw-logger.log
it will give there's no such file or directory.
So i looked again at config files again but I can't find it. I also copied the files from dorenberg and ajusted it but still the same.

Re: Plugwise-2-py - an evolution of earlier python/linux work

Posted: Fri Aug 07, 2015 1:26 pm
by rron
I'm making a little progress but i'm still not able to see my circles.

Code: Select all

cat /tmp/pwout.log


The error is now :

Code: Select all

rsync: link_stat "/home/pi/datalog/2015/pwact/pwact-2015-08-07*.log" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1070) [sender=3.0.9]
True
Traceback (most recent call last):
  File "Plugwise-2.py", line 1306, in <module>
    main=PWControl()
  File "Plugwise-2.py", line 151, in __init__
    sconf = json.load(open(self.staticconfig_fn))
  File "/usr/lib/python2.7/json/__init__.py", line 278, in load
    **kw)
  File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 365, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 383, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
I did check the pw-hostconfig, pw-control and pw-conf but I can't see what's wrong.
Any help please?

Re: Plugwise-2-py - an evolution of earlier python/linux work

Posted: Sat Aug 08, 2015 11:27 am
by Bwired
Sevenw is busy with some updates, i also had some problems with getting it to run.
I need to run the command with "sudo" in front of it, Also check all the folder rights. In my case it was Root sometimes?
I had to changed this to PI
Check this.....

Ps: please dont quote everything in your postings

Re: Plugwise-2-py - an evolution of earlier python/linux work

Posted: Sat Aug 08, 2015 11:54 am
by rron
There's some progress in the installation. I think one off the major problems was that I have used notepad++ for editting the config files. I ' m using a different edittor and it's working but still you have to pay attention for the " ,"

Re: Plugwise-2-py - an evolution of earlier python/linux work

Posted: Fri Aug 14, 2015 10:38 am
by SevenW
rron, did you succeed in getting it running? Editing JSON is painful. A JSON validator like http://jsonlint.com/ can help checking and findin errors.

Let me know how it works.

Regards,
SevenW

Re: Plugwise-2-py - an evolution of earlier python/linux work

Posted: Fri Aug 14, 2015 10:41 am
by SevenW
Currently I see two issues in Plugwise-2-py, which I will be addressing the coming weeks:
- file priviliges on the raspberry pi, for config and log files.
- Plugwise-2-web.py does not reconnect to MQTT when MQTT was not running when Plugwise-2-web started.

SevenW

Re: Plugwise-2-py - an evolution of earlier python/linux work

Posted: Fri Aug 14, 2015 2:06 pm
by rron
I did succeed to get it working with the files of dorenberg. I did some edditing and then it worked but still when i, m deleting some plugs i get problems. So i will try your advice for the edditor. I keep you informed.

Re: Plugwise-2-py - an evolution of earlier python/linux work

Posted: Sat Aug 15, 2015 11:43 am
by rron
With the json validator i have been successfull. This is vey handy :D
Next step is try to put the data in domoticz with MQTT.