Freifunk Franken Monitoring - API Guide

Function Details

Nearest router

Returns JSON file with basic data of router next to coordinates.

Router by mac address

Redirects to router page.

Nodelist based on FF Ansbach scheme

Returns JSON file of all routers based on scheme of FF Ansbach (GitHub).

This includes the following information: Monitoring ID, hostname, Monitoring Link, on/off, clients, last contact and coordinates.

Routers without position

Returns JSON file of all routers without coordinates set.

Extended router list

Returns JSON file of all routers with the following information: Monitoring ID, hostname, MAC address, hood, status, user nickname, hardware, firmware, Monitoring link, clients, last contact, uplink interfaces and coordinates.

Routers of a specific user

Returns JSON file of all routers belonging to the specified <user_nickname>.

Routers of a hood by KeyXchange ID

Returns JSON file of all routers belonging to the specified <hood_keyxchange_id>.

Wifi Analyzer node list

Returns configuration file (text/plain) for the Wifi Analyzer app (PlayStore).

The file contains all routers of the selected <hood>.

Wifi Analyzer node list for all hoods

Returns configuration file (text/plain) for the Wifi Analyzer app (PlayStore).

The file contains all routers of all hoods.

Alfred API syntax guide

This is an example of a dataset which might be sent through the alfred2 API. For every XML node, the explanation of the content is given as well as an example value in brackets.

The type of brackets indicates how the field is processed:

() field is mandatory

[] field is optional

{} field is not evaluated, but included in the nodewatcher data for future/other use

