basti122303
Posts: 35
Joined: Fri Jun 15, 2012 8:37 am

1-Wire Weather Station

Tue Apr 02, 2013 1:56 pm

After my try to get PCE FWS-20 Weatherstation working with pi i want to connect all the sensors to 1-Wire network.

At the Moment a BPM085 (Pressure-Sensor) is connected to PI
(see http://learn.adafruit.com/using-the-bmp ... i/overview).

Code: Select all

Pin 1 -> VCC
Pin 3 -> SDA
Pin 5 -> SCL
How can I connect the Concept:
http://unix-solution.de/raspi/pic/DS2423.jpg

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: 1-Wire Weather Station

Tue Apr 02, 2013 5:58 pm

If I have understood correctly, the connection to the Pi is a 'bus' which can be extended by adding further sensors in parallel. So you use the same GPIO pin.
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

basti122303
Posts: 35
Joined: Fri Jun 15, 2012 8:37 am

Re: 1-Wire Weather Station

Wed Apr 03, 2013 7:58 am

A new Revison of my schemata, can anybody please check if it is ok?
http://unix-solution.de/raspi/pic/DS2423-2.jpg

basti122303
Posts: 35
Joined: Fri Jun 15, 2012 8:37 am

TX 23 -- invalid pin state

Fri Apr 05, 2013 10:01 pm

I have use my schema above and compile the code from swpi
(https://github.com/ToninoTarsi/swpi/blo ... readTX23.c)

Code: Select all

pin2 -> yellow -> GND
pin3 -> Green
pin4 -> red -> 3.3V
           | 10K Ohm pullup
pin5 -> brown -> GPIO22 (pin15)
I get only this:

Code: Select all

root@raspberrypi:/home/develop/swpi/TX23# python test.py 
Segmentation fault
root@raspberrypi:/home/develop/swpi/TX23# ./readTX23 -v
Error 1 : Invalid pin state
root@raspberrypi:/home/develop/swpi/TX23# ./readTX23 --debug
62uS,1
Whats wrong?

basti122303
Posts: 35
Joined: Fri Jun 15, 2012 8:37 am

Re: 1-Wire Weather Station

Fri Apr 05, 2013 10:26 pm

After a restart I get data like:

Code: Select all

root@raspberrypi:/home/develop/swpi/TX23# ./readTX23 -v
--------------------
Bit Length: 1225 uSec
Start frame: 27
Wind Direction: WSW (11)
Wind Direction2: WSW (11)
Wind Speed: 1
Wind Speed2: 1
Checksum (received): 12
Checksum (calculated): 12
Data is Valid!
--------------------
(11 , 1 )root@raspberrypi:/home/develop/swpi/TX23# 
root@raspberrypi:/home/develop/swpi/TX23# ./readTX23 --debug
64uS,1
1616uS,0
19851uS,1
22292uS,0
23513uS,1
27173uS,0
28395uS,1
33277uS,0
51588uS,1
52809uS,0
57691uS,1
70021uS,0
89430uS,1
91949uS,0
93093uS,1
96753uS,0
97974uS,1
101636uS,0
104078uS,1
106518uS,0
115062uS,1
118725uS,0
121166uS,1
122387uS,0
126050uS,1
128532uS,0
130932uS,1
139599uS,0
140556uS,1
root@raspberrypi:/home/develop/swpi/TX23# 
root@raspberrypi:/home/develop/swpi/TX23# 
root@raspberrypi:/home/develop/swpi/TX23# 
root@raspberrypi:/home/develop/swpi/TX23# 
root@raspberrypi:/home/develop/swpi/TX23# 
root@raspberrypi:/home/develop/swpi/TX23# 
root@raspberrypi:/home/develop/swpi/TX23# ./readTX23 --debug
66uS,1
1563uS,0
19515uS,1
21957uS,0
23178uS,1
25617uS,0
29279uS,1
30501uS,0
48812uS,1
53714uS,0
54915uS,1
69685uS,0
89095uS,1
91631uS,0
92756uS,1
95198uS,0
98859uS,1
100080uS,0
118390uS,1
123273uS,0
124493uS,1
139264uS,0
140291uS,1
root@raspberrypi:/home/develop/swpi/TX23# ./readTX23 -v
--------------------
Bit Length: 1225 uSec
Start frame: 27
Wind Direction: S (8)
Wind Direction2: S (8)
Wind Speed: 0
Wind Speed2: 0
Checksum (received): 8
Checksum (calculated): 8
Data is Valid!
--------------------
(8 , 0 )root@raspberrypi:/home/develop/swpi/TX23# 
I have a small fan next to the wind sensor witch is rotate.
Whats wrong that the wind is too less?
Or in other words whats the measure ? (1,2,3) and can i get m/s ?

basti122303
Posts: 35
Joined: Fri Jun 15, 2012 8:37 am

Re: 1-Wire Weather Station

Mon Apr 08, 2013 12:19 pm

There http://www.lavrsen.dk/foswiki/bin/view/ ... SMemoryMap I have found that wind-speed can be different units.
How can i set this?

MikeX
Posts: 2
Joined: Wed Sep 04, 2013 12:40 pm

Re: 1-Wire Weather Station

Wed Sep 04, 2013 8:23 pm

hi basti,

i'm also playing with RPi and the TX23 sensor.
unfortunately i do not get the swpi TX23 code running, i get the same errors as you before.

# ./readTX23 -v
Error 1 : Invalid pin state
# ./readTX23 -d
62uS,1

# python test.py
Segmentation fault

what have you done in order to get it working?

thanks
mike

basti122303
Posts: 35
Joined: Fri Jun 15, 2012 8:37 am

Re: 1-Wire Weather Station

Sun Sep 08, 2013 6:37 pm

Hello,
sorry my raspi is offline at the moment.
When I get this error something was wrong with the cable connection.

Regards,
basti

rayperkins
Posts: 4
Joined: Fri Apr 19, 2013 8:53 am

Re: 1-Wire Weather Station

Sat Sep 14, 2013 8:11 am

Hi All. I have just got my PI reading from a TX23U using the RaspberryPiDotNet library and following John's guide here: http://www.john.geek.nz/2012/08/la-cros ... -protocol/

Let me know if you are interested in the code / wiring guide.

basti122303
Posts: 35
Joined: Fri Jun 15, 2012 8:37 am

Re: 1-Wire Weather Station

Thu Nov 14, 2013 3:10 pm

Hello rayperkins,

can you please post your code?
At the moment i have several problems:

- first of all, in a test environment with a chassis-fan I get 24/7 data -- outdoor only a few per day
- I want to collect data via munin ... its a bit difficult to get a "reality" graph, specially for wind direction

wujek74
Posts: 1
Joined: Sat Dec 07, 2013 4:45 pm

Re: 1-Wire Weather Station

Sat Dec 07, 2013 4:54 pm

Hello,

Does anyone launched a weather station on rpi cooperating with the TX23? I'm interested only wind strength and direction. I tried to run SWPI but unfortunately without success. Thank you in advance for your help, otherwise I'll have to sell the RPI and TX23.

rayperkins
Posts: 4
Joined: Fri Apr 19, 2013 8:53 am

Re: 1-Wire Weather Station

Wed May 28, 2014 9:21 am

Hi All
Attached is the code for reading from a TX23U using .NET and RPi.Net. To run it make sure Mono is installed and then type the command 'sudo mono Home.TX23ULogger.exe 4', where '4' is the pin number connected to the TX23U line. The line must be pulled up by a resistor (4k7 works ok).

The code is based on the good work done here: http://www.john.geek.nz/2012/08/la-cros ... -protocol/
Let me know if you have any issues.
Enjoy!

Note: MikeX has pointed out some issues which I will correct and re post the code in the very near future. The workaround is to make sure the libbcm2835.so library is installed and loaded on the pi and either change the GPIO number in the code and recompile or use GPIO4. I hope to fix the issue in the next few days.
Attachments
Home.TX23ULogger.zip
TX23U Visual Studio projects
(44.39 KiB) Downloaded 173 times
TX23UdotNet.zip
.Net console app
(32.82 KiB) Downloaded 156 times

Oomkens
Posts: 2
Joined: Wed Aug 09, 2017 10:30 am

Re: 1-Wire Weather Station

Wed Aug 09, 2017 12:08 pm

A bump up for this old thread! Just wondering if someone has successfully integrated the TX23 and RPi 3B into a reliable datafeed for wind speed and direction.

rayperkins
Posts: 4
Joined: Fri Apr 19, 2013 8:53 am

Re: 1-Wire Weather Station

Sat Aug 12, 2017 9:50 am

Hi Oomkens
The Mono program in the TX23UdotNet.zip file was made to take a reading from the TX23U. To make it work you will need to wire up the TX23U to a GPIO on the raspberry pi and then run the program with a command line argument saying what pin you have used (default is pin 4).
That is how I remember it from way back when.

Feel free to download the TX23UdotNet.zip application and see let us know if it works on the RPi3.

Oomkens
Posts: 2
Joined: Wed Aug 09, 2017 10:30 am

Re: 1-Wire Weather Station

Sat Aug 12, 2017 7:19 pm

Yes, it does work after I updated the bcm2385 library file, since the pin count/lay-out is different. However, I'd like to automatically log the data into a SQL database. So I need to recompile the exec file, or something entirely new... You have suggestions?

frunk
Posts: 2
Joined: Wed Jan 10, 2018 6:19 pm

Re: 1-Wire Weather Station

Sat Feb 17, 2018 9:29 am

I spent a whole day trying to get data of the TX23 with the Raspberry Pi 3 and finally, works!

I just get running the Home.TX23ULogger.exe, but you must use pin BCM4 always, because the program didn't got the pin parameter.

1) Download the library bcm2835 version 1.55 and compile it:

(dont forget change xx with the version number)

Code: Select all

# download the latest version of the library, say bcm2835-1.xx.tar.gz, then:
tar zxvf bcm2835-1.xx.tar.gz
cd bcm2835-1.xx
./configure
make
sudo make check
sudo make install
2) Compile libbcm2835.a:

Code: Select all

cd bcm2835-1.xx/src
make libbcm2835.a
gcc -shared bcm2835.o -o libbcm2835.so
3) Download rayperkins program posted before.

4) Erase the old libbcm2835.so and move the new from /bcm2835-1.xx/src to the folder of Home.TX23ULogger.exe.

5) Run it (no wind today):

Code: Select all

mono Home.TX23ULogger.exe
>>Angle 135, Direction SE, Speed 0, KPH 0
And that is all!

So I must parse the console out to python for get the data in my program!

If someone encourage, could fix the ToninoTarsi library for better integration.

orneeman
Posts: 1
Joined: Sun Apr 08, 2018 4:19 pm

Re: 1-Wire Weather Station

Sun Apr 08, 2018 4:21 pm

Hi
I got this error :"Failed to read TX23U"
someone can help me please?

frunk
Posts: 2
Joined: Wed Jan 10, 2018 6:19 pm

Re: 1-Wire Weather Station

Sat Apr 14, 2018 6:43 am

orneeman wrote:
Sun Apr 08, 2018 4:21 pm
Hi
I got this error :"Failed to read TX23U"
someone can help me please?
Is your data wire connected to BCM4?

Return to “Interfacing (DSI, CSI, I2C, etc.)”