This document covers the customization of WeeWX. It assumes that you have read, and are reasonably familiar with, the Users Guide. The introduction contains an overview of the architecture. If you are only interested in customizing the generated reports you can probably skip the introduction and proceed directly to the section Customizing reports. With this approach you can easily add new plot images, change the titles of images, change the units used in the reports, and so on.
However, if your goal is a specialized application, such as adding alarms, RSS feeds, etc. Most of the guide applies to any hardware, but the exact data types are hardware-specific.
See the WeeWX Hardware Guide for details of how different observation types are handled by different types hardware. WeeWX is still an experimental system and, as such, its internal design is subject to change.
Future upgrades may break any customizations you have done, particularly if they involve the API skin customizations tend to be more stable. For configuration changes, simply modify the WeeWX configuration file weewx. Customization of reports may require changes to a skin configuration file skin. The weewx. Other customizations may require new Python code or modifications of example code.
Where should you put the code? If you simply modify the examples in place, then your changes will be overwritten the next time you do an upgrade. A better idea is to put the code in the userdirectory, which is preserved through upgrades — you won't have to redo any changes you might have made. For example, if you wish to modify one of the examples that comes with WeeWX, copy it from the examples directory to the user directory, then modify it there.
This way, your modifications will not be touched if you upgrade. For code that must run before anything else in WeeWX runs for example, to set up an environmentput it in the file extensions. It is always run before the WeeWX engine starts up. Because it is in the user subdirectory, it is preserved between upgrades. If you make a change in weewx.
If you make a change to a template or to a skin.
Creating a WeeWX extension to integrate Calduino
The change will be adopted at the next reporting cycle, typically at the end of an archive interval. If you modify code in the user directory, you will need to restart WeeWX. If you make changes, how do you know what the results will look like?The source code is hosted on GitHubwhile downloads are available at weewx.
WeeWX is about 13, lines of code, plus another 13, for the drivers for all the types of supported hardware.
WeeWX includes support for many types of weather stations. In addition to hardware support, WeeWX comes with a software simulator, useful for testing and evaluation.
The driver compatibility table in the hardware guide has a detailed list of the manufacturers and models supported by the drivers that come with WeeWX.
Compatibility for some hardware is provided by 3rd party drivers, available at the Wiki. Finally, check the hardware comparison to see if your hardware is known but not yet supported. If you still cannot find your hardware, post to the User's Group for help. WeeWX is written in Python, so it has the overhead associated with that language. Nevertheless, it is "fast enough" on just about any hardware. It has been run on everything from an early MacBook to a router!
WeeWX also runs great on a Raspberry Pi, although report generation will take longer. For example, the 12 "To Date" templates take about 5. You should run a NTP daemon on your server to ensure that it is synchronized with the correct time. Doing so will greatly reduce errors, especially if you send data to services such as the Weather Underground.
The time on some stations is automatically synchronized with the WeeWX server nominally every four hours. The synchronization frequency can be adjusted in the WeeWX configuration. Python 2. If you are using Python 2. Normally WeeWX is installed and run with administrative root permissions. However, it is not uncommon to install and run WeeWX as a generic non-root user, or even as a user created specifically to run WeeWX.
In the world of open-source hobbyist software, WeeWX is pretty easy to install and configure. There are not many package dependencies, the configuration is simple, and this guide includes extensive instructions. There are thousands of people who have successfully done an install. However, there is no "point-and-click" interface, so you will have to do some manual configuring.This project is changing to be microcontroller based, and using an AM receiver module Aurel RX-4MM5 — a much more effective approach — arduino-yun-reading-whusing-aurel-rx-4mm5.
Currently testing on Arduino Yun, but will probably move to a more platform agnostic design to support Dragino and Carambola etc. The weather station comprises an LCD display and a mast of sensors. The LCD display also incorporates temperature and humidity sensors for indoor readings, as well as a barometric pressure sensor. The mast contains sensors for temperature, humidity, wind-speed, wind-direction, and rainfall, and transmits data-packets using a MHz transmitter. There are variants of the Fine Offset WH with transmitters of differing types e.
Note: the revision 2 boards affect this project in two ways. Again, the code will need simple modifications. Email me if you need help. You may choose to add current limiting resistors. I used a breadboard to wire this up, and unsurprisingly found this to be far from ideal with the RFM12b module.
At close range, the receiver works very reliably, but as the signal weakens, noise often drowns it out even just leaning close to the circuit, or moving a component. A breadboard is fine to test the SPI stuff, and also works well when the transmitter is in close range, but to test the receiver properly, etching a PCB or even just wiring the bits together would be a better idea. I decided to wire the RFM12b to a pin female header to avoid breadboard noise, but discovered that the Pi was generating enough of noise of its own, and having the module more accurately, the antenna so close to the Pi was affecting reception.
A long ribbon cable improved things, as did a length of coax to move the antenna away from the rest of the electronics. When I switched in the RFM01 after carelessly frying my RFM12bthe situation seemed much better, and the device worked more reliably than the RFM12b did in exactly the same environment. It receives perfectly even in this harsh environment, possibly in part because it works on the lowest LNA Low Noise Amplifier settings.
Any wires near the Pi are capable of generating RF noise, even just a breadboard jumper wire sitting underneath the Pi, or an unshielded Ethernet cable. The transmitter sends 11 bytes of data as follows. To get temperature, subtract 0x and divide the decimal by This represents For rainfall, as documented elsewhere, multiply by 0.
You can download the source code from here. It also decodes the hex-data into more meaningful values, and sends them to stdout as printf formatted strings. Note that the calculations on the Raspberry Pi are done using floating-point arithmetic, whereas the WH uses fixed-point. For example, raw wind speed of 0x01 yields 0. Converting this to mph yields 0. Therefore the Raspberry Pi reading is more accurate.
You may notice that the output below also displays barometric pressure and an indoor temperature value. Wiring the module to the Pi was trivial, since it has the pull-up resistors and bypass capacitors already on-board.
Raspberry Pi reading WH1081 weather sensors using an RFM01 and RFM12b
This lets you see where the noise is in your environment so that you can spot likely configuration values that will yield reliable results. The short packet count gives an indication of how much noise is being seen as data. The frequency deviation shows the values of the AFC offset registers. The AFC is manually strobed on each successful packet, in order to slew the frequency offsets with frequency drift.It was first introduced in October and has been updated both in andso one can say that it is a mature product.
Last month I decided to revitalize the idea but with a new objective: to turn the Roomba into a surveillance robot with the ability to take photos and videos.
The first idea was to keep using … Read more…. I use at home a couple of sets of MHz remote-controlled power sockets to switch on and off some ambient lights. I though it will be interesting to remotely control this … Read more….
For this reason, I decided to update the software manually. In this … Read more…. I was very satisfied with this model but Oregon Scientific does not produce it anymore. The updated version, the WMR89, is compatible with the sensors of the old model but, surprisingly, their computer interfaces are completely different.
Luckily some … Read more…. In this post you will see how to create a weeWX extension to import the information gathered and how to control the boiler configurations from an HTTP web page. WeeWX has … Read more…. In the house where I am currently living there is an old Buderus boiler. Due to their situation, the room temperature measurement cannot be used to adjust the heating level. For this reason, the … Read more….
I find METAR weather reports the most useful format to get the current meteorological situation in a few lines. Thanks to weeWx architecture, it is very easy to extend your meteo station capabilities to include and import new information. In this post you will see how to extend the Cheetah Generator in order to include … Read more…. You will probably want to protect certain parts of your domestic web page.
You can develop the authentication method in the web page.
However the server itself can also be used to restrict access. In this tutorial I will show you how to protect with password assets on an … Read more…. Menu Fernando and Daniel. Older posts.When you install WeeWX for the first time, the installation process will prompt you for the most essential options, such as the type of hardware you are using, latitude, longitude, or altitude.
But, what if you want to change these later? In particular, what if you want to change device drivers? You could edit the definitive configuration file, weewx.
Raspberry Pi reading WH1081 weather sensors using an RFM01 and RFM12b
Before starting, it's worth running it with the --help option to see how it is used:. The utility is pretty good about "guessing" where the configuration file weewx. You can do this by either putting the location directly in the command line:.
The column Status can give you some indication of whether you are missing any modules to use this driver. It's not completely accurate, but works for most drivers.
This action is used to change station parameters, including the device driver. The reconfigure action will prompt for all of the required station parameters. When used with the --no-prompt option, reconfigure will modify specific parameters with no interaction.
For example, this would set the station altitude:. Say that you originally installed WeeWX with the Simulator. Now you've bought a Davis Vantage and you want to switch to that. Here's how you do it.
First, use the action --list-drivers to see which drivers are installed. From the list, you will find that the name of the driver for the Vantage is weewx.
The utility will go through your previously selected options, such as station description, latitude, longitude, altitude, etc. With the exception of your newly specified device driver, all your previously selected values will be the defaults.In this post you will see how to create a weeWX extension to import the information gathered and how to control the boiler configurations from an HTTP web page.
When a sensor spits some data out, weeWX does something. This action can be either generate an HTML report or perform some calculations with the data gathered. These actions are called services. In my case, I use the WMR89 driver to recieve the meteorological conditions.
A weeWX instance can only have one driver, so in order to incorporate a new source of information, one or more services should be incorporated. WeeWX services are bound to events and there can be more than one service bounded with the same event. There are different types of services, listed in the following table:. To so do, two data services will be needed:. As it has been commented before, a new database will be used to save Calduino data. Not all the parameters contained in this command will be saved.
It may be of interest to show them in the HTML report in real time but it makes no sense to save them for the future. Note that the field names coincides with the used in the XML tags:. Additionally, you may also use other generators such as the GaugeGenerator to show, in a friendly way, the information gathered by Calduino.
More information can be found in this project. Finally, you will surely want to use the ImageGenerator to create graphics regarding the boiler status. It is up to you decide which generators you want to run and what information you want them to provide. In the first run WeeWX will create a new database named calduino.
In this tutorial you will see how to use a cheap transmitter hooked up to a Pi to interact with devices operating on the commonly used MHz radio frequency band. There are lots of Mhz modules compatible with Raspberry and all of them should work perfectly fine. Before buying one, check that they use the MHz frequency. For this project you will need to use the receiver shorty to discover the codes associated with each power socket.
Once this information is known, only the transmitter component will be used. The first step is to connect the receiver with the Raspberry Pi. As previously commented, we will only use the receiver to know which code is associated with each button of the remote controller.
Connecting the module with your Raspberry Pi is really simple. Any of the GPIO pins can be designated in software as an input or output pin and used for a wide range of purposes. In the following image you can see the meaning and function of the GPIO pins. The connections of the transmitter are as easy as those of the receiver. Just use a different GPIO pin.
As you could see in the previous image, the transmitter usually does not include an antenna so do not expect to have a big range in your sent signals. If the sockets that you are using are too far away from the transmitter and they do not detect it, there are alternative modules that include soldered antennas for a few more euros. On the other hand, you can also build your own antenna in a similar way as I explained in this post.
However, the WMR88 had a reflective plane normal to the antenna acting as a dipole. Without this plane, the quarter wave antenna will not work properly. The solution, is to use a kind of half wave dipole antenna with a length equal to half the wavelength of the signal I recommend using copper wire with a diameter of 1,33 or 1,55 mm gauge. Roll the wire wrapped around a 2. Once connected with your Pi, you can use one of the multiple RF libraries to start listening the codes received by the RF module.