Projecte

General

Perfil

Actions

Característica #58

tancat

bmx6-json plugin

Afegit per Axel Neumann fa casi 13 anys. Actualitzat fa més de 12 anys.

Estat:
Tancat
Prioritat:
Normal
Assignat a:
Categoria:
WEB interface
Versió prevista:
-
Inici:
01-04-2011
Data de venciment:
% realitzat:

80%

Temps previst:
100:00 h
Temps invertit:

Descripció

bmx6 json plugin should export all available status and topology information in json notation.

The following posix api have been discussed for data exchange between bmx6 daemon and other apps (like web-server,...)
  • unix file system (regular file), for example /var/run/bmx6/json/...
  • unix pipes
  • unix socket (traditional batman/bmx api to access exchange information at runtime), e.g. bmx6 -c json-parameters

During discussion it became clear that unix file system would be the most convinient way api for most applications.
However, this requires information to be rendered and stored proactive even when no application is interested in it.

unix pipes and unix sockets would allow the bmx6 daemon to create the required information only on demand and not (proactively) update the volatile (non-durable) information all the time which would create lots of useless cpu load.

unix pipes seem to be kind of unstable since blocking and listening to a pipe is not fully posix standard.
unix sockets have the disadvantage of requiring cgi-scripts to execute the connect command before information is available

The current solution is focusing on unix file system where file-system updates are triggered by events.

bmx6 information is classified in durable and volatile

durable information:

  • options: This FILE provides a detailed description of all available bmx6 configuration options and its
    attributes (like default/min/max values, help, syntax).

*parameters: This FILE provides a detailed summary of the daemons current configuration

*descriptions: This DIRECTORY holds one file for each currently active node in the network, describing the attributes (like IP addresses, hostname, IDs,...) of each node respectively.

*descriptionExtensions: (to be defined...)

volatile information:
  • status: uptime, cpu-load, globalID, number of active nodes, version
  • interfaces: names, status, bandwidth, ip address,...
  • links: outgoing interface to linklocal neighbor interfaces, neighbor ip addresses, link qualities
  • originators: list of currently originators in the network, primary ip, metric,...
Actions #1

Actualitzat per Axel Neumann fa casi 13 anys

  • Estat ha canviat de Nou a En progrés
  • % realitzat ha canviat de 0 a 20

implement data field description mechanism.
The idea is that any data can be internally described and the description can be used to export data into various formats. One of the format would then be json.

The result of this work has been committed to bmx6.net http-json-plugin

Actions #2

Actualitzat per Axel Neumann fa casi 13 anys

  • % realitzat ha canviat de 20 a 30

The main idea is to have one global ID for each node and which can be used to
link together the various information a daemon has about the network (other nodes and links between them).

The globalID of a bmx6-mesh node constitutes of his hostname + . + random-hex value, eg:
mlc116.65A370182BEFDF5E702E
where mlc116 is the hostname of this node and 65A370182BEFDF5E702E is a random value selected during the init-procedure of the bmx6 daemon.

The result of this work has been commited to bmx6.net http-json-plugin

The extended globalID concept required an increase of bmx6 compatibility version.

Actions #3

Actualitzat per Axel Neumann fa casi 13 anys

implemented function to transform internal parameter and options data to json using jsonc library

Actions #4

Actualitzat per Axel Neumann fa casi 13 anys

  • % realitzat ha canviat de 30 a 50

transform node descriptions from internal msg-field description to json notation and store it in posix file in to /var/run/bmx6/descriptions/gobalID

Actions #5

Actualitzat per Axel Neumann fa casi 13 anys

  • % realitzat ha canviat de 50 a 70
make volatile status information available in json notation via unix socket connections to daemon:
  • --json-status
  • --json-links
  • --json-originators
With latest commit to
http://www.bmx6.net/projects/bmx6/repository/show?rev=http-json-plugin
this volatile information is also available via unix file system at:
  • /var/run/bmx6/json/status
  • /var/run/bmx6/json/links
  • /var/run/bmx6/json/originators/<globalId>
