PRO Tutorial

From meteobridge
Revision as of 10:17, 16 December 2015 by Admin (Talk | contribs) (Change Antenna)

Jump to: navigation, search

<languages /><translate>
This page lines out some Meteobridge PRO specific how-tows

Optimize RF Reception

Meteobridge PRO (red cap model) has a RF receiver included to directly pick-up data from Davis outdoor sensors. Compared to a Davis console where only very little computing stuff is happening, we have a high density of sensors, computing modules, Ethernet circuitry and even a WiFi module all together in a very compact housing.

To keep RF noise away from the reading Davis sensor data, we designed an external antenna. The antenna shipped with Meteobridge PRO is quite good in RF operation and picks up about 5 db more signal strength than the wire antenna of Meteostick does. However, if your sensors are far away some tweaking of RF reception might be necessary.

This section of the tutorial explains what you can do if you need improved RF sensitivity.

Turn the Meteobridge PRO into an RF strength meter and find a good place to rest

Before you start experimenting how to improve RF reach we recommend to run through the following steps:

  1. Configure your Meteobridge PRO to connect via WiFi with your network. As you might want to move the Meteobridge PRO and test for various locations, having an Ethernet cable hanging around will be annoying.
  2. Mbpro-tutorial-1.png
    Configure your Meteobridge PRO to make use of the internal RF functions and configure "Meteostick:Vantage" option according to your needs. Set correct transmitter ID, set bandwidth to "small" and set sensitivity to "-90db" to start with. Picture on the right gives an example how your settings might look like.
  3. Power your Meteobridge PRO temporarily with a USB power bank. I assume you have some 5V rechargeable battery with USB plug to feed the Meteobridge PRO laying around. Any cheap power bank for your mobile phone will do. You will need a USB cable that fits into the micro USB power socket of the Meteobridge PRO, but I am sure you have that somewhere in your household. Being on battery and WiFi you have total freedom in checking for a good place for the Meteobridge PRO to rest.
  4. Mbpro-tutorial-2.png
    Define a display service on "Services" tab that shows RF data from the outdoor sensors on the integrated display and updates the display every 5 seconds. To do so, define a new service of type "Display" and select "Periodical" as it's event type. Press "Add Service Event" and a new event will be added to the list of already defined events. Then specify "every 5 seconds" as interval and select "Meteostick RF Analysis" from the list of pre-defined standard messages. Settings for this service should look like shown on the right picture. Don't be confused by the message text that is automatically inserted. If you want to understand how this works, please have a look at page PRO_Display. For the moment you don't need to know the details ;-)

Having done so the Meteobridge PRO display will show data like this:

Mbpro-tutorial-4.png Mbpro-tutorial-3.png

Picture on the left shows reception when Meteobridge PRO is directly sitting on my desk with a lamp, some metal enclosures and the metal corpus underneath my desk in direct neighborhood. Values around -70db are not great, but still no problem to receive. When it reaches the -90 db reception will get tough. By moving the Meteobridge less than a meter away to a higher position on a shelf, reception situation improves significantly. You see that on the right picture. Signal strength in the mid -50db is much better and will allow the sensors to go further away without having the connection dropped. By the way, the display is white but my camera makes it look blue sometimes. If you like watching the numbers change, this 30 second movie might be of interest to you (moving black bars on display are just camera artifacts).

No one can tell you what best position will be in your location, but you are highly invited to check out yourself.

Change Antenna

Mbpro-tutorial-5.png
RF antenna on the back panel of the Meteobridge PRO can be unmounted and replaced by a larger and more capable model. Meteobridge PRO offers a standard SMA plug, where any antenna suitable for the RF band your Davis sensors operate in (915 MHz for US, 868 MHz for EU) will fit, as long as it has a male SMA plug. What you can do in principle is going three ways:
  1. replace small antenna by a larger one that better fits to the wave length of your sensors signals.
  2. connect an antenna that is not directly mounted to the connector but has some cable to bring the antenna further away from the RF noise the Meteobridge PRO is inevitable producing and by that giving the RF signals more head room by reducing the noise floor.
  3. connect to an antenna with some directional characteristic, which can be a small yagi or other form factors. This might be an option to consider when extreme reach needs to be achieved and if you can mount the antenna outdoors as a directional yagi antenna might not fit well to your indoor living style ;-)

Picture on the right shows how the Meteobridge RF SMA female connector looks like and how the antenna SMA male plug is formed. When the antenna plug is a bit too thick to have the power connector inserted underneath, you can cut 1 mm off the white plastic from the micro-USB power plug. Please watch out not to cut too deep. While testing with alternative antennas this works rather uncomplicated. Please realize, that you do this at your own risk and it will void your warranty, so better to choose an antenna with a fitting plug.

We conducted some antenna comparisons for you. We choose a not so good reception position and swapped through different kinds of antennas while checking RF reception level.

Mbpro-ant1.jpg Mbpro-ant2.jpg Mbpro-ant3.jpg

On the left you see the Meteobridge PRO with stock antenna, next to it with a 868 MHz "H-Tronic" HT110A antenna and on the right with a multi-band GSM/UMTS antenna 88414 from "delock" which has a rather thick SMA plug and therefore needs the white power plug underneath remodeled a bit with a knife (cutting off 1 mm went fine). As you see these antennas are very close to each other, with the multi-band antenna loosing some ground. From that perspective changing stock antenna with a larger one of the same kind does not make too much of a difference, at least in our test setup.

