I started with this project a long time ago (http://www.wxforum.net/index.php?topic=24882.msg244178#msg244178
) but I dropped out and now I think I finished it.
Part of this information I took from the excellent work of SkyDvrz and others at http://www.wxforum.net/index.php?topic=14299.0
My idea was to reproduce in part the work of those guys but using the TX60U thermometer/hygrometer instead of WPS.
First, I registered the Gateway and the TX60U in weahterdirect.com and then I started the analysis of the traffic using the following :
1)Advanced Gateway Setup program (AGSP) , download from http://www.weatherdirect.com/downloads/GatewayAdminInstall.exe
The following article (http://www.weatherdirect.com/pdfs/help/weatherDirectRegistration.pdf
), in the page 20 & 21 explain how to use the AGSP, also in SkyDvrz software there is a detailed explanation of how to setup the proxy.
I redirected the Gateway to my PC IP using port 9000
2)Start a proxy in my pc (I used CCproxy) listening at port 9000
3)Fire Wireshark and use the following filter
http && (ip.src == xxx.xxx.xxx.xxx || ip.src ==yyy.yyy.yyy.yyy) && ( ip.dst == xxx.xxx.xxx.xxx || ip.dst ==yyy.yyy.yyy.yyy)
yyy.yyy.yyy.yyy =weatherdirect.com IP (188.8.131.52)
You’re going to see the request coming from xxx.xxx.xxx.xxx and answered by yyy.yyy.yyy.yyy
I was playing around with the capture of TX-60 and it looks that temp & HR% are similar to the weather station.
This is the request the TX60 send to the server
According to firstname.lastname@example.org
ZZZZZZZZ =is 0x80 + MAC address less vendor id.
YYYYYYYYYYYYYYYY = Registration code or device Serial Number or other Identifier.
AA = Packet Code 1
BB = Packet Code 2
AA:BB is the command sent by TX60 and the Gateway
I saw two different commands in the header: 01:01 , 01:00, the first one send also 23 byte with the sensor info. The server answered with the following headers HTTP_FLAGS: 00:00 and HTTP_FLAGS: 01:00. You can also see a 00:70 command, that is sent by the Gateway and answered with HTTP_FLAGS: 70:00 .
If you have more than one TX60 , the second thermometer would send a 02:01 and 02:00 commands instead of 01:01 and 01:00. So the first part in the command is the sensor ID
When the command is ID:01 TX60 also send 23bytes with the following structure:
The structure of the packet is:
7 byte of something like the registration( is always the same in each request)
3 byte of sensor 1 info
13 bytes of "26" + sensor 2 info ??? (I couldn't check because I don't have the probe)
I compared the recording (every 5') of the alert system with the capture, and based in the finding of the forum , it looks like :
The temperature in the TX60 is sent in Fahrenheit and it use 2 bytes. Relative humidity use only one byte.
08 |Relative humidity
09 |Integer part of temperature
10 | Decimal part of temperature
(A) Integer part of temp.
(D) decimal portion of temperature
Temp = (ToInt(A) + D / 10 ) -40
Now what I understood how it works the next step was to get an Http server to simulate the weatherdirect.com.Then with the info captured from the TX60 ,process and save it in a file or base.
I read that node.js was one of the easiest tools to create servers and fortunately there were a lot of samples in the web . So I decided to give a try and I coded this little script to do this job and I used sqlite3 to create a base with the captured data and also write the info to a csv file (to later graph the data with excel)
Finally I though the best to way to keep running the server in windows was to put in a service, so I used Nssm (download from https://nssm.cc/download
) to start node and the script as a service and voilŕ , I have a base with all temp and HR data every 5 minute from my TX60. Everything was made for Windows but I think if you work with Linux you can do a similar arrangement. My idea is to install it in a Raspberry PI , but I couldn't find time to try.
Attached are the following files:
“Install TX60 Service.4.bat”
“StringExtend.js” (I deserve the hell for this)
Follow these steps to run the node script.
1)First you have to install node.js . You also need to install module “util” and If you want to generate a base with the TX60 data you have to install “sqlite3”. If you don’t, you have to comment the followings lines: 4, 71-73 and 85 in the TX-60-V2.1js
2) Install NSSM
3) Open AGSP ,press the button search(the information of you gateway should appear), check the "Use" checkbox, add your pc IP and use port 9000. Press button “Set” and the “Reboot” after 10 sec. aprox., the Gateway is sending everything to your PC to the port 9000 and from here to weatherdirect.com
3) Copy the following files to your node folder:
Install TX60 Service.4.bat
4)Check the node script is receiving the data: on a node prompt run :
You are going to see a log on the screen with the server operation.
5) If everything is OK, stop node and try to install it as a service
6) Modify the file : “Install TX60 Service.4.bat”, adding the all the path needed
7) Run “Install TX60 Service.4.bat”. If is ok you are going to see after the first executed line in the bat :
Service "TX60Server" installed successfully!
8)Start the service doing in the command prompt:
sc start tx60server
9) Check the file “TX-60StdOutErr.log” in the node folder, to see the server log. In the files “TX-60.db” and “TX-60.csv” should be the recorded temp and humidity values.
Sorry for my english.
I hope this infornation could help TX60 owners!! [ You are not allowed to view attachments ]