11 Jan 2010 à 08:44 par isontheline
Connect your WS2300 Weather Station to your Fonera 2.0g and share your data on the Internet! Use your WS2300 Weather Station for Home Automation Applications.
This page is currently a draft, but a lot of informations are usefull!
Two possibilities comes to our :
We have choosed the second option.
/lib/modules/2.6.26.2 contains the ftdi_sio.ko which is the driver itself
If you plug directly the adapter or use a simple USB 1.1 Host, La Fonera will shutdown the USB Port until the next hardware restart.
We have choosed a simple USB 2.0 Host powered externally in order to avoid current shutdown at the La Fonera USB Port.
In your terminal connected to La Fonera enter :
The dmesg command tells you where the adapter is now attached. In our case, the adapter is attached to /dev/ttyUSB0.
wget ...
tar -xvzf open2300-1.10.tar.gz
Export path of mips-linux-uclibc-gcc
Replace in "Makefile" file the folowing line :
CC = gcc by => CC = mips-linux-uclibc-gcc
make
Send compiled files to La Fonera.
./open2300 0346 r 2
Write a file with all human readable variables :
./log2300 myLogFile.txt
Communication protocol of the Weather Station is here : La Crosse Technology WS2300

USB Serial FTDI Driver
In order to communicate with the Weather Station WS2300 we need an USB Serial Adapter. We have choosed an adapter using the FTDI's chip. By default, La Fonera doesn't include the FTDI_SIO driver. So we need to get the driver.Two possibilities comes to our :
- Get the driver from the Kernel's sources and build it for MIPS architecture.
- Download the already precompiled driver.
We have choosed the second option.
Get the driver
Possible locations (Only for FON2202 Flipper!) :- http://cdn.itimeteo.com/kmod-usb-serial-ftdi_2.6.26.2-fonera2-1_mips.ipk

- http://www.fonera.be/rep/FON2202/kmod-usb-serial-ftdi_2.6.26.2-fonera-1_mips.ipk

Install the driver
- Extract data from this ipk => Extract IPKG Package
- Copy folders into fonera (/etc/modules.d and /lib/modules/2.6.26.2)
- Reboot fonera or for the first time : insmod ftdi_sio
Note :
/etc/modules.d contains the file 65-usb-serial-ftdi which is used to start the driver at startup/lib/modules/2.6.26.2 contains the ftdi_sio.ko which is the driver itself
Communicate with Weather Station
Important :
In order to connect WS2300 Weather Station to the La Fonera with the USB Serial Adapter, we must use an USB 2.0 Host !If you plug directly the adapter or use a simple USB 1.1 Host, La Fonera will shutdown the USB Port until the next hardware restart.
We have choosed a simple USB 2.0 Host powered externally in order to avoid current shutdown at the La Fonera USB Port.
Connection
First, login to the La Fonera by using SSH. Connect the USB 2.0 Host, USB Serial Adapter and the Weather Station RS232 cable.In your terminal connected to La Fonera enter :
| 1. | # Display kernel messages : |
| 2. | dmesg |
| 3. | |
| 4. | # This command should tell you at the end : |
| 5. | usb 1-1.3.3: new full speed USB device using ehci_hcd and address 7 |
| 6. | usb 1-1.3.3: configuration #1 chosen from 1 choice |
| 7. | ftdi_sio 1-1.3.3:1.0: FTDI USB Serial Device converter detected |
| 8. | ftdi_sio: Detected FT232BM |
| 9. | usb 1-1.3.3: FTDI USB Serial Device converter now attached to ttyUSB0 |
| 10. | ttyusb -> 1 ttyUSB0 ftdi_sio 04036001 |
Note :
If dmesg command doesn't tell you that you USB Serial Adapter was discovered, please verify that your adapter is built with a FTDI's chip.The dmesg command tells you where the adapter is now attached. In our case, the adapter is attached to /dev/ttyUSB0.
Open2300
Presentation
Compilation
Get sources from these possible locations :- http://cdn.itimeteo.com/open2300-1.10.tar.gz

- http://sourceforge.net/projects/open2300/files/open2300/open2300-1.10.tar.gz?download

wget ...
tar -xvzf open2300-1.10.tar.gz
Export path of mips-linux-uclibc-gcc
Replace in "Makefile" file the folowing line :
CC = gcc by => CC = mips-linux-uclibc-gcc
make
Send compiled files to La Fonera.
Precompiled packages
First try to exchange
Read indoor temperature :./open2300 0346 r 2
Write a file with all human readable variables :
./log2300 myLogFile.txt
Communication protocol of the Weather Station is here : La Crosse Technology WS2300