4.2. Example Configurations

Edge Connect examples demonstrating some simple use cases.

4.2.1. Badge Tracking

In this example, we are watching for particular badges moving around a job site. We want to know on a 10s interval when they have been discovered or lost from view from each gateway. To achieve this, we run this pipeline on a few gateways throughout the job site.

In the pipeline, we are looking for a few particular MAC addresses using the adv filter, then when those are found we select the rssi and mac. Every 10 seconds this information is aggregated and wrapped in the json key employeesSeen and then posted to our http endpoint.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{
    "apps": {
        "rigado-edge-connect": {
            "values": {
                "service": {
                    "log": {
                        "level": "info"
                    },
                    "api": {
                        "devmode": true
                    },
                    "cloud": {
                        "connectors": {
                            "http": {
                                "type": "http",
                                "config": {
                                    "headers": {
                                        "Content-Type": "application/json"
                                    },
                                    "method": "POST",
                                    "url": "https://ourserver.com/api/gateway"
                                }
                            }
                        }
                    },
                    "filters": {
                        "select": {
                            "type": "select",
                            "config": {
                                "keys": [
                                    "rssi",
                                    "mac"
                                ]
                            }
                        },
                        "aggregate": {
                            "type": "aggregate",
                            "config": {
                                "mode": "map",
                                "key": "mac",
                                "interval": "10s"
                            }
                        },
                        "organize": {
                            "type": "wrap",
                            "config": {
                                "key": "employeesSeen"
                            }
                        },
                        "timestamp": {
                            "type": "inject",
                            "config": {
                                "keyPairs": {
                                    "timestamp": "",
                                    "serial": ""
                                }
                            }
                        },
                        "publish": {
                            "type": "publish",
                            "config": {
                                "connector": "http"
                            }
                        }
                    },
                    "groups": {
                        "badges": {
                            "type": "static",
                            "config": {
                                "include": [
                                    "fcded3dfd1d6",
                                    "e8951d391b6d",
                                    "f1fa21993d14",
                                    "ac243f252710",
                                    "d27ce4857fa2",
                                    "cfd61932c8d4"
                                ]
                            }
                        }
                    },
                    "pipelines": {
                        "testPipe": {
                            "groups": [
                                "badges"
                            ],
                            "filters": [
                                "select",
                                "aggregate",
                                "organize",
                                "timestamp",
                                "publish"
                            ]
                        }
                    }
                }
            }
        }
    }
}

4.2.2. Heat and Device Traffic Monitoring

This example monitors temperature data using ruuvi tags, as well as monitoring for unique devices nearby each gateway to get a general sense of traffic.

In the ruuvi-pipe pipeline we first detect the ruuvi tag, then inject the serial and timestamp into the data, then aggregate every 10s by mac, convert to json and send to azure.

In the all-pipe pipeline, we do everything the same except we don’t filter on ruuvi device type, so we can see all data.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
    "apps": {
        "rigado-edge-connect": {
            "values": {
                "service": {
                    "cloud": {
                        "connectors": {
                            "azure": {
                                "type": "azureiot",
                                "config": {
                                    "connectionString": "HostName=RigadoExamples.azure-devices.net;DeviceId=C123431826-12345;SharedAccessKey=aGVsbG8K"
                                }
                            }
                        }
                    },
                    "filters": {
                        "agg": {
                            "type": "aggregate",
                            "config": {
                                "mode": "mapArray",
                                "key": "mac",
                                "interval": "10s",
                                "mapMax": 50
                            }
                        },
                        "ruuvi": {
                            "type": "ruuvi"
                        },
                        "inject": {
                            "type": "inject",
                            "config": {
                                "keyPairs": {
                                    "serial": "",
                                    "timestamp": ""
                                }
                            }
                        },
                        "publish": {
                            "type": "publish",
                            "config": {
                                "connector": "azure"
                            }
                        }
                    },
                    "pipelines": {
                        "ruuvi-pipe": {
                            "filters": [
                                "ruuvi",
                                "inject",
                                "agg",
                                "publish"
                            ]
                        },
                        "all-pipe": {
                            "filters": [
                                "inject",
                                "agg",
                                "publish"
                            ]
                        }
                    }
                }
            }
        }
    }
}