This package is designed to convert serial data received from:
Vaisala Present Weather Detectors (PWD10/12), configured to use automatic message type '2', 9600 bps, 7 data bits, even parity, 1 start, 1 stop, no flow control.
Vaisala Ultrasonic Anemometers configured to use Vaisala NMEA Extended, 9600 bps, 8 databits, no parity, 1 start, 1 stop, no flow control).
To DATEX II V2 (see http://datex2.eu/) transmitted over an IP network.
2. Build Prerequisites
A toolchain that you can use to compile (most often available at the manufacturers site of the target device on which you're going to run) and the dmib software:
$ tar xfz dmib-0.1.tgz
$ cd dmib-0.1
~/dmib-0.1 $ # Cross compile
~/dmib-0.1 $ CXX=/usr/local/arm-linux/bin/arm-linux-g++ \STRIP=/usr/local/arm-linux/bin/arm-linux-strip make
~/dmib-0.1 $ # Native compile
~/dmib-0.1 $ make clean
~/dmib-0.1 $ make
This will produce two executables: 'dmib' and 'beeper'.
The 'beeper' executable is used for alerting the user via the 'alert_user' script (see below) and will only work on certain embedded platforms - if it doesn't work on yours, feel free to change it!
3. Running
The program takes the following arguments (and should be executed as the root user since it requires tty and network interface access):
DMIB will automatically test each tty to see if a supported device is present and if one is found will start listening on a TCP port (see config below) for a client connection. Also, see DATEX II section below for details of the format.
The software tries to execute a command called 'setinterface' to place the tty into RS232 mode for the PWD, and RS422 mode for the anemometer. If the 'setinterface' command cannot be found, the program continues but without the ability to change serial port type.
If you have another command that can change a serial port interface type, write a shell script called 'setinterface' that does the same as the following, and place into /usr/local/bin:
When DMIB finds a supported device it outputs a message on standard output and calls the following command which it expects to find in the executable path (eg, /usr/local/bin):
Since the method of alerting the user is specific to the target device being used to execute DMIB, you will have to provide your own implementation of this command. (An example one is provided, that beeps once when a visibility sensor is detected, and twice when an anemometer is detected).
3.2 Configuration Successful Alerts
When DMIB successfully reads the XML file and successfully configures the 'eth0' network interface with the ip address, it calls:
alert_user CONFIG_OK
The default implementation of this beeps for 2 seconds.
3.3 Error Alerts
When the software detects an error, it outputs an error message on standard output and calls the 'alert_user' command with the following arguments, once per second, until the platform is restarted:
(Note that in all messages, the country code and national identifier are ignored).
When a TCP client connection is made to a port mapped to an anemometer, the program will output DATEX II as shown by README.wind.xml.
If the port is mapped to a visibility sensor, the program will output data as shown by README.vis.xml.
When the client receives the XML it is expected to send back an acknowledge message as shown below (again, the country and national identifiers are ignored):
1. Introduction
This package is designed to convert serial data received from:
Vaisala Present Weather Detectors (PWD10/12), configured to use automatic message type '2', 9600 bps, 7 data bits, even parity, 1 start, 1 stop, no flow control.
Vaisala Ultrasonic Anemometers configured to use Vaisala NMEA Extended, 9600 bps, 8 databits, no parity, 1 start, 1 stop, no flow control).
To DATEX II V2 (see http://datex2.eu/) transmitted over an IP network.
2. Build Prerequisites
A toolchain that you can use to compile (most often available at the manufacturers site of the target device on which you're going to run) and the dmib software:
This will produce two executables: 'dmib' and 'beeper'.
The 'beeper' executable is used for alerting the user via the 'alert_user' script (see below) and will only work on certain embedded platforms - if it doesn't work on yours, feel free to change it!
3. Running
The program takes the following arguments (and should be executed as the root user since it requires tty and network interface access):
There must be at least two tty paths supplied.
DMIB will automatically test each tty to see if a supported device is present and if one is found will start listening on a TCP port (see config below) for a client connection. Also, see DATEX II section below for details of the format.
The software tries to execute a command called 'setinterface' to place the tty into RS232 mode for the PWD, and RS422 mode for the anemometer. If the 'setinterface' command cannot be found, the program continues but without the ability to change serial port type.
If you have another command that can change a serial port interface type, write a shell script called 'setinterface' that does the same as the following, and place into /usr/local/bin:
3.1 Device Found Alerts
When DMIB finds a supported device it outputs a message on standard output and calls the following command which it expects to find in the executable path (eg, /usr/local/bin):
For example:
Since the method of alerting the user is specific to the target device being used to execute DMIB, you will have to provide your own implementation of this command. (An example one is provided, that beeps once when a visibility sensor is detected, and twice when an anemometer is detected).
3.2 Configuration Successful Alerts
When DMIB successfully reads the XML file and successfully configures the 'eth0' network interface with the ip address, it calls:
The default implementation of this beeps for 2 seconds.
3.3 Error Alerts
When the software detects an error, it outputs an error message on standard output and calls the 'alert_user' command with the following arguments, once per second, until the platform is restarted:
The error code number is one of:
The example 'alert_user' script beeps for a quarter of a second, repeated 'error code number' times with a quarter second delay between each beep.
For example:
Will make 5 quarter second beeps, delaying a quarter of a second between each one.
Notes:
DMIB will reconfigure the eth0 interface with the first IP address it reads from the XML configuration file (see below for format).
DMIB expects a minimum of two tty devices, and will stop trying serial ports once both supported devices are found.
DMIB must be restarted if you move a recognised sensor to a different serial port.
4. XML configuration
Example configuration:
5. DATEX II V2
See also http://datex2.eu/, specifically WindInformation,
VisibilityInformation, and PrecipitationInformation:
(Note that in all messages, the country code and national identifier are ignored).
When a TCP client connection is made to a port mapped to an anemometer, the program will output DATEX II as shown by README.wind.xml.
If the port is mapped to a visibility sensor, the program will output data as shown by README.vis.xml.
When the client receives the XML it is expected to send back an acknowledge message as shown below (again, the country and national identifiers are ignored):
If the client does not send back the acknowledgement within 60 seconds, DMIB will close the TCP/IP connection.
If none of the measurement data has changed since the last time
transmitted, DMIB will send a keep alive:
6. Transmit intervals
PWD DATEX II data will be sent every 60 seconds.
Anemometer DATEX II data will be sent every 10 seconds:
The gust speed is the maximum gust speed over a rolling 5 minute period.
The average wind speed and direction is calculated over a rolling 75 second period.
Last edit: dmib 2015-05-15