Essential information is updated immediately while others are only updated with a configurable update periodicity which can be defined with:
  • --jsonUpdateInterval=10000 (ensuring full update every 10000 msecs)
  • --jsonUpdateInterval=0 disables update of volatile information files.

see also:
http://www.bmx6.net/projects/bmx6/repository/revisions/http-json-plugin/entry/lib/bmx6_json/HOWTO
https://llistes.graciasensefils.net/mailman/private/13f/2011-May/000259.html
https://llistes.graciasensefils.net/mailman/private/13f/2011-May/000276.html

Actions #6

Actualitzat per Axel Neumann fa casi 13 anys

created new bmx6-qmp package which enables, compiles, installs bmx6_json.so plugin
adapted qmp_functions.sh to reflect new bmx6 parametrization style
tested on netgear wgt634u hardware

see also:
http://qmp.cat/redmine/projects/qmp/repository/diff?rev=3931ad322ece45c215aa80a46f6fd23fa3d34907&rev_to=b431246f39a08638c9d1ea2494253d15a7ae9e88

quick HOWTO (from within your qmp repository ipv6-routing-prototype branch):

git pull

scp files/etc/functions.sh :/tmp/

cd ../backfire

./scripts/feeds/update -a
./scripts/feeds/install -a

make package/libjson-c/clean V=99
make package/libjson-c/install V=99
make package/feeds/qmp_packages/bmx6-qmp/install V=99
make package/feeds/qmp_packages/bmx6-qmp/clean V=99
make package/feeds/qmp_packages/bmx6-qmp/install V=99

scp bin/<your-hardware>/packages/libjson*.ipk :/tmp/
scp bin/<your-hardware>/packages/bmx6-qmp*.ipk :/tmp/

ssh

cd /tmp/
opkg remove bmx6
opkg install libjson*.ipk
opkg install bmx6-qmp*.ipk

cp qmp_functions.sh /etc/
. /etc/qmp_functions.sh
qmp_configure_bmx6
/etc/init.d/bmx6 restart

Actions #7

Actualitzat per Axel Neumann fa casi 13 anys

  • % realitzat ha canviat de 70 a 80

The SMS feature of the bmx6_json.so plugin can be used to sync data files with arbitrary self-defined content over the mesh. This is achieved by adding the content of to be synced SMS data-files to the description of a node.

--syncSms=<data-file-name> can be used to once or several times to configure the respectively.

Then, as soon as a file with this name is created in the directory /var/run/bmx6/json/sendSms
it is cloned to all other connected bmx6 instances in the mesh into the directory:
/var/run/bmx6/json/rcvdSms

The following two restriction exist:
  • The data-file-name must be at most 15 bytes long
  • The data-file-content must be at most 240 bytes long

Use cases

For example, the SMS feature may be used to implement json based map application. The application may use such an SMS to propagate any self-defined json syntax containing the gps position of a node to all other nodes. An application may collect this data and combine it with other state information of the bmx6_json.so plugin to vizualize the topology of the mesh.
The self-defined message might look like:
  • file-name: gsf_map_data
  • file-content: { `longitude` : 12.345, `latitude` : 54.321, `email` : ``, `message` : `come and join` }
Actions #8

Actualitzat per Pau Escrich fa casi 13 anys

Seems that inotify support must be enabled.

To enable inotify:

make kernel_menuconfig

File systems ->

  • Dnotify support
  • Inotify file change notification support
  • Inotify support for userspace
Actions #9

Actualitzat per Agustí Moll Garcia fa més de 12 anys

  • S'ha actualitzat Descripció (diferencies)
  • Estat ha canviat de En progrés a Resolt

S'utilitza dos fitxers SMS de BMX6 amb les dades que l'Axel (més o menys) proposava.

http://qmp.cat/projects/b6m/repository/revisions/e51078cdbc5f34d5c90900ad5ed57d213cba80cb

Actions #10

Actualitzat per Agustí Moll Garcia fa més de 12 anys

  • Estat ha canviat de Resolt a Tancat
Actions

També disponible a: Atom PDF