hollie / xpl-perl

Perl modules for the xPL Home Automation Protocol
8 stars 4 forks source link

CRC.pm error on ARM #3

Closed BasvanH closed 12 years ago

BasvanH commented 12 years ago

Hi Lieven,

I’m busy integrating your xpl-plugwise work on a QNAP NAS (with ARM cpu). I think I’m almost there, but I’m bumping on an error when starting the xpl-plugwise. The perl environment meets the prerequisites and XPL-Perl is compiled. I start the xpl-hub and xpl-logger and then I start the client like “/opt/bin/xpl-plugwise –verbose –plugwise-tty /dev/ttyUSB0”. Then I get this output: Listening on 192.168.1.253:59326 Sending on 192.168.1.255 Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. WR>STICK: 000AB43C

When I want to list all the connected cicles, the xpl-plugwise outputs this: Use of uninitialized value $address in substr at /opt/lib/perl5/site_perl/5.10.0/xPL/Dock/Plugwise.pm line 954. Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. WR>STICK: 0026000D6F0000000000B034

I get no xpl-stat back. (hub see’s everything’s connected, xpl-logger see’s the request going by). So I think the CRC.pm is the problem. Do you have any idea’s what could be the cause?

This is the part round line 264 of CRC.pm: sub crc { my ($message,$width,$init,$xorout,$refout,$poly,$refin,$cont) = @_; _crc($message,$width,$init,$xorout,$refin,$refout,$cont,_tabinit($width,$poly,$refin)); <<<THIS }

Thanks in advance (have a great 5th of May liberation day).

Best regards, Bastiaan

BasvanH commented 12 years ago

Hi Lieven,

via your website you asked me to do a perl trace on the CRC module and capture the parameter uninitialized. I'm not very familair with Perl debugging, so could you give me some direction perhaps?

Thanks and regards, Bastiaan

hollie commented 12 years ago

Hi Bastiaan,

the most easy way is to add a

print "$variable\n";

statement just in front of the function call. If you do this for all variables that are passed to the function then you should get an error on the line where you try to print the variable and then you know who the culprit is.

Kind regards, Lieven.

BasvanH commented 12 years ago

Hi Lieven,

I got it solved. I used the cpan of the IPKG repository, but it was kind of out dated. So I updated it and run a re-install of all modulles. Now I can get readings out of the plugwise network. So thats very great!

I stil do have the CRC.pm errors on the xpl-plugwise side. Don't know if they can be safely ignored?

at /opt/lib/perl5/site_perl/5.10.0/xPL/IOHandler.pm line 213 Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. WR>STICK: 0023000D6F0000B833F40F58 RX<STICK: 0000010C00C11F89 Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. RX<STICK: 0000010C00E1B52F Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. xPL::Dock->plugwise_process_response: Received response code with error: 0000010C00E1

at /opt/lib/perl5/site_perl/5.10.0/xPL/IOHandler.pm line 213 Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. WR>STICK: 0023000D6F00003454556B6D RX<STICK: 0000010D00C1785D Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. RX<STICK: 0000010D00E1D2FB Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. xPL::Dock->plugwise_process_response: Received response code with error: 0000010D00E1

at /opt/lib/perl5/site_perl/5.10.0/xPL/IOHandler.pm line 213 Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. WR>STICK: 0023000D6F0000B833F40F58 RX<STICK: 0000010E00C1D20C Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. RX<STICK: 0000010E00E178AA Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. xPL::Dock->plugwise_process_response: Received response code with error: 0000010E00E1

at /opt/lib/perl5/site_perl/5.10.0/xPL/IOHandler.pm line 213 Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. WR>STICK: 0023000D6F0000B833F40F58 RX<STICK: 0000010F00C13CDE Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. RX<STICK: 0000010F00E19678 Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. xPL::Dock->plugwise_process_response: Received response code with error: 0000010F00E1

