在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:c-base/c-flo开源软件地址:https://github.com/c-base/c-flo开源编程语言:HTML 73.0%开源软件介绍:c-floMsgFlo setup for rewiring the c-base space station. Hack weekend: Reprogramming the hackerspace hack weekend was held at c-base, July 7-9 2017. Read about it. Introductionc-base is a crashed space station under Berlin that also happens to be one of the oldest hackerspaces. The station has lots of information systems and devices connected using the c-beam MQTT system. c-flo uses MsgFlo and Flowhub to make those devices and the connections between them visible. It also allows new connections between devices to be made, either directly, or using simple Python components to convert data in-between. The aim of c-flo is to make all systems at c-base visible in a single graph, and to foster creativity in how these systems and devices interact. Parts of the system
AccessThe c-flo system is available in c-base crew network. You can open the graph with the following URL: This will download the Flowhub app to your browser and connect directly with the c-flo coordinator. Connecting SystemsEach system or device at c-base can be programmed to appear as a node in the c-flo graph by making it a MsgFlo participant. The design principles and how to make systems visible to c-flo are documented below. Design PrinciplesAll devices and systems at c-base should interface with the c-beam MQTT network. Optimally this means receiving their input from a MQTT topic, and sending their status or output to another MQTT topic. To maximize interoperability, systems should use their own MQTT topics and not be "hardcoded" to speak with a particular other system. The MQTT topic names should be made so that there can be multiple instances of same system running. So you might have Connections between systems should be made visually using c-flo. When needed, Python components can be written as "glue" to convert data from one system to the format wanted by another. Modifications made to the c-flo network should be committed to this repository. Existing ParticipantsWhen the c-flo effort started, c-base already had several artifacts communicating over the MQTT network. These are represented in MsgFlo-land as "foreign participants" loaded from YAML definitions in the To document any missing artifacts, please amend the definitions there. See participant discovery for format documentation. For example, here is how the Echelon network monitoring system was made to appear in c-flo: component: c-flo/echelon
label: station network traffic monitoring
icon: wifi
inports: {}
outports:
traffic:
queue: system/echelon/traffic
type: object The foreign participant mechanism is fine for making existing systems appear in c-flo. However, any new artifacts should be made to announce themselves. Self-announcing ParticipantsIf you're building a new system that interfaces over c-beam, it is quite easy to make it self-announce itself on c-flo. This is done by periodically sending a MsgFlo discovery message on the The discovery messages are formatted as JSON and contain the following information:
For example, here is the discovery message sent by farbgeber: {
"command": "participant",
"protocol": "discovery",
"payload": {
"component": "c-base/farbgeber",
"inports": [
{
"queue": "farbgeber.IN",
"type": "bang",
"id": "in"
}
],
"label": "Produce pleasing color palettes",
"outports": [
{
"queue": "farbgeber.PALETTE",
"type": "object",
"id": "palette"
}
],
"role": "farbgeber",
"id": "farbgeber92490",
"icon": "tint"
}
} These discovery messages should be sent when the system starts up and connects to the c-base bot network. In addition it should be re-sent roughly once per minute. There are MsgFlo libraries available for various programming languages to handle the discovery flow automatically. Some examples of self-announcing participants: Dynamic ParticipantsDynamic participants are started by c-flo itself on-demand. These are typically msgflo-python components used as glue to convert data between other systems or to add dynamic logic to the network. Some examples of dynamic participants:
Testing ParticipantsDynamic participants included in this repository can be included in our test automation setup. Tests are written in fbp-spec format and stored as name: 'Detecting ABBA'
topic: c-flo/DetectABBA
fixture:
type: 'fbp'
data: |
INPORT=detect.SONG:IN
OUTPORT=detect.OUT:OUT
detect(c-flo/DetectABBA)
cases:
-
name: 'currently playing AC/DC'
assertion: 'should return false'
inputs:
in:
artist: 'AC/DC'
expect:
out:
-
equals: false
-
name: 'currently playing ABBA'
assertion: 'should return true'
inputs:
in:
artist: 'ABBA'
expect:
out:
-
equals: true Running locally
Running with Docker
Note: by default the MsgFlo coordinator and MQTT ports are only available on create Markup for WIKICommand
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论