interfacing lacrosse TX3-TH sensors to HAH

I have several temperature/humidity sensors located in my house. The are well-known lacrosse TX3-TH, transmitting data on 433 mhz. I have a simple arduino with 433 mhz receiver that receives and decodes the signals.

lacrosse arduino

Arduino is attached to serial port of HAH and feeds serial port with data in the form

id=505,type=t,value=24 (sensor with id 505 transmitted temperature with value of 24 centigrade)

or

Member for

16 years 10 months

brett

14 years 8 months ago

Vores8,

When creating a filter you should filter only for messages originating from the PORT you are after.

f = xap.Filter() 
f:add("xap-header","class","Serial.Comms")
f:add("serial.received","port", port)
f:callback(update)

Then you would not need to bother with this line. As you know you must be having data from the filter.

if  not frame:isValue("Serial.Received", "data", xap.FILTER_ABSENT) then

good stuff.

Brett

Member for

14 years 8 months

vores8

14 years 8 months ago

Great, thanks! (and as usual, thanks for the gerat software :))

Member for

16 years 10 months

brett

14 years 8 months ago

Vores8,  You're code is rather long.  I've shortened it a little (see attached).  I've not compiled nor tested this but I think you get my drift.   It might just work first time too :)

Brett

Attachments
sensorApplet.lua (1.17 KB)

Member for

14 years 8 months

vores8

14 years 7 months ago

I've polished code a bit (see attached). Now it also helps with the situation when u r changig sensor's batteries which results in a new ID being assigned to the sensor. To identify new ID the script creates "unregistered" BSC endpoint which broadcasts data containing new sensor ID - so you just need to sniff these messages with say xfx viewer and modify sensors table accordingly

results happily flow to pachube (9 sensors each with temp and humi)

And again guys, thanks for the great software :)

Attachments

Member for

16 years 10 months

brett

14 years 7 months ago

You should not be using ep:sendInfo() you should be using ep:sendEvent()
xAPBSC.info is only used when no data has been seen for a timeout period when a change of value occurs that you wish to report you should use xAPBSC.event.

If you look at my Applet you would see that I only send an EVENT when the DATA is different.  This is how BSC works.

  if ep.text ~= value then
    ep:setText(value)
    ep:sendEvent()
  end

This is an important point as you are violating the BSC schema specification with your code.  Yes it might work but its not kosher.

Brett

Member for

14 years 8 months

vores8

14 years 7 months ago

Hmm... ok, will change it into a kosher code

Member for

13 years 11 months

kaloskagatos

13 years 12 months ago

Hi all, hi vores8, I'm planning to buy TX3-TH sensors to interface them with an Arduino. I made some research on the web to check if it has been done before, because I don't have the skills to do the reverse engineering myself. I found one project implementing the TX3 decoding : http://code.google.com/p/arduinoha/ and TH4 decoding https://github.com/kjordahl/Arduino-Weather-Station/ and I found this TX3 protocol description http://www.f6fbb.org/domo/sensors/tx3_th.php

Do you think I will be able to decode TX3 sensor with that ? One thing I can't figure out is : what if two sensor send a packet at the same time ? How did you handle the concurrent computing ? Did you write your own decoding library and maybe could you share it ?

Thanks in advance for your answer,

Johan

Member for

17 years

derek

13 years 12 months ago

>One thing I can't figure out is : what if two sensor send a packet at the same time ?

If two of these units happen to transmit at the very same time, the resulting signals will interfere with each other and the receiver won't get a message that it can decode. Fortunately, the transmissions are generally repeated a few times and more often than not, a valid message will get thru.

If you need 'reliable' messaging then you should use a bi-directional transceiver (e.g. http://www.dbzoo.com/livebox/hah_hahnode). These can request that a device send some readings. If the expected reading is not received, you can ask for a re-send.

I know that KevinT did some work with units like these TX3. See his writeup at http://netcompsys.wordpress.com/

Cheers,
Derek.

Member for

13 years 11 months

kaloskagatos

13 years 12 months ago

Ok, thanks for your answer. I am making the design of a controlling system for my electric heaters, and I was considering buying temperature wireless probes to report temperatures from the rooms instead of using 1-wire probes. As you say, I think it's not important if some messages are dropped.

But for the moment I don't have the skills of making the whole reverse engineering process myself. However thank you for the links, I didn't know the JeeNode solution.

Cheers.