Page 7 of 8

Plugwise and Linux

Posted: Sat Jul 25, 2009 11:48 am
by xAPPO
Does anyone know if it's possible to associate two stick devices onto one Plugwise ZigBee network ?

...or perhaps a Windows software application that will create a virtual serial port that could be used to receive/inject data into the existing USB/serial stream from an external application (managing potential collisions)

K

Plugwise and Linux

Posted: Sat Aug 08, 2009 12:28 am
by sirhc
Beste allen,

Kan iemand mij het phyton script van Maarten mailen? De server van Maarten lijkt eruit te liggen. Alvast hartelijk bedankt.

Plugwise and Linux

Posted: Sat Aug 08, 2009 2:16 am
by Snelvuur
You could also check the domotiga.nl code, if you need examples. Please also be aware to keep text in english.

// Erik (binkey.nl)

Plugwise and Linux

Posted: Sat Aug 08, 2009 11:56 am
by paradoxi
Hello,

received my starters kit, it contains a classic usb Stick.
I would like to use in linux, but i can't understand how to use a USB Stick with classic usb -> serial convertor (http://www.usbserial.com/765288.html).

Please can you give me more information ?

Tks

Plugwise and Linux

Posted: Sat Aug 08, 2009 12:08 pm
by Pieterpaul
Why would you want to convert it to serial? Doesn't your PC have USB ports? Linux comes with support for USB and if I'm not mistaken, both Maarten's demo code and Domotiga support Plugwise on USB.

/PP

Plugwise and Linux

Posted: Sat Aug 08, 2009 12:22 pm
by j.hoekstra
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by paradoxi</i>
<br />Hello,

received my starters kit, it contains a classic usb Stick.
I would like to use in linux, but i can't understand how to use a USB Stick with classic usb -> serial convertor (http://www.usbserial.com/765288.html).

Please can you give me more information ?

Tks
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
I didn't need anything special, plugged in the stick, it was recognized by a recent kernel as a FTDI-device with /dev/ttyUSB0 and that was needed to configure domotiga to find the devices. I build the network before that via the source-software though.

Plugwise and Linux

Posted: Sat Aug 08, 2009 2:32 pm
by sirhc
Hello,

@snelvuur, indeed very stupid writing the question in dutch. My question was if it's possible somebody emails me the phyton script Maarten wrote. His website seems to be down at the moment.

Regards,

Plugwise and Linux

Posted: Sun Aug 09, 2009 5:46 pm
by t006
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by sirhc</i>
<br />Hello,

@snelvuur, indeed very stupid writing the question in dutch. My question was if it's possible somebody emails me the phyton script Maarten wrote. His website seems to be down at the moment.

Regards,
<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">

You can find a copy on:
http://files.penguin-powered.org/plugwi ... pol0.2.tgz
http://files.penguin-powered.org/plugwi ... ources.tgz

Plugwise and Linux

Posted: Fri Aug 14, 2009 12:06 am
by sirhc
Thanks for the info guys

Plugwise and Linux

Posted: Sat Oct 24, 2009 2:42 pm
by daromer
Hi

Im running 64bit. How do i compile that POL to fit my needs?

I must say its an interesting thread. Im also trying to look into Domotiga. Installing a new wirtual machine to test it out. I had hoped there was a master process you could run in the background but dosnt look like that. But hey. I havent had time to chekc it out yet.

Plugwise and Linux

Posted: Sat Oct 24, 2009 3:08 pm
by j.hoekstra
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by daromer</i>
<br />Hi

Im running 64bit. How do i compile that POL to fit my needs?

I must say its an interesting thread. Im also trying to look into Domotiga. Installing a new wirtual machine to test it out. I had hoped there was a master process you could run in the background but dosnt look like that. But hey. I havent had time to chekc it out yet.


<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
For domotiga I never needed to install any driver, the stick was recognized by linux and only neede to point domotiga in the right direction.

Plugwise and Linux

Posted: Sun Oct 25, 2009 2:59 pm
by daromer
j.hoekstra: Driver? I only want to know how i recompile that POL to work on 64bit since tha bin you can download was built for 32 bits.

Plugwise and Linux

Posted: Sun Oct 25, 2009 4:35 pm
by j.hoekstra
I plugged the stick in, it was recognized by an in-kernel ftdi(?) driver and in Domotiga I could just select the USB-device and control my plugs.
Mind you, this is using domotiga(www.domotiga.nl)

Plugwise and Linux

Posted: Tue Oct 27, 2009 1:59 am
by daromer
Traceback (most recent call last):
File "pol.py", line 150, in <module>
main()
File "pol.py", line 134, in main
print plugwise.GetPowerInfo()
File "pol.py", line 48, in GetPowerInfo
self.GetCalibrationInfo()
File "pol.py", line 29, in GetCalibrationInfo
self.gain_a = self.hexToFloat(result[0:8])
File "pol.py", line 69, in hexToFloat
return struct.unpack('f', bits)[0]
File "/usr/lib64/python2.5/struct.py", line 87, in unpack
return o.unpack(s)
struct.error: unpack requires a string argument of length 4


Running the pol.py on a 64bit machine and trying to sort out the watts. the on and off works. Gonna look into it but if anyone have an idea please let me know.

Plugwise and Linux

Posted: Tue Oct 27, 2009 2:13 am
by daromer
Changed some in the source.

66 intval = int(hexstr, 16)
67 bits = struct.pack('I', intval) <- Changed to I instead of L
68 return struct.unpack('f', bits)[0]

Looks like the output is kinda ok. but i dont know and to damn tired to look more into it atm.