-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathREADME
More file actions
121 lines (87 loc) · 4.88 KB
/
README
File metadata and controls
121 lines (87 loc) · 4.88 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
These have been run on a Raspberry Pi and OSX Sierra with Edgent-1.1.0.
See Installation and Setup below.
Applications:
EdgentFaceDetectApp - a basic Edgent app that uses a DirectProvider
and an Edgent IotDevice based connector to
publish face detection events and receive
device commands.
Use the --mqtt option to connect to a general
MQTT broker (more below). Otherwise, the app connects
to IBM Watson IoT Platform IoT hub.
The app opens a local window and renders camera
frames augmented with bounding boxes around
detected faces.
For MQTT mode, use the Mqtt*Client apps.
For WIoTP mode, non-quickstart mode use Wiotp*Client apps.
For quickstart mode open your browser to
the printed URL to see published face detection events.
EdgentFaceDetectIotProviderApp - A version of the code that uses an IotProvider,
hence the application responds to device commands
from {Mqtt,Wiotp}FaceDetectCmdAppClient.
{Mqtt,Wiotp}FaceDetectAppClient - a MQTT/WIoTP Application Client that listens for
published face detection events and renders the images.
Does not work with against a quickstart mode device.
{Mqtt,Wiotp}WiotpFaceDetectCmdAppClient - a MQTT/WIoTP Application Client the publishes
device commands to control the device.
Only works for Edgent IotProvider based apps.
A no-op for EdgentFaceDetectApp.
Installation and Setup:
OSX Sierra
- get Edgent 1.1.0 binary bundle from http://edgent.apache.org/docs/downloads
and extract it
- install OpenCV - see README-OpenCV-OSX
Raspberry Pi
- get Edgent 1.1.0 binary bundle from http://edgent.apache.org/docs/downloads
and extract it
- install OpenCV - see README-OpenCV-Pi
You have a couple of choices for the IoT hub that the device connects to:
- A message hub that supports MQTT such as Apache ActiveMQ.
In this case the device application utilizes the Edgent MqttDevice connector.
- Edgent has an Apache Kafka connector but it doesn't currently have
an IotDevice based connector to Kafka. The device app currently
expects the use of an IotDevice based connector.
Adding a "KafkaDevice" (IotDevice interface to Kafka) can be easily
added to Edgent should the need arise. Alternatively, the device
application can easily changed (EdgentFaceDetectApp.publishEvents())
to directly use the Kafka connector or any other connector.
- IBM Watson IoT Platform. WIoTP supports MQTT but organizes
device event and command topics in a stylized way. In this case
the device application utilizes the Edgent IotpDevice connector.
Basic MQTT IoT message hub
- stand up your own MQTT broker such as Apache ActiveMQ
or utilize an existing MQTT broker instance. Adjust scripts/mqtt.device
accordingly for the URL to the broker. Use the "--mqtt" command line
option when starting the Edgent device application and use the Mqtt based
simple client applications.
TODO: write a simple client app that starts up a local
ActiveMQ instance to run against.
IBM Watson IoT Platform
- https://internetofthings.ibmcloud.com
Scroll down to "Try it out for free!"
You don't need to do anything for quickstart, just run
"EdgentFaceDetectApp --quickstart" and open the URL it prints out
in your browser.
Click "Launch Bluemix" to create a free account and register a device
and application.
To use an MQTT server instead of WIoTP, start your own MQTT server,
or try a public one, and update scripts/mqtt-device.cfg accordingly.
Building and running the apps
Building from the command line:
$ cd scripts
$ ./build.sh
Running the apps from the command line:
$ cd scripts
$ cat README
Exporting to another system:
After building you can create a tarball to bring the apps over to
another host where Edgent and OpenCV are installed and run from there.
$ tar czf builtSmartCameraDevice.tgz smartcamera.device # the whole project dir
on another system - e.g., a setup Pi
$ tar zxf builtSmartCameraDevice.tgz
$ cd smartcamera.device/scripts
$ cat README
Using Eclipse:
Import the smartcamera.device project into Eclipse. You'll have to
adjust the project's build path to take into account where you installed
Edgent and OpenCV. You can run the applications directly from Eclipse.
e.g. select EdgentFaceDetectIotProviderApp.java > Run as > Java Application