N.B. As usual with embedded systems description, the computer which is used for development (e.g. a PC with Ubuntu)
is called the host, while the target is the embedded system (the WL-500Gp router with OpenWrt).
Installing the operating system
OpenWrt is one of the Linux distributions which have been ported on the WL-500Gp router.
Ready to use images (prepared to be flashed onto the WL-500Gp) can be found on the Internet
and I basically followed the procedure described in the
OpenWrt wiki:
-
Download the
openwrt-brcm-2.4-squashfs.trx image: this is an OpenWrt version for end users, meaning that it includes a web interface
allowing one to administer the router graphically. This interface called webif can be set up after OpenWrt
but since it is quite useful, for instance to tune the time zone without fiddling with the command line, let's do it right away!
- Install a tftp client on the host (I used tftp-hpa as suggested by the Ubuntu distribution).
- Unplug the power cord of the router, connect the PC on one of its LAN interfaces,
keep the black button (RESTORE) pushed (using a pen) while you plug the power on,
wait until the PWR diode blinks slowly before releasing the RESTORE button.
- On the host, in the directory where the OpenWrt image was downloaded:
>tftp 192.168.1.1
tftp>binary
tftp>put openwrt-brcm-2.4-squashfs.trx
tftp>quit
- The wiki states that one should wait 5 minutes so that the flash memory writing is finished for sure,
then you can switch off and on the router (power plug).
- On the host, point your favorite web browser to http://192.168.1.1/.
Since this will be your first access to webif, the latter will ask you to choose a root password.
Additional components
These steps require an active WAN (Internet) connection on the router
(nothing special to remember, apart from switching on your ADSL modem!).
Pay a visit to section System/Packages of webif to get the following packages installed,
right from the Internet to the router (!):
- kmod-usb-uhci: since the WL-500Gp doesn't have a serial port, at least ready to go (without welding...),
we will use a USB-RS232 converter;
- kmod-usb-serial-pl2303: that's the driver for the converter that was lent to me, but there are others.
To set up the router clock, one need to go to section System/Settings and:
- Install ntpclient;
- Choose the time zone;
- Add a ntp server (ntp.ubuntu.com for instance);
- Confirm through Save Changes and Apply Changes <<.
Then at every reboot the router will connect to the ntp server to initialize the system date and time,
which will then evolve according to the router clock. On the other hand, I observed that the system hour is reset
to 00:00 on 01/01/2000 if the Internet was not reachable when reboot occurred.
Installation of the application
Download getwind_install.zip on your host and after "untaring" it go to the cv3f directory
where you will find the script install which automates the following operations (asking twice for the root password):
You will then be able to visit http://192.168.1.1/cv3f/ to see if the system is running as should be.
The small website is updated once a minute but you have to ask your browser to reload the page to experience it.
Data acquisition and site update start automatically on reboot of the WL-500Gp.
Compilation of getWind
The archive getwind_install.zip includes an executable version of getWind but if you want to modify this program,
the easiest way to perform a cross-compilation is to follow this procedure:
- Download the
OpenWrt SDK and decompress the archive on the host;
- Download the source code of getWind (side menu), after decompression you get a CV3F directory;
- In the CV3F directory, modify the prefix macro in the Makefile to choose either the host compiler
(for local execution, in which case prefix must remain empty) or the SDK cross-compiler
(cf. the example provided in the Makefile);
- On the host, enter make in CV3F, or even make install to copy the executable straightaway to the target.