at /opt/lib/perl5/site_perl/5.10.0/xPL/IOHandler.pm line 213 Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. WR>STICK: 0023000D6F00004B96C28065 RX<STICK: 0000011000C1A97D Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. RX<STICK: 00240110000D6F00004B96C20C0518D60004EE7001850000044001074DCCDB7B021C68 Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. PLUGWISE: Received status reponse for circle 4B96C2: (on, logaddr=5582, datetime=201205050958) Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. WR>STICK: 0048000D6F00004B96C20004DC408780 RX<STICK: 0000011100C1032C Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. RX<STICK: 00490111000D6F00004B96C20C0438F40000725E0C0439300000727F0C04396C0000726E0C0439A8000072510004DC403778 Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. PLUGWISE: Historic energy for 4B96C2[5000] is 0.017 kWh on 201204110300 Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. WR>STICK: 0048000D6F00004B96C20004DC480688 RX<STICK: 0000011200C1EDFE Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. RX<STICK: 00490112000D6F00004B96C20C0439300000727F0C04396C0000726E0C0439A8000072510C0439E4000070BF0004DC483A65 Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. PLUGWISE: Historic energy for 4B96C2[5001] is 0.017 kWh on 201204110400 Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. WR>STICK: 0048000D6F00004B96C20004DC90F1DC RX<STICK: 0000011300C147AF Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. RX<STICK: 00490113000D6F00004B96C20C043B4C000067110C043B88000067040C043BC4000066F00C043C00000066C50004DC90D4AB Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. PLUGWISE: Historic energy for 4B96C2[5010] is 0.016 kWh on 201204111300 RX<STICK: 004FFFFE000D6F0000C3AAAD03550F Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. xPL::Dock->plugwise_process_response: Received unknown response: '004FFFFE000D6F0000C3AAAD03' at /opt/lib/perl5/site_perl/5.10.0/xPL/IOHandler.pm line 213 RX<STICK: 01052137000D6F0000C3AAAD6A5860B413E9 Use of uninitialized value in subroutine entry at /opt/lib/perl5/site_perl/5.10.0/arm-linux/Digest/CRC.pm line 264. xPL::Dock->plugwise_process_response: Received unknown response: '01052137000D6F0000C3AAAD6A5860B4' at /opt/lib/perl5/site_perl/5.10.0/xPL/IOHandler.pm line 213

Regards, Bastiaan

hollie commented 12 years ago

Hello Bastiaan,

good news that you can retrieve values from the plugs. What version of the firmware are you running, because the 'unknown response' messages you get at the end of the log are new to me.

Kind regards, Lieven.

BasvanH commented 12 years ago

Hi Lieven,

Most of my plugs are fw dated 2011-05-13, some are 2011-06-27, and i got a Switch, Sense and Scan module also. Perhaps those sensor module are giving these 'unknown response' messages?

Regards, Bastiaan

hollie commented 12 years ago

Hello Bastiaan,

aha: I have only circles, so probably the 'unknown' messages indeed originate from the switch/sense/scan modules.

If you are able to decypher the messages, we can add support to the xpl-plugwise module for them.

Kind regards, Lieven.

Op 5-mei-2012, om 13:37 heeft BasvanH het volgende geschreven:

Hi Lieven,

Most of my plugs are fw dated 2011-05-13, some are 2011-06-27, and i got a Switch, Sense and Scan module also. Perhaps those sensor module are giving these 'unknown response' messages?

Regards, Bastiaan


Reply to this email directly or view it on GitHub: https://github.com/hollie/xpl-perl/issues/3#issuecomment-5526389

BasvanH commented 12 years ago

Hi Lieven,

Well, I started the project because i wanted to develop on PHP, and not the builtin webserver of plugwise. I'm kind of lucky that I've managed to get the xPL working on my NAS. I'm ok with PHP and MySQL. But perl and reverse enginering of the plugwise protocol via RS232 ext is not my cup of tea.

I take it you are dutch to, so if you want I can capture some stuf for you to analyze. We can mail if you want b.vanhaastrecht( a )gmail.com . Otherwise goedemiddag :-)

Thanks for the work, Bastiaan