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

Plugwise Forum about Plugwise devices and the Source software.

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

Postby SevenW » Wed Jan 21, 2015 8:30 am

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
SevenW
Starting Member
Starting Member
 
Posts: 25
Joined: May 2012

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

Postby Stephan296 » Sat Jan 24, 2015 8:44 pm

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)
Stephan296
Starting Member
Starting Member
 
Posts: 10
Joined: May 2011

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

Postby SevenW » Sun Jan 25, 2015 8:46 pm

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
SevenW
Starting Member
Starting Member
 
Posts: 25
Joined: May 2012

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

Postby Stephan296 » Sun Jan 25, 2015 10:27 pm

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
Stephan296
Starting Member
Starting Member
 
Posts: 10
Joined: May 2011

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

Postby SevenW » Tue May 26, 2015 10:11 pm

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
SevenW
Starting Member
Starting Member
 
Posts: 25
Joined: May 2012

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

Postby Bwired » Wed Jul 15, 2015 10:28 pm

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
User avatar
Bwired
Administrator
Administrator
 
Posts: 5294
Joined: March 2006
Location: Netherlands

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

Postby dorenberg » Fri Jul 24, 2015 10:33 am

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?
dorenberg
Starting Member
Starting Member
 
Posts: 7
Joined: August 2012

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

Postby rron » Fri Jul 31, 2015 11:17 am

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: July 2015

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

Postby rron » Fri Aug 07, 2015 12:26 pm

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?
rron
Starting Member
Starting Member
 
Posts: 5
Joined: July 2015

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

Postby Bwired » Sat Aug 08, 2015 10:27 am

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
User avatar
Bwired
Administrator
Administrator
 
Posts: 5294
Joined: March 2006
Location: Netherlands

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

Postby rron » Sat Aug 08, 2015 10:54 am

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 " ,"
rron
Starting Member
Starting Member
 
Posts: 5
Joined: July 2015

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

Postby SevenW » Fri Aug 14, 2015 9:38 am

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: 25
Joined: May 2012

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

Postby SevenW » Fri Aug 14, 2015 9:41 am

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
SevenW
Starting Member
Starting Member
 
Posts: 25
Joined: May 2012

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

Postby rron » Fri Aug 14, 2015 1:06 pm

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: July 2015

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

Postby rron » Sat Aug 15, 2015 10:43 am

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.
rron
Starting Member
Starting Member
 
Posts: 5
Joined: July 2015

PreviousNext

Return to Plugwise Forum

Who is online

Users browsing this forum: No registered users and 1 guest