Difference between pages "Getting Started" and "Add-On Services"

From meteoplug
(Difference between pages)
Jump to: navigation, search
(IP Signaling)
 
 
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
To make a Meteobridge out of TP-LINK routers TL-MR3020 or TL-WR703N, you simply habe to install an applicable Meteobridge firmware image. Flashing the firmware can be done with the firmware update functions the router's stock firmware does provide. By doing so you will void the TP-LINK warranty, but having the cheap price in mind you will certainly not face a substantial financial risk in the unlikely event that you brick the router.  
+
<languages /><translate>
 +
<br />Web server of Meteobridge client, which presents web interface for adminstration to you, can also deliver weather data. There are two URLs defined that can be polled to get most recent sensor data in XML or plain text. Although we don't recommend this for security reasons, you can make that URLs accessible from the Internet by configuring your router appropriately. However, when you want to bring sensor data to one of your own servers in the Internet we recommend to make use of Meteobridge's [[Push Services]], which will not need you to open up your firewall.
 +
 +
===Live Data as XML=== <!--T:1-->
 +
By sending the meteobridge a HTTP request like "http://ip-of-meteobridge/cgi-bin/livedataxml.cgi" (where "ip-of-meteobridge" must be replaced by the IP itself) meteobridge returns current weather data in XML notation. Each reply starts witch tag <logger> and ends with </logger> with the sensor data as records with sensor specific tags "THB", "TH", "WIND", "RAIN", "UV", "SOLAR". Example below illustrates the XML format:
  
