Hi,
I'm having trouble collecting xap messages to pachube from remote system.
One part of my system uses a joggler(ubuntu) connected with USB/RS232 to my resol solar collector.
I'm using it partly as an excuse to learn python also and using the create examples and xaplib.pm from http://www.dbzoo.com/livebox/hah_xap_python.
from the broadcast side, I'm managing to sucessfully send out packets from the joggler and with the windows xap viewer I can see the packets as I expect them:
Member for
16 years 10 monthsFirstly this message is not
Firstly this message is not compliant to the xAPBSC specification. I would construct your own class and not shoe horn your message into a BSC event message. Many assumptions inside various programs are going to be wrong and the results will be unpredictable. Not to mentioned that won't be able to use this message with the Flash GUI anyway as it MUST be fully BSC if you start down this track.
What about something as simple as this instead? Yes your UID should be unique but not a biggy for now.
I would also stick to using LOWERCASE key names, the xAP specification is case agnostic but if things aren't working its a good thing to tweak (for now).
xap-header
{
v=12
hop=1
uid=FF000F00
class=solar.event
source=shawpad.ujog.solar
}
data
{
coltemp=-0.40
tankbottemp=59.90
tanktoptemp=73.00
pump=0
}
Just make up a new class say 'solar.event' and as there is no target drop the key from the xap-header.
Adjust the pachube keys to suit this new class, there should not be any reason that this won't be processed by pachube. Remember after updating the keys on the web interface you need to restart the xap-pachube process (also via the web interface).
On python I did this VERY early on in the projects life, I too now use a joggler but I ported the LUA interpreter to it and run all the livebox code LUA applets unchanged. LUA on the joggler is a much better environment to work with IMHO than python. What is cool is an Applet on the joggler runs unmodified on the livebox too.
If you do want to circle back and make this a BSC compliant each of these KEYS in the message above would be an BSC endpoint in its own right. This is VERY easy to do using the LUA bsc framework. Its little hard with Python as I discontinued working on this in support of LUA. Python its more thought provoking then a development path.
I've uploaded compiled binaries and the environment I use on my Joggler for running LUA scripts, it also includes xap-hub, xap-pachube, xap-serial, xap-plugboard and iServer - there is no web interface so you need to tweak everything in /etc/xap-livebox.ini to get things started. Its the same syntax as those programs on the livebox. Don't forget each of these will need an a UNIQUE UID key in the xap-livebox.ini file too so they don't collide with your livebox.
Anyway that should get you thinking for a bit.
Brett
Member for
15 years 10 monthsThanks Brett, I did have a
Thanks Brett, I did have a quick start with LUA, but couldn't get the environment going. Thanks for the jumpstart, I'll circle back, and thanks for the patience on my effective hack start.
I do want to make it BSC compliant, as I figure that's what I should do, so I'll get my head clear on that once I get LUA up and running etc.
Cheers,
Ian.
Member for
15 years 10 monthssolar logging now
Quick note to wrap up the initial problem.
I'm now logging successfully to pachube.
I followed Brett's advise on the packet content and lower case.
When working through it also noticed that I'd managed to mix up the case in the pachube config page, so likely that may have been the root cuase, but at least I'm working now and not sending dodgy non-compliant packets.
Small improvement suggestions: change the colour of the background in the pachube page to seperate the datea related ot the xap packets with the pachube params
Thanks.
Ian - no Pi for me :(