beanz/xpl-perl — Issue #7: Problem with chacon module and rfxcom
Author: webextension
Created: 2011-10-19 21:52:53+00:00
State: open

Hello,
First of all, it's important to say that job is amazing! Thank you very much for this project !!
But, I have a problem since I flashed my RFXLAN TX/RX to work with the xplperl firmware provide bu RFXCOM... :-(
I would like to expose you my problem, because it's weird !!
Every X10/oregon scientific events are received in the XPL-HUB, even chacon events.
Chacon events ar recognized by a AC.BASIC SCHEMA, but since I flashed my RFXCOM, every chacon events cannot be catch into my xpl callback ...
Here you will have an explanation of what I have done in order to detect this bug... Maybe that's my mistake .... in this case i will apologize for this useless issue...

# My xpl callback catch only AC.BASIC schema from the xpl-hub :
$xpl->add_xpl_callback(id => "logger",
self_skip => 0, targetted => 0,
callback => \&acmsg,
filter => {
message_type => 'xpl-trig',
class => 'ac',
class_type => 'basic',
});

# Run the main loop
$xpl->main_loop();

# (***) The callback to log the incoming messages : I display every events with the name of the field and the field itself
sub acmsg {
my %p = @_;
my $msg = $p{message};
my %info;

# Put field<->value relation in hash-table. Do not put fields with empty value in hash
foreach my $field ($msg->body_fields) {

if (defined $msg->$field) {
$info{$field} = $msg->$field;

print $field;
print " -> ";
print $info{$field};
print " | ";
}
}
print "\n";

return 1;
};

# The xpl-logger displays every events
xpl-logger -i lo -v -body
...
# This is a oregon sensor.
127.0.0.1:47517 [xpl-trig/sensor.basic: rfxcom-lan.0004a31f625d -> * - th1 0xcb01[temp]=17.7]
sensor.basic
{
device=th1 0xcb01
type=temp
current=17.7
units=c
}
127.0.0.1:47517 [xpl-trig/sensor.basic: rfxcom-lan.0004a31f625d -> * - th1 0xcb01[humidity]=59]
sensor.basic
{
device=th1 0xcb01
type=humidity
current=59
description=normal
}
127.0.0.1:47517 [xpl-trig/sensor.basic: rfxcom-lan.0004a31f625d -> * - th1 0xcb01[battery]=100]
sensor.basic
{
device=th1 0xcb01
type=battery
current=100
}
...
# This is my Chacon sensor.
# Since I flashed the firmware, chacon events is detected as a 'ac' class module as described in http://www.rfxcom.com/documents/RFXCOM%20implementation%20xPL.pdf
# Before I flashed the firmware Chacon events was detected as a "homeeasy" module
# Chacon signals are detected but xpl-perl cannot display them anymore !! I have a blank line now !!!
127.0.0.1:47517 [xpl-trig/ac.basic: rfxcom-lan.0004a31f625d -> *]
ac.basic
{
address=0x050a836
unit=10
command=off
}

#This is the output of my xpl-perl script described here (***)
xpl-trig-ac.basic -i lo -v
Listening on 127.0.0.1:44693
Sending on 127.0.0.1
interval -> 5 | port -> 44693 | remote_ip -> 127.0.0.1 | <= Information about the connection to the hub
<= When I use my chacon module I have a blank line and I can't see
<= When I use my chacon module I have a blank line and I can't see
device -> th1 0x6a01 | type -> temp | current -> 18.5 | units -> c | <= First information about my oregon sensor
device -> th1 0x6a01 | type -> humidity | current -> 60 | <= First information about my oregon sensor
device -> th1 0x6a01 | type -> battery | current -> 100 | <= First information about my oregon sensor
<= When I use my chacon module I have a blank line and I can't see
<= When I use my chacon module I have a blank line and I can't see