{
"aa:bb:cc:dd:ee:ff": " # Must match one of the device's MAC addresses
<?xml version='1.0' standalone='yes'?>
  <data>
    <system_data>
      <status>Status [online]</status>
      <hostname>Hostname [MeinFreifunkRouter]</hostname>
      <description>Some additional info [powered by Freifunk Entenhausen]</description>
      <status_text>Some additional info [3 reboots since FW upgrade]</status_text>
      <geo>
        <lat>Latitude [49.92367351]</lat>
        <lng>Longitude [11.59524053]</lng>
      </geo>
      <position_comment>Some additional info [1. Stock, Raum 102]</position_comment>
      <contact>Contact e-mail address [freifunk@example.com]</contact>
      <hood>Name of the hood [testhood]</hood> # Hood name needs to be EMPTY (but not removed) if disconnected
      <hoodid>ID of the hood if from KeyXchange {1000}</hoodid> # Already implemented for future use
      <distname>Linux distribution [OpenWrt]</distname>
      <distversion>Distribution version [18.06-SNAPSHOT]</distversion>
      <chipset>Chipset [Freescale P1014]</chipset>
      <cpu>CPU [TP-Link TL-WDR4900 v1]</cpu>
      <model>Device model [TP-Link TL-WDR4900 v1]</model>
      <memory_total>Total memory in kiB {125120}</memory_total>
      <memory_free>Free memory in kiB [82012]</memory_free>
      <memory_buffering>Buffer memory in kiB [2876]</memory_buffering>
      <memory_caching>Cache memory in kiB [12572]</memory_caching>
      <loadavg>load average [0.06]</loadavg> # if specified, this will be used for Monitoring; if not, loadavg5 will be used
      <loadavg1>1-minute load average {0.00}</loadavg1>
      <loadavg5>5-minute load average [0.06]</loadavg5>
      <loadavg15>15-minute load average {0.03}</loadavg15>
      <processes>Runnable processes/total processes [1/63]</processes>
      <uptime>Uptime in seconds (410831.18)</uptime> # Needs to increase, otherwise reboots will be logged
      <idletime>Idle time in seconds {389207.19}</idletime>
      <local_time>Local router time as timestamp (1559214924)</local_time> # Needs to increase, otherwise router won't be updated
      <babel_version>babel version [babeld-1.9.1]</babel_version>
      <batman_advanced_version>batman-adv version [openwrt-2018.1-6]</batman_advanced_version>
      <rt_protocol>routing protocol [???]</rt_protocol>
      <kernel_version>Linux kernel version [4.9.170]</kernel_version>
      <nodewatcher_version>Nodewatcher version [52.4]</nodewatcher_version>
      <firmware_version>Custom firmware version [gw_20190525]</firmware_version>
      <firmware_revision>Additional data on firmware version [build date: Sat May 25 14:42:20 CEST 2019]</firmware_revision>
      <openwrt_core_revision>OpenWrt Git revision {e0505cc0182acf569cdd7b849189c134684160f8}</openwrt_core_revision>
      <openwrt_feeds_packages_revision>OpenWrt packages feed revision {3ca88ff6df67f72a12b6f3f7565783376db589de}</openwrt_feeds_packages_revision>
      <vpn_active>WAN-Uplink status, 0 or 1 [0]</vpn_active>
    </system_data>
    <interface_data> # List of interfaces with interface name as node name; one interface with mac address is required for identification of device
      <br-mesh> # Example br-mesh device
        <name>netif name [br-mesh]</name>
        <mtu>MTU [1500]</mtu>
        <mac_addr>netif MAC address [aa:bb:cc:dd:ee:f1]</mac_addr>
        <ipv4_addr>Device's IPv4 address in FFF network [10.83.999.1]</ipv4_addr>
        <ipv6_addr>Device's IPv6 address in FFF network [fd43:5602:29bd:xxxx::aabb:ccdd:eef1/64]</ipv6_addr>
        <ipv6_addr>Another IPv6 address in FFF network [bbbb:cccc:dddd:eeee::1/64]</ipv6_addr>
        <ipv6_link_local_addr>Device's link-local address [fe80::a8bb:ccff:fedd:eef1/64]</ipv6_link_local_addr>
        <traffic_rx>Total RX traffic bytes [1033114334]</traffic_rx>
        <traffic_tx>Total TX traffic bytes [30814227528]</traffic_tx>
      </br-mesh>
      <eth0.1> # Example VLAN device
        <name>netif name [eth0.1]</name>
        <mtu>MTU [1500]</mtu>
        <mac_addr>netif MAC address [aa:bb:cc:dd:ee:f2]</mac_addr>
        <traffic_rx>Total RX traffic bytes [1033114334]</traffic_rx>
        <traffic_tx>Total TX traffic bytes [30814227528]</traffic_tx>
      </eth0.1>
      <w2ap> # Example WiFi device
        <name>netif name [w2ap]</name>
        <mtu>MTU [1500]</mtu>
        <mac_addr>netif MAC address [aa:bb:cc:dd:ee:f3]</mac_addr>
        <traffic_rx>Total RX traffic bytes [1033114334]</traffic_rx>
        <traffic_tx>Total TX traffic bytes [30814227528]</traffic_tx>
        <wlan_mode>Mode of WiFi interface {Master}</wlan_mode>
        <wlan_tx_power>TX power without antenna gain [18 dBm]</wlan_tx_power>
        <wlan_ssid>netif SSID [test.freifunk]</wlan_ssid>
        <wlan_type>Type of WiFi interface [AP]</wlan_type>
        <wlan_channel>WiFi channel [13]</wlan_channel>
        <wlan_width>Channel width [20]</wlan_width>
      </w2ap>
    </interface_data>
    <batman_adv_interfaces> # List of batman-adv interfaces with interface name as node name
      <eth0.3>
        <name>Interface name {eth0.3}</name>
        <status>Interface status {active}</status>
      </eth0.3>
      <w2mesh>
        <name>Interface name {w2mesh}</name>
        <status>Interface status {active}</status>
      </w2mesh>
    </batman_adv_interfaces>
    <batman_adv_originators> # List of batman-adv neighbors (TBD originator id)
      <originator_1>
        <originator>Neighbor MAC address [bb:aa:cc:dd:ee:ff]</originator>
        <link_quality>Neigbor link quality, 0-255 [242]</link_quality>
        <nexthop>Nexthop to neighbor MAC address [bb:aa:dd:cc:ee:ff]</nexthop>
        <last_seen>Last contact to neighbor {0.552s]</last_seen>
        <outgoing_interface>Interface providing link to neighbor [w2mesh]</outgoing_interface>
      </originator_1>
    </batman_adv_originators>
    <batman_adv_gateway_mode>Batman-adv mode of device {server (announced bw: 10.0/2.0 MBit)}</batman_adv_gateway_mode>
    <batman_adv_gateway_list> # List of batman-adv gateways (TBD gateway id)
      <gateway_1>
        <selected>Selected gateway, true or false [true]</selected>
        <gateway>Gateway MAC address [bb:aa:cc:dd:ff:ee]</gateway>
        <link_quality>Link quality, 0-255, -1 for undefined [250]</link_quality>
        <nexthop>Nexthop to gateway MAC address [bb:aa:dd:cc:ee:ff]</nexthop>
        <outgoing_interface>Interface providing link to gateway [fffVPN]</outgoing_interface>
        <gw_class>Gateway announce [100.0/20.0 MBit ]</gw_class>
      </gateway_1>
    </batman_adv_gateway_list>
    <babel_neighbours> # List of layer-3 neighbors
      <neighbour>
        <ip>Neighbor's link-local address [fe80::a8bb:ccff:fedd:eeff]</ip>
        <outgoing_interface>Name of interface connecting to neighbor (wireuplink)</outgoing_interface>
        <link_cost>Babel link cost [113]</link_cost>
      </neighbour>
    </babel_neighbours>
    <client_count>Total number of connected clients [4]</client_count>
    <clients> # Clients per netif
      <eth0.1>Number of clients on eth0.1 [1]</eth0.1> # Name is matched by eth*
      <w2ap>Number of clients on w2ap [0]</w2ap> # Name is hard-coded
      <w5ap>Number of clients on w5ap [3]</w5ap> # Name is hard-coded
    </clients>
    <airtime2> # Airtime 2.4 GHz device
      <active>Active time of device [409448579]</active>
      <busy>Busy time of device [73206324]</busy>
    </airtime2>
    <airtime5> # Airtime 5 GHz device
      <active>Active time of device [409466858]</active>
      <busy>Busy time of device [4445704]</busy>
    </airtime5>
    <traffic_control> # Traffic control settings
      <wan> # Traffic-limited netif
        <enabled>TC enabled, 0 or 1 [1]</enabled>
        <in>Incoming traffic limit, kBit/s [2000]</in>
        <out>Outgoing traffic limit, kBit/s [1000]</out>
      </wan>
    </traffic_control>
  </data>
",
"f0:9f:c2:dc:c3:38": "<?xml version='1.0' standalone='yes'?><data>another XML</data>"
}