Benutzer-Werkzeuge

Webseiten-Werkzeuge


broker:grundlagen

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
broker:grundlagen [2021/08/09 11:18] Michaelbroker:grundlagen [2021/08/09 17:14] (aktuell) – [Broker-Family (netBiDiB clients)] Michael
Zeile 1: Zeile 1:
-====== BiDiB-Broker - Grundlagen netBiDiB Server ======+====== BiDiB-Broker and Family Basics ====== 
 +BiDiB-Broker and Broker-Family are Java applications to communicate via netBiDiB-protocol with the BiDiBus and netBiDiB-Clients as well as REST-Clients. 
 + 
 +===== Languages and Tools used ===== 
 +  * **Java** * **SpringBoot** * **JavaScript** * **Bootstrap** * **GiT** 
 +You can use it on 'RaspPi' or other Linux computers, on Windows machines as well as with MacX-OS. 
 + 
 +===== BiDiB-Broker (netBiDiB server) ===== 
 +Broker connects you on one side to a BiDiBus-System via serial connection directly or USB. On the other side Broker supports a Ethernet TCP/IP connector with the netBiDiB-protocol. 
 + 
 +<WRAP center round todo 60%> 
 +Continue documentation to run with Broker... 
 +</WRAP> 
 + 
 +===== Broker-Family (netBiDiB clients) ===== 
 +Broker-Family is a small framework for netBiDiB clients. It also includes **REST-clients** to communicate with netBiDiB-server e.g. BiDiB-Broker. With date 2021-08-01 there are three clients: 
 +  * **Registrar** regists the (single) pairing process 
 +  * **Harvester** harvests the NodeTable of BiDiBus 
 +  * **Barker** barks the Feature and ConfigX of a node 
 +These REST-clients base on Broker-Family framework. 
 + 
 +==== Basics ==== 
 +  * The project collaborates on [BiDiB-](http://bidib.org/index.html) and [netBiDiB-protocol](http://bidib.org/bidibus/bidib_net.html). 
 +  * Executable files of the project are available at [on BiDiB Wiki](https://forum.opendcc.de/wiki/doku.php?id=monitor) #TODO: refresh site name 
 +  * You can reach me on OpenDCC-Forum: [Michael](https://forum.opendcc.de/memberlist.php?mode=viewprofile&u=343) 
 +  * **Run Broker and his family** 
 + 
 +==== Show paired clients ==== 
 +=== Example - Connected to Broker === 
 +  * http://localhost:62876/ 
 + 
 +Example - dislay result: 
 +{{:broker:broker_connect_pairing_v1_0.png?400|}} 
 + 
 +==== Pairing of client ==== 
 +=== Example - input (min, typ, max) === 
 +  * http://localhost:62877/trust/00000DFA010303 
 +  * http://localhost:62877/trust/00000DFA010303?timeout=10000 
 +  * http://localhost:62877/trust/00000DFA010303?p-version=08&prod-string=Handheld-Terminal&user-string=Harry%20Hirsch&timeout=10000 
 + 
 +=== Output - JSON/raw result === 
 +{{:broker:registrar_result_v1_0.png?200 |}} 
 +''{"register":{"uid":"DA000D680064EA","pVersion":"0.7","prodString":"GBMBoost Master","userString":" "},"summing":"ADMITTED"}'' 
 + 
 +==== NodeTab of BiDiBus ==== 
 +=== Example - input (min, typ, restricted, max) === 
 +  * http://localhost:62878/harvest/00000DFA010303 
 +  * http://localhost:62878/harvest/00000DFA010303?p-version=08&prod-string=Handheld-Terminal&user-string=Harry%20Hirsch 
 +  * http://localhost:62878/harvest/00000DFA010303?start-address=3 
 +  * http://localhost:62878/harvest/00000DFA010303?p-version=08&prod-string=Handheld-Terminal&user-string=Harry%20Hirsch&send-disable=true&timeout=500 
 + 
 +=== Output - JSON/raw result === 
 +{{:broker:harvester_result_v1_0.png?200 |}} 
 +''{"acre":{"uid":"DA000D680064EA","pVersion":"0.7","prodString":"GBMBoost Master","userString":" "}, 
 +"summing":"FRUITFUL","count":7,"nodeTab":
 +    {"msgAddr":[0],"uid":"DA000D680064EA","version":5}, 
 +    {"msgAddr":[1,0],"uid":"8000FB6B005300","version":5}, 
 +    {"msgAddr":[1,1,0],"uid":"05000D8F00D4EC","version":5}, 
 +    {"msgAddr":[1,2,0],"uid":"05000D8C002AEE","version":5}, 
 +    {"msgAddr":[2,0],"uid":"05000D75001EF0","version":5}, 
 +    {"msgAddr":[3,0],"uid":"05000D79002E00","version":5}, 
 +    {"msgAddr":[4,0],"uid":"45000DCD0037EB","version":5}]}'' 
 + 
 + 
 +==== Feature and ConfigX of a node ==== 
 +=== Example - input (min, typ, max) === 
 +  * http://localhost:62879/bark/00000DFA010303/3,
 +  * http://localhost:62879/bark/00000DFA010303/3.2?send-disable=true&timeout=1000 
 +  * http://localhost:62879/bark/00000DFA010303/3.2?p-version=08&prod-string=Handheld-Terminal&user-string=Harry%20Hirsch&send-disable=true&timeout=3000 
 + 
 +=== Output - JSON/raw result (shortend) === 
 +{{:broker:barker_result_v1_0.png?200 |}} 
 +''{"market":{"uid":"DA000D680064EA","pVersion":"0.7","prodString":"GBMBoost Master","userString":" "},"summing":"ACCEPTED","features count":18,"configXen count":40, 
 +"features":
 +    {"number":-4,"value":24}, 
 +    {"number":-2,"value":1}, 
 +    {"number":40,"value":24}, 
 +    {"number":41,"value":1}, 
 +    ... 
 +    {"number":67,"value":1}, 
 +    {"number":70,"value":40}]," 
 +configXen":
 +    {"port":0,"parameter":[-127,2,4,0,7,20,8,-6,9,4]}, 
 +    {"port":1,"parameter":[-127,2,4,0,7,20,8,-6,9,4]}, 
 +    {"port":2,"parameter":[-127,2,4,0,7,20,8,-6,9,4]}, 
 +    ... 
 +    {"port":38,"parameter":[-127,15,-127,-128,14,0,15,0,11,0]}, 
 +    {"port":39,"parameter":[-127,15,1,-128,14,0,15,0,11,0]}]}'' 
 + 
 +<WRAP center round info 80%> 
 +**Note**: Examples are inputs via browser. CLI is similar, e.g.: 
 +|curl -X "GET" "http://localhost:62878/harvest/00000DFA010303"
 +or including HTTP-Status, e.g.: 
 +|curl -v "GET" "http://localhost:62878/harvest/00000DFA010303"
 +</WRAP> 
 + 
 +==== Preparation to build ==== 
 +Java 17 (at least Java 16) and a working Maven 3 installation are required. 
 +An ***BiDiB-Broker*** should run, preferably on the same machine. 
 + 
 +==== Build ==== 
 +Run the maven build in the *bidib-broker-family* directory: 'mvn install' (or to rebuild all: 'mvn clean install'). 
 + 
 +The installer artifact is located unter *bidib-broker-family/target*. 
 + 
 +=== Local testing === 
 +After the maven build has completed successfully the installation is located under *bidib-broker-family/target*. For testing purposes you can start each of the clients with the following command line: java -jar <BidibClient>-<version>.jar. 
 + 
 +Or you can use one of the launch files. 
 + 
 +Only if you run the BiDiB-Broker you have to run it with a launch file depending of your operation system. 
 + 
 +=== Eclipse === 
 +Use latest Eclipse (2021-9 or newer). 
 + 
 +Start Eclipse with clean workspace. It is recommended to include the *bidib-broker-family.epf* settings locatetd on 'env/eclipse' as well as the '.settings' on the same location. 
 + 
 +=== Import project === 
 +The maven installation steps must be executed before importing projects. 
 + 
 +Import the maven project: ```File -> Import -> Maven > Existing Maven Projects ->  
 +Root directory > Select the 'bidib-broker-family' directory > Select the projects -> Finish``` 
 + 
 +The BiDiB-Broker-Family-Project contains framework classes as well as client classes which use the framework. 
 + 
 +These clients can be used as patterns for own netBiDiB-Clients to rise the Broker-Family. 
 + 
 +==== Framework ==== 
 +In addition to the main/parent project: 'bidib-springbidib' there are two other projects: 
 +  - 'bidib-springbidib-core' with the classes for communication between a REST-API and a netBiDiB server. 
 +  - 'bidib-springbidib-test' with some classes for testing. 
 + 
 +The framework has classes to support a REST-API: 'BidibController' and to handle with TCP/IP netBiDiB-server: 'BidibMessageHandler'. The message workflow is configured in the 'BidibBrokerFamilyConfiguration'. This SpringBoot configuration should not be changed. 
 + 
 +==== Clients ==== 
 +Most processing is done in the framework. But the hard work of a client is the configuration of an own 'statemachine'. The REST-API of the client should manage the result of the finished 'statemachine'. If necessary you have to implement an own xxx_StartAction and XXXFinishAction, which mapped the result.
  
- --- //[[bidib@ebmos.de|Michael]] 2021/08/09 11:14// 
-https://www.ebmos.de/sonst/broker-family/readme.md 
broker/grundlagen.txt · Zuletzt geändert: 2021/08/09 17:14 von Michael

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki