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

Plugwise Forum about Plugwise devices and the Source software.
SevenW
Starting Member
Starting Member
Posts: 26
Joined: Tue May 29, 2012 10:04 am
Contact:

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

Post 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
Stephan296
Starting Member
Starting Member
Posts: 14
Joined: Tue May 17, 2011 4:23 pm

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

Post 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)
SevenW
Starting Member
Starting Member
Posts: 26
Joined: Tue May 29, 2012 10:04 am
Contact:

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

Post 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
Stephan296
Starting Member
Starting Member
Posts: 14
Joined: Tue May 17, 2011 4:23 pm

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

Post 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
SevenW
Starting Member
Starting Member
Posts: 26
Joined: Tue May 29, 2012 10:04 am
Contact:

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

Post 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
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

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

Post 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!
http://www.bwired.nl Online Home, Domotica, Home Automation. Weblog. http://blog.bwired.nl
dorenberg
Starting Member
Starting Member
Posts: 7
Joined: Fri Aug 17, 2012 10:45 pm

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

Post 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?
rron
Starting Member
Starting Member
Posts: 5
Joined: Fri Jul 31, 2015 12:06 pm

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

Post 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.
rron
Starting Member
Starting Member
Posts: 5
Joined: Fri Jul 31, 2015 12:06 pm

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

Post 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?
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

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

Post 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
rron
Starting Member
Starting Member
Posts: 5
Joined: Fri Jul 31, 2015 12:06 pm

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

Post 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 " ,"
SevenW
Starting Member
Starting Member
Posts: 26
Joined: Tue May 29, 2012 10:04 am
Contact:

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

Post 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
SevenW
Starting Member
Starting Member
Posts: 26
Joined: Tue May 29, 2012 10:04 am
Contact:

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

Post 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
rron
Starting Member
Starting Member
Posts: 5
Joined: Fri Jul 31, 2015 12:06 pm

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

Post 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.
rron
Starting Member
Starting Member
Posts: 5
Joined: Fri Jul 31, 2015 12:06 pm

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

Post 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.
Post Reply

Return to “Plugwise Forum”