==Flashing Meteobridge Firmware to TL-MR3020==
+
<!--T:2-->
Please consult the TP-Link manual to understand how to get access with your browser to its web interface. What the manual will tell you is basically that you have to connect your PC/Laptop via ethernet cable, and log in to the router's web interface (IP is 192.168.0.254, login name is "admin", password: "admin").  
+
<pre><logger>
When you have access to web interface of TL-MR3020, overwrite factory firmware like a regular firmware update by [http://www.meteohub.de/files/meteobridge-tl-mr3020-v10.bin meteobridge-tl-mr3020-v10.bin]. Wait until unit restarts. After that it will be a Meteobridge client in standard configuration receiving an IP via DHCP from your router in the LAN.
+
  <THB date="20121227224318" id="thb0" temp="26.0" hum="37" dew="10.2"
 +
      press="1008.8" seapress="1010.1" fc="2"/>
 +
  <TH date="20130104141909" id="th0" temp="9.1" hum="95" dew="8.3"/>
 +
  <RAIN date="20130104141856" id="rain0" rate="0.0" total="3.0" delta="0.0"/>
 +
  <WIND date="20130104141916" id="wind0" dir="109" gust="0.9" wind="2.2" chill="9.1"/>
 +
</logger></pre>
  
==Flashing Meteobridge Firmware to TL-WR703N==
+
<!--T:3-->
As TL-WR703N does only come with a Chinese web interface, it might be a bit tricky to find the right menu item to initiate firmware update. First you have to login with your browser. To achieve that you have to connect your PC/Laptop via ethernet cable, and log in to the router's web interface (IP is 192.168.1.1, login name is "admin", password: "admin").
+
Each sensor data record has a mandatory "date" and "id" parameter. The other parameters are sensor specific. Meaning of parameters is:
When you have access to web interface of TL-WR703N, you select the item at the bottom of the left menu items, marked in light red on the picture below.
+
* '''date''': UTC timestamp of reception of sensor data in format "YYYYMMDDhhmmss"
[[File:wr703n-p1.png]]
+
* '''id''': Unique ID of sensor, consists of a sensor type description shortcut followed by a number, which is always "0" in Meteobridge, as additional sensors are not supported
 +
* '''temp''': temperature in degrees Celsius (with one decimal)
 +
* '''hum''': relative humidity in percent (no decimals)
 +
* '''dew''': dew point temperature in degrees Celsius (with one decimal)
 +
* '''press''': station pressure (without altitude correction) in hPa (with one decimal)
 +
* '''seapress''': normalized pressure with altitude correction (also called sea level pressure) in hPa (with one decimal)
 +
* '''fc''': stations forecast code, if provided. As this has low evidence and also largely varies between stations, meteobridge does not recommend to make use of this data.
 +
* '''rate''': measured rain rate in mm per hour (with one decimal).
 +
* '''total''': current value of rain bucket counter, converted to mm (with one decimal).
 +
* '''delta''': additional rain fall in mm since previous readout of this data (with one decimal).
 +
* '''wind''': current average wind speed im m/s (with one decimal).
 +
* '''gust''': curent not avergaed wind speed in m/s (with one decimal).
 +
* '''dir''': wind direction in degrees (0-359, no decimals).
 +
* '''chill''': wind chill temperature in degrees Celsius (with one decimal).
 +
* more to come...
  
Next you choose sub menu item as marked in light red in the picture below and browse to target file by pressing light red marked file select dialog in the middle of the screen. Please use [http://www.meteohub.de/files/meteobridge-tl-wr703n-v10.bin meteobridge-tl-wr703n-v10.bin] to install Meteobridge firmware onto the device.
+
===Live Data as Plain Text=== <!--T:4-->
[[File:wr703n-p2.png]]
+
By sending the meteobridge a HTTP request like "http://ip-of-meteobridge/cgi-bin/livedata.cgi" (where "ip-of-meteobridge" must be replaced by the IP itself) meteobridge returns current weather data as plain text. Each reply consists of a series of lines, where each line represnets a sensor. Lines do start with a time stamp and a unique sensor id followed by sensor specific parameters. Example below illustrates the format:
  
Finally, a "are you sure" dialog will pop up, please press "yes" button and wait until progress bar has reached 100%. Unit will reboot automatically. After reboot it will be a Meteobridge in standard configuration receiving an IP via DHCP from your router in the LAN.
+
<!--T:5-->
 +
<pre>20130104142614 thb0 26.9 38 11.4 1020.4 1021.7 2
 +
20130104142610 rain0 0.0 3.0 0.0
 +
20130104142636 th0 9.1 95 8.3
 +
20130104142652 wind0 160 2.2 1.8 8.0</pre>
 +
</translate>
  
==IP Signaling==
+
===Data via Socket Connection===
When Meteobridge is connected to your LAN it will try to receive a dynamic IP from your DHCP server during boot. Wait until blinking of the largest LED has stopped. Do a short press on the the transparent push button on top of the large LED (TL-MR3020) or a short press of the reset button behind the pinhole at the back of the unit (TL-WR703N). Now LED will start signaling the IP.
+
Methods introduced above do need HTTP authentification like all elements of Meteobridge web interface. A look at the script "livedataxml.cgi" shows that this just reads data from socket 5557, gives it a suitable HTTP header and returns that to the requesting browser:
  
Meteobridge will signal its IP by pulsing the LED beneath the pressed button (TL-MR3020) or the blue LED on the top of the device (TL-WR703N). Sequence begins with LED going off, then each of the four numbers (delimited by a dot) will be signaled one by one. The dot between the numbers will be signaled by a "H" (LED shines bright). Each number is signaled by blinking digit per digit. Each digit is represented by a "M" (LED shines medium dimmed) repeated as often as the digit tells us. The zero digit is signaled by ten blinks. After having done this for all digits of all numbers of the IP, the end is signaled by LED staying off a while like it started with. When Sequenze is done, the LED is constantly turned on again.
+
<pre>#!/bin/sh
 +
echo -ne "Content-type: text/xml; charset=UTF-8\n\n"
 +
nc 127.0.0.1 5557 2>/dev/null
 +
</pre>
  
Example: IP 192.168.10.77 Legend: M = LED medium dimmed, H = LED shines bright, _ = LED is dark
+
Therefore, reading data from socket 5557 is equivalent to calling "livedataxml.cgi" and socket 5556 reports same data as delivered by "livedata.cgi".
 
+
<pre>Signal:                                          Comment
+
___M___M_M_M_M_M_M_M_M_M___M_M___H              192
+
___M___M_M_M_M_M_M___M_M_M_M_M_M_M_M___H        168
+
___M___M_M_M_M_M_M_M_M_M_M___H                  10
+
___M_M_M_M_M_M_M___M_M_M_M_M_M_M___              77</pre>
+
 
+
If you don't like reading the blinks, you can also use an IP scanner (for example: [http://www.advanced-ip-scanner.com/ Advanced IP Scanner]) or you can look into the logs of your router that provides IPs via DHCP for clients in the LAN/WLAN.
+
 
+
When an FAT formatted USB stick is inserted into the USB port, a file "network.log" is written to the USB stick in addition to the LED blinking. The file looks like this:<pre>Sat Jan  5 00:23:16 UTC 2013
+
MAC:    90:F6:52:C5:2A:B7
+
LAN IP:  192.168.123.245</pre>
+
 
+
When Meteobridge is connected via LAN it will signal the LAN IP. To get the WLAN IP signaled in that case, please disconnect ethernet cable from meteobridge's LAN port and start IP signaling again. This time WLAN IP will be signaled.
+
 
+
==Cloud Simulator for Network Configuration==
+
If Meteobridge client cannot connect to your LAN or your LAN does not provide a DHCP service, large LED will not leave fast-blinking mode. To get network settings fixed, you can define the correct network parameters in a simulator in the Internet, which works as follows.
+
# Please browse to [http://config.meteobridge.com config.meteobridge.com]. There you will find a simulation of the Meteobridge web interface. Please select the "Setup Network" tab and configure settings as needed for your specific network situation.
+
# When settings are done, please press "save" and change to "Download" tab which will cause your browser to start downloading a configuration file named "config.tgz".
+
# Please store that file (as is, do not unpack) on a USB stick formatted as FAT and start the Meteobridge with the USB stick plugged into the USB port of Meteobridge. When network settings are right, Meteobridge will stop with slow and fast blinking and turn on the LED constantly.
+
# You can now remove the USB stick, it is no longer needed. File "config.tgz" on USB stick has been used and renamed to "config.tgz.done".
+
 
+
==First Login==
+
When you have done the flashing of your meteobridge and initial network setup done, you can reach meteobridge for final configuration with your browser by typing in its IP as URL.
+
 
+
As login is protected by a password, your browser will ask for a user name and password. '''Please enter ''meteobridge'' as user und also ''meteobridge'' as password'''. While the user cannot be changed, you can change the password later on. Sections listed in the setup menu at the left will tell you how to finalize configuration so that your weather data gets finally uploaded to Weather Underground.
+
 
+
Your browser will show you meteobridge's web interface with 5 tabs. Please go through all these tabs and make the required settings. The page will show warnings for all still missing essentials until you have worked through all of this. It is just a few steps, which will be explained in the setup chapters, page by page.
+
 
+
==Back to Defaults==
+
When you have misconfigured the network or system password in a way that you can't no longer reach meteobridge, you can revert the system back to defaults by pressing the transparent and illuminated button of TL-MR3020 or the reset button at the back of TL-WR703N at the back behind a pin hole. By pushing these buttons you can revert to defaults in two ways.
+
# '''Reset to default network operation''' is done by pressing the button and keeping it presses until LED goes on again for the first time. Now release button and system will restart with default network configuration, which is LAN DHCP client mode. Network settings done before are still stored inside meteobridge when unit has started in LAN DHCP client mode, but these will need additional "Save" clicks to be made active again.
+
# '''Reset password''' is done by pressing button and keeping it pressed until LED goes on for the second time. Meteobridge will reboot and will be available with default password via ssh (user root, password meteobridge) and http (user meteobridge, password meteobridge).
+
 
+
==Flash Again==
+
When you need to flash a new meteobridge firmware to your device, you can do that by going to "Setup Network" tab und pressing "Expert Mode (OpenWrt)" button. This will bring you to the openwrt SW stack below meteobridge application software stack. Login with your meteobridge password and goto "System" tab. Select sub tab "Backup / Flash Firmware" and use offered "flash new firmware" section. Unmark "keep settings" option and start flashing. Keep device connected to power, it wil restart automatically.
+

Revision as of 09:53, 20 April 2013


Web server of Meteobridge client, which presents web interface for adminstration to you, can also deliver weather data. There are two URLs defined that can be polled to get most recent sensor data in XML or plain text. Although we don't recommend this for security reasons, you can make that URLs accessible from the Internet by configuring your router appropriately. However, when you want to bring sensor data to one of your own servers in the Internet we recommend to make use of Meteobridge's Push Services, which will not need you to open up your firewall.

Live Data as XML

By sending the meteobridge a HTTP request like "http://ip-of-meteobridge/cgi-bin/livedataxml.cgi" (where "ip-of-meteobridge" must be replaced by the IP itself) meteobridge returns current weather data in XML notation. Each reply starts witch tag <logger> and ends with </logger> with the sensor data as records with sensor specific tags "THB", "TH", "WIND", "RAIN", "UV", "SOLAR". Example below illustrates the XML format:

<logger>
  <THB date="20121227224318" id="thb0" temp="26.0" hum="37" dew="10.2" 
       press="1008.8" seapress="1010.1" fc="2"/>
  <TH date="20130104141909" id="th0" temp="9.1" hum="95" dew="8.3"/>
  <RAIN date="20130104141856" id="rain0" rate="0.0" total="3.0" delta="0.0"/>
  <WIND date="20130104141916" id="wind0" dir="109" gust="0.9" wind="2.2" chill="9.1"/>
</logger>

Each sensor data record has a mandatory "date" and "id" parameter. The other parameters are sensor specific. Meaning of parameters is:

  • date: UTC timestamp of reception of sensor data in format "YYYYMMDDhhmmss"
  • id: Unique ID of sensor, consists of a sensor type description shortcut followed by a number, which is always "0" in Meteobridge, as additional sensors are not supported
  • temp: temperature in degrees Celsius (with one decimal)
  • hum: relative humidity in percent (no decimals)
  • dew: dew point temperature in degrees Celsius (with one decimal)
  • press: station pressure (without altitude correction) in hPa (with one decimal)
  • seapress: normalized pressure with altitude correction (also called sea level pressure) in hPa (with one decimal)
  • fc: stations forecast code, if provided. As this has low evidence and also largely varies between stations, meteobridge does not recommend to make use of this data.
  • rate: measured rain rate in mm per hour (with one decimal).
  • total: current value of rain bucket counter, converted to mm (with one decimal).
  • delta: additional rain fall in mm since previous readout of this data (with one decimal).
  • wind: current average wind speed im m/s (with one decimal).
  • gust: curent not avergaed wind speed in m/s (with one decimal).
  • dir: wind direction in degrees (0-359, no decimals).
  • chill: wind chill temperature in degrees Celsius (with one decimal).
  • more to come...

Live Data as Plain Text

By sending the meteobridge a HTTP request like "http://ip-of-meteobridge/cgi-bin/livedata.cgi" (where "ip-of-meteobridge" must be replaced by the IP itself) meteobridge returns current weather data as plain text. Each reply consists of a series of lines, where each line represnets a sensor. Lines do start with a time stamp and a unique sensor id followed by sensor specific parameters. Example below illustrates the format:

20130104142614 thb0 26.9 38 11.4 1020.4 1021.7 2
20130104142610 rain0 0.0 3.0 0.0
20130104142636 th0 9.1 95 8.3
20130104142652 wind0 160 2.2 1.8 8.0

Data via Socket Connection

Methods introduced above do need HTTP authentification like all elements of Meteobridge web interface. A look at the script "livedataxml.cgi" shows that this just reads data from socket 5557, gives it a suitable HTTP header and returns that to the requesting browser:

#!/bin/sh
echo -ne "Content-type: text/xml; charset=UTF-8\n\n"
nc 127.0.0.1 5557 2>/dev/null

Therefore, reading data from socket 5557 is equivalent to calling "livedataxml.cgi" and socket 5556 reports same data as delivered by "livedata.cgi".