I'm afraid I'm struggling with xap messages again.
I'm feeding temperature data into xap-serial and I can see the xap messages on xfx viewer as follows
xap-header
{
v=12
hop=1
uid=FF00D500
class=Serial.Comms
source=dbzoo.livebox.Serial
}
Serial.Received
{
port=/dev/ttyUSB1
data=20.0
}
Unfortunately when I apply a filter like:
f:add ("xap-header","source","dbzoo.livebox.Serial")
f:add("xap-header","class","Serial.Comms")
and then in my callback function I try to use
Member for
16 years 10 monthsI use something like this in
Member for
15 years 1 monthBrettThanks again for your
Brett
Thanks again for your help here. I try not to just lauch questions onto the forum without trying quite hard to understand what's going on. One thing that I have learned over the last couple of months is that Lua Linux and C can be very particular about the case (upper or lower) of letters in variables and commands etc. So I was very careful when reading the messages in xfx viewer to take careful note of the exact spelling and capitalisation of the characters.
It would seem however, that in this instance all lower case seems to do the trick. It looks like I was pretty close with my attempts but that I was defeated by the small matter of capitalisation. I had tried many, many different ways of extracting the data and nothing seemed to work even though I thought I must be near.
Here's what seems to work in the end:
local f = xap.Filter()
f:add("xap-header", "source", "dbzoo.livebox.serial")
f:add("xap-header","class","serial.comms")
There have been quite a few times when I would probably have had to give up if you had not come to my rescue. So please be assured that I am VERY grateful for your expert help.
I can now read the temperature from my (Heath-Robinson) portable, wireless, temperature sensor and use the information to more finely tune my heating system.
Allan
Member for
16 years 10 monthsYou should also include PORT
You should also include PORT otherwise if you ever attach a jeenode your program is going to get bombed with serial message from other sources. I know you only have one at the moment but its best to cover your bases.
I thought I made a change in that API call to be case agnostic in builds >302 ? What build are you on?
http://code.google.com/p/livebox-hah/source/detail?r=364
Brett
Member for
15 years 1 monthI'm using 302/3.4
Thanks Brett. I'll have a go at including the port, it will probably save me much grief at some stage in the future.
I'm using build 302/3.4 at the moment. (Still struggilng with no landline or Broadband internet connection.)