Mbpro-ant5.jpg
What can change the game is an antenna that can be mounted away from the Meteobridge PRO. We tested the "H-Tronic" HT250A for the 868MHz band. It comes with a serious 5 meter cable to allow easy positioning far away. We were a bit sceptic how much antenna gain might be lost by a long cable and indeed it seems to have some impact when you look at the numbers in the picture below. While the HT250A does not seem to be a great performer sitting next to your Meteobridge on your desk, it is imho worth considering, when you have a great spot to position the antenna, but you don't want to have to Meteobridge PRO being there (on the top of your book shelf, for example).

Mbpro-ant4.jpg

Console Retransmits

When nothing else helps, you can always ask your Davis console to retransmit packets and to let Meteobridge PRO sniff data from there. As packet retransmits mostly have a lager frequency drift, you need to change the Meteostick settings on "Weather Station" tab regarding bandwidth from "small" to "normal". Furthermore, you have to select the transmitter ID the Console is using for the retransmits. Having the console just a few meters away from the Meteobridge PRO even the worst antenna will do ;-)

FTP Upload of CSV Exports

There have been may requests to upload data of a day or month in some CSV like notation onto a server via FTP. Meteobridge PRO has the building blocks (export function and FTP upload capability) to make this reality. This section explains how to set this up:

Define CSV Schema

The structure of CSV exports is defined by export templates that are user-defined and can be found in PC network share "templates". Export templates have extension ".exp" while the generated exports are stored in "export" folder and have extension ".txt". We start with pre-defined standard template "standard-iso.exp". This template defines a schema where columns show date, time, temperature, humidity, dew point, pressure, wind speed, wind gust, wind direction, rain fall holds these data the following.

## Standard CSV template with data in metric units
##
## date, time, temperature[C], humidity[%], dew point[C], sealevel pressure[hPa], avg wind speed[m/s], gust speed[m/s], winddir, rainfall[mm]<BR>
[YYYY]-[MM]-[DD],[hh]:[mm],[th0temp-avg.1:],[th0hum-avg.0:],[th0dew-avg.1:],[thb0seapress-avg.1:],[wind0avgwind-avg.1:],[wind0wind-max.1:],[wind0dir-avg.0:],[rain0total-sum.1:]

Schedule Generation of Exports

Mbpro-tutorial-6.png
Exports can be easily generated with "Export" service on "Services" tab. Example on the right starts at the beginning of a day an export job that generates data for yesterday in resolution of minutes. Template "standard-iso" is used for data generation and a file like this results from it. Time slots where some of the data is missing does show empty values, as defined by the default settings in the template.
2015-12-13,00:00,4.8,97,4.4,1005.2,0.0,0.0,248,0.0
2015-12-13,00:01,4.8,97,4.4,1005.2,0.0,0.0,248,0.0
2015-12-13,00:02,4.8,97,4.4,,0.0,0.0,248,0.0
2015-12-13,00:12,,,,1004.7,,,,0.0
2015-12-13,00:13,5.1,97,4.7,1004.9,0.0,0.0,180,
2015-12-13,00:14,5.1,97,4.7,1004.7,0.0,0.0,248,0.2
2015-12-13,00:15,5.2,97,4.8,1004.6,0.0,0.0,248,0.0
2015-12-13,00:16,5.2,97,4.8,1004.6,0.0,0.0,248,0.0
2015-12-13,00:17,5.2,97,4.8,1004.5,0.0,0.0,248,0.2
2015-12-13,00:18,5.3,98,5.0,1004.6,0.0,0.0,248,0.0
2015-12-13,00:19,5.3,97,4.9,1004.5,0.0,0.0,248,0.0

Define Upload Service

Mbpro-tutorial-7.png
While time controlled FTP upload services are very standard to Meteobridge, the Meteobridge PRO can also trigger uploads as follow-on events of other events. In our situation we are generating an export file time controlled and the execution of the export event then triggers an upload event that pushes the just generated file onto your server. Definition is done as usual as an "FTP" service, but "Event Type" this time is "Trigger by Event". Example on the right shows that the FTP upload event is directly triggered by the export event. The file to be used for upload is specified as "export:lastexport" which automatically addresses the last generated export file. Target file name makes use of template variables [YYYY], [MM], [DD] which are replaced by year, month and day. Here the beginning of the data in the export file and not the current data when doing the upload is used. This takes care that the file will have a proper name on your server which matches the data in the file.


Doing Data Backups

Mbpro-tutorial-9.png
The Meteobridge PRO stores incoming sensor data on a minute base in the internal 8 GB USB storage. But what if the Meteobridge PRO fails or the USB data store fails or if data is lost there for any reason? As storing backups of the data onto the internal USB storage does not make too much sense we decided to support inserting an external USB stick to one of the USB connectors and to use that for backups. Meteobridge PRO allows you to automatically store data on the external USB stick as long as it is inserted. When capacity is filled up, oldest backups on the stick are automatically erased to make room for new backups. So you don't have to take care about how to keep free storage on the Backup USB stick.
Mbpro-tutorial-8.png
Picture on the right shows a typical backup definition. Backups are realized as a special script service, that can be typically activated each day or each month. When a micro USB stick is used, this can even stay plugged into the front panel USB connector without blocking display view.

Feature that still needs to be implemented is a comfortable restore function from USB stick. We will implement this latest when the first user has a need to restore data from a backup. If you need to restore a backup right now, you simply stop backup services on the web interface, insert the USB stick containing the backup and login via ssh and give these commands:

rm /home/meteohub/test5m.sh       # stop automated service restart
rcloggerd stop                    # stop data logging
/etc/init.d/databased stop        # stop database services
mount /dev/sdb1 /mnt              # mount external USB stick with stored backups
cp /mnt/dbase-xyz /tmp/mnt/dbase  # restore database backup from xyz
umount /mnt                       # unmount external USB stick
reboot                            # restart Meteobridge PRO.

</translate>