Project

General

Profile

Users Guide » History » Version 77

Hammel, 08 Apr 2025 21:26

1 10 Hammel
h1. Ironman Users Guide
2 1 Hammel
3 75 Hammel
table{border-width:0;width:100%}.
4
|={font-size:140%;margin-bottom:15px;color:blue}. Last updated: 2025-04-08 |
5 7 Hammel
6 2 Hammel
{{>toc}}
7
8 34 Hammel
In this document the term _host system_ refers to a Linux desktop or laptop that will be used to download and install software onto an SD card.
9 1 Hammel
10 10 Hammel
h2. Overview
11
12 17 Hammel
_*Ironman*_ is a home automation project based on the PiBox build system.  It supports a Nest-like monitor for controlling Arduino based sensors, cameras and remote voice control.
13 1 Hammel
14 43 Hammel
table{align=center}.
15 42 Hammel
|!{width:640px}http://redmine.graphics-muse.org/attachments/download/114!|
16 1 Hammel
|={font-size:120%;margin-bottom:15px;background-color:#dff}. *Design Intent of the Ironman Project* |
17 43 Hammel
|=. Mark I release is in progress.  Mark II and Mark III are future development plans. |
18 1 Hammel
19 17 Hammel
_*Ironman*_ consists of the following components.
20 12 Hammel
21 69 Hammel
| *Monitor* | The Nest-like control hub based on a Raspberry Pi 3 and the official 7" touchscreen display |
22 12 Hammel
| *Sensors* | Arduino based devices, such as door alarms and cameras, running code based on a sensor and camera templates for pairing and secure communication with the Monitor |
23
| *Jarvis*  | A Java application that supports voice control of Monitor managed devices |
24 70 Hammel
| *Controllers* | Network enabled control of Monitor managed devices and PiBox Systems such as PiStore and PiSentry |
25 12 Hammel
26 1 Hammel
h3. Security
27
28 17 Hammel
_*Ironman*_ supports AES encrypted communication with IoT sensors and Jarvis interfaces.
29 12 Hammel
30
h3. What it is
31
32 17 Hammel
_*Ironman*_ is a do-it-yourself system, where you buy the parts and assemble them as described, modifying the provided code to suit your needs and handling flashing and maintenence.  _*Ironman*_ is designed to allow you to build your own home automation system where you specify the devices you want to control and how you want to control them.  
33 12 Hammel
34
h3. What it is not
35
36 17 Hammel
_*Ironman*_ is not a product.  It is not intended for anyone other than Makers (aka DIY'ers) who like to tinker and see not just how to assemble things but why they actually work.
37 12 Hammel
38 17 Hammel
While the Users Guide is intended to bring up a currently working version of _*Ironman*_ with limited sensor and camera support, if you aren't prepared to deal with writing code or flashing devices and dealing with electrical circuits then _*Ironman*_ is not for you.
39 10 Hammel
40 1 Hammel
h2. The Ironman Monitor
41 3 Hammel
42 65 Hammel
The _*Ironman*_ Monitor runs on a Raspberry Pi 3 and provides a central hub for management of home automation devices.  It uses a 7" touch screen display and a mechanical switch to manage pairing with IoT devices and Jarvis interfaces.
43 3 Hammel
44 71 Hammel
%{background:yellow;letter-spacing:0.25em}The mechanical switch will be removed with upcoming versions of the sensors app and imrest server that run on the Ironman monitor.%
45
46 3 Hammel
h3. Installation Prerequisites
47 1 Hammel
48 66 Hammel
* A "Raspberry Pi 3":https://rpilocator.com/?country=US&cat=PI3
49 11 Hammel
* The official "Raspberry Pi 7inch touchscreen display":https://www.sparkfun.com/products/13733
50 66 Hammel
* The Pi 3 requires a "5V / 2A power supply":https://www.adafruit.com/product/1994.  For best results, use a power supply rated to at least 5.25V to avoid under voltage conditions.  For ease of use the power supply cable should include an "on/off switch":https://www.adafruit.com/product/2379.
51 72 Hammel
* A keyboard is not required for initial installation.  A "wireless keyboard":https://www.adafruit.com/product/922 should work as will a wired keyboard.  The keyboard will not be needed for normal operation but can be helpful in debugging.
52 1 Hammel
* The Pi 3 requires a microSD card that is at least 4GB.  A mechanism for using the SD card on your host system is needed, such as an SD card USB adapter or an SD port on your laptop.
53 71 Hammel
* A mechanical switch, such as a "SPDT":https://www.electronicshub.org/switches/#Single_Pole_Double_Throw_Switch_SPDT, should be connected to the Pi GPIOs to allow for pairing the Monitor with IoT Sensors and Jarvis interfaces.  The ASCII diagram below describes the setup. The LED is off in normal mode, lit in Config Mode, and off in Pair Mode until something tries to pair with the Pi which then turns on the LED for 3 seconds. Config and Pair mode operations are discussed in later sections.  A Fritzing Diagram (attachment:IronmanMonitorSwitch.fzz) is available for this hardware component.
54 30 Hammel
!>{width:300px}IronmanMonitorSwitchBreadboard.png(Ironman Monitor Switch)!
55 1 Hammel
<pre>
56 16 Hammel
                      ___
57
   Config/Pair Mode  |---|  Normal Mode
58
                   --------- 
59
                  |         |
60
                   --------- 
61
connector pins -->  |  |  |  
62
                    |  |   ------ Not connected
63
                    |  |
64
                    |  ----330 Ohm R-----
65
                    |  |                |
66
                    |  |  +-----LED------
67
                    |  |  |
68
          RPi pin   7  9  13     
69
         RPi GPIO   4  G  27
70 6 Hammel
</pre>
71 5 Hammel
72 27 Hammel
* You will need to have sudo access for your Linux user id.
73 1 Hammel
74
h3. Generating the SD Card for the Pi
75
76 71 Hammel
* Clone and build PiBox Development System
77
** git clone https://gitlab.com/pibox/pibox.git
78
** cd pibox
79
** _make pkg_
80
** The build artifacts will be in the "../pkg" directory
81
** export STAGING="$(pwd)/../bld/buildroot-<date>/output/staging"
82
** export XID="$(pwd)/../bld/crosstool-ng-1.25.0.bld/install
83
* Clone the metabuild repository and build the Ironman package set.
84
** git clone https://gitlab.com/pibox/metabuild.git
85
** cd metabuild
86
** _./build.sh -m ironman_
87
*** You need to set STAGING and XID variables before running this command
88
** The packages will be in ../pkg.
89 1 Hammel
* In a terminal window run: _dmesg -w_
90
* Insert the microSD card and note the device name displayed for the newly added card as displayed in the _dmesg -w_ terminal window.  It should be something like /dev/sdb or /dev/sde.
91 18 Hammel
* Kill the _dmesg -w_ command with Ctrl-C.
92 1 Hammel
93 71 Hammel
To install the PiBox Development System on the SD card.
94 1 Hammel
* Format the SD card
95 71 Hammel
** cd <pibox clone dir>/../pkg
96
** _./mksd.sh -d <device name>_
97 1 Hammel
** where <device name> is the name you noted from the output of _dmesg -w_.
98
* Mount the boot partition from the sd card: 
99
** _sudo mkdir -p /mnt/boot_
100
** _sudo mount <device name>1 /mnt/boot_
101 4 Hammel
** where <device name> is the name you noted from the output of _dmesg -w_.
102 18 Hammel
* Install the Development Platform to the SD card
103 71 Hammel
** _./mkinstall.sh -b /mnt/boot -d <device name>2 -o_ 
104 4 Hammel
** where <device name> is the name you noted from the output of _dmesg -w_.
105 1 Hammel
106 71 Hammel
%{background:yellow}You will need sudo access to run mksd and mkinstall.%
107 18 Hammel
108 71 Hammel
To install the Ironman package to the SD card.
109
* Mount the data partition from the sd card: 
110
** _sudo mkdir -p /mnt/data_
111
** _sudo mount <device name>1 /mnt/data_
112
* Copy the _*Ironman*_ packages to the SD card
113
** cd <metaboot clone dir>/../pkg
114
** _sudo cp *.opk /mnt/data/opkg/incoming_
115
** _sudo touch /mnt/data/opkg/incoming/.install_
116
117 4 Hammel
Make sure all writes to the SD card have completed
118 3 Hammel
* _sync;sync;sync_
119
120 4 Hammel
Unmount the SD card partitions
121
* _sudo umount /mnt/boot_
122 71 Hammel
* _sudo umount /mnt/data_
123 4 Hammel
124 71 Hammel
Remove the SD card from the host system and insert it into the Raspberry Pi 3.
125 1 Hammel
126
h3. First time boot
127 26 Hammel
128 22 Hammel
Power on the Monitor and wait for it to complete installation.  During this time the display may be upside down.  Once initial installation is complete the display will be right side up.
129
130 72 Hammel
%{background:yellow}Right side up for the monitor is when the power supply is connected at the top.%
131 22 Hammel
132
The Monitor is now fully installed and ready for use.  At this point the keyboard can be removed though you may want to leave it connected for debugging purposes.
133 44 Hammel
134 22 Hammel
h3. First time configuration
135
136 72 Hammel
%{background:yellow}This section will be replaced when PiNet is ported to Ironman.%
137
138 24 Hammel
!>{width:300px}ironman-config-ui.png(Ironman Config UI)!
139 22 Hammel
140
Turn the power off and set the Mode switch to Config/Pair, then power the Monitor back on.  The LED should light indicating the Monitor is ready to be configured.
141
142
Use a smartphone or laptop with wifi to connect to the "ironman" SSID.  The default password is _ironman1_.  Then use a browser to connect to the Ironman web UI at 
143
144
  http://192.168.36.1:1337
145 25 Hammel
146
The display should be as shown in the adjacent photo.  There are two network domains to configure, as described in the following table.
147
148
|_. Domain |_. Description |
149
| Internet Connection | This is how the Monitor will connect to your home network. |
150 22 Hammel
| Sensors Network | This is how the Monitor will communicate with your IoT devices. |
151 36 Hammel
152
After both networks are configured, power off the Monitor and set the Mode switch to Normal, then power the Monitor on.  The Monitor is now ready to use with IoT sensors, Jarvis and controllers.
153 1 Hammel
154
h3. Network configuration
155 34 Hammel
156
The Monitor's hardware supports WiFi B/G/N networks.  However, in order to use the Monitor as both a WiFi client on the local
157
network and as an Access Point for IoT devices, only G networks are supported by the Ironman software.
158
159
h4. Internet Connection
160
161
The Internet Connection domain configures the Monitor to connect to your local network.  
162
163
|_. Field |_. Description |
164
|Location |Unique name for this monitor, such as Bedroom or Office.  This name is used to identify monitors by name via commands from Jarvis or other remote controllers|
165
|SSID |Network name configured on your router for your local WiFi network. |
166
|Security | Type of security used on your router. Only WPA2 Personal and WPA2 Enterprise are currently supported. |
167
|Password | Your router's password, specifically for the SSID entered previously. |
168
169
The *Show Password* button will display the password typed in the Password field.  By default this button is not enabled, causing the Password field to be hidden using asterisks for each character.
170
171
h4. Sensor Network
172
173
The Sensor Network domain is used to configure the Monitor's private network used with IoT devices.  Data on this network is not routed to the Internet Connection and data from the Internet Connection domain are not routed to the Sensor Network.
174
175
|_. Field |_. Description |
176
|SSID |Network name for this private WiFi network. This name will be hidden on Wifi scans.|
177
|Channel | Channel to use.  Select a channel that has low use in your neighborhood.  Only a subset of channels on G networks are available.  This will be addressed in future releases. |
178
|Password | Password IoT devices should use to gain access to the specified SSID. |
179 1 Hammel
|Static IP | An IP address to give the Monitor as it acts as an Access Point. This should be a Class C subnet for the network, which limits the number of IoT devices that can be managed by a single Monitor to 254. |
180 34 Hammel
181 1 Hammel
The *Show Password* button will display the password typed in the Password field.  By default this button is not enabled, causing the Password field to be hidden using asterisks for each character.
182 34 Hammel
183 38 Hammel
h2. IoT Sensor
184 1 Hammel
185 38 Hammel
h3. Sensor Types
186 1 Hammel
187 72 Hammel
There is currently two sensor types:  pwrctrl (power control for outlets) and pwremote (remote for 433MHz managed outlets).  
188 68 Hammel
189 72 Hammel
The sensor template GIT repository, which is the imlightsw (historical name) repo, is intended to be used to design additional sensor types, such as door and window alarms, window shade controllers, environment sensors and so forth.  These all are based on the pwrctrl source for registration and communicating with the Ironman monitor.
190 68 Hammel
191 38 Hammel
h4. Light Switch
192
!>{width:300px}imlightsw.png(Ironman Light Switch)!
193 47 Hammel
194 72 Hammel
%{color:blue}The following describes use of the pwrctrl sensor.  The same process works with the pwremote for connecting to a WiFi network and registering with an Ironman monitor. Note that if the code is compiled with the SERIAL=1 environment variable then the Blue LED is not used and only the FTDI serial output is used.%
195 50 Hammel
196 72 Hammel
This prototype pwrctrl sensor (attachment:imlightsw-with-relay-2.fzz) uses a relay to power an LED on and off, simulating enabling and disabling an outlet via a relay.  The breadboard power supply can be replaced with an "HLK-PM01":http://www.hlktech.net/product_detail.php?ProId=54 and an "LM3671 5V to 3.3v buck converter":https://www.adafruit.com/product/2745 to power the board from mains (110v).
197
198 51 Hammel
The FTDI connection is used to connect and "FTDI Basic board":https://www.sparkfun.com/products/9873 so that a the output from the ESP-01 can be viewed in a terminal program.
199
200
The ESP-01 has a Blue LED that is used to provide visual information using blink patterns.
201 1 Hammel
202 51 Hammel
h5. Config Button
203
204
This button has multiple uses, depending on where it is used.  
205
206
_AP Config Mode_
207 1 Hammel
208 55 Hammel
AP Config Mode means the device is running as an WiFi Access Point, allowing you to connect to it via a web browser to configure the device for use on a Monitor's Sensor network.
209 51 Hammel
210 68 Hammel
* AP Config mode is disabled by default, that is, when the Config Button is in the off position.
211 51 Hammel
* If Config Button is ON at boot, pwrctrl enters AP config mode.  In this mode the LED will blink twice and then stop.  Once the device is connected to a Monitor's Sensor network it will blink 4 times.
212 72 Hammel
* After configuration is complete, button must be set OFF and device power cycled.  At this point the pwrctrl device will be connected to the configured WiFi network.
213 51 Hammel
214
_Pair Mode_
215 68 Hammel
216 1 Hammel
Pair Mode is used to pair the pwrctrl device with an Ironman Monitor.  Pairing involves the exchange of secret keys that will be used to encrypt messages between the Monitor and the pwrctrl device.
217
218 77 Hammel
%{background-color:cyan}Pairing between Ironman's Monitor and Sensors uses the Multicast IP address of 239.1.42.3. %
219
220 51 Hammel
* The Config Button is OFF at boot.
221 72 Hammel
* After boot, the Config Button is turned on and pwrctrl enters PAIR mode.  In this mode the blue LED stays on.
222 55 Hammel
* After the device has paired with a Monitor the blue LED blinks.
223 51 Hammel
* The Config Button must be turned off for normal operation.
224
225
h5. Blue LED Blink Patterns
226
227
A _blink_ implies the LED turns on and then off.
228
229
|_. LED State |_. Blink Speed |_. Blink Count |_. Device Mode |
230 72 Hammel
|Blink        | 1/sec         | 2             | Entered AP Config Mode |
231
|Blink        | 1/sec         | 4             | Device is connected to monitor |
232
|Blink        | 1/.125 sec    | 5             | Device failed to connect to monitor |
233
|Solid On     | N/A           | N/A           | Entered Pair Mode |
234 51 Hammel
|Blink        | 2/.150 sec then 1/.200 sec | continuous             | Waiting to Pair with Monitor|
235 72 Hammel
|Blink        | 1/.100 sec    | 3             | Not currently paired with Monitor|
236 51 Hammel
237
h5. Reset Button
238 68 Hammel
239 51 Hammel
The Reset Button is used to return the pwrctrl to it's initial state, prior to configuration and pairing.  If the device is reset it will need to be configured to use the network again as well as paired with an Ironman Monitor before it can be managed.
240
241
* The Reset Button is ON at boot.
242
* The device removes all configuration from itself.
243
* The Reset Button must be turned off, then the device can be rebooted and reconfigured.
244
245
table{border-collapse;width:100%}.
246 49 Hammel
|={font-size:120%;margin-bottom:15px;background-color:#fdd}.  The Reset Button is not connected in code currently due to the limit on GPIO pins in the ESP-01.  To fully reset the ESP-01 you must compile the code with RESET=1, flash and run the code, then recompile with RESET=0 (or not specified on the command line) and flash again. |
247 56 Hammel
248
h3. Setting up to use the code
249
250
h4. Prerequisites
251
252
* ESP-01 connected to your serial port using an FTDI board
253
** Try the one from "SparkFun":https://www.sparkfun.com/products/9873
254
* You have proper power to the ESP-01
255
** You need 3.3V for the ESP-01.
256
** You need 5V for the power relay.
257
** Try this board from "Amazon":https://smile.amazon.com/gp/product/B010UJFVTU/ref=oh_aui_detailpage_o03_s00?ie=UTF8&psc=1. It can supply both 3.3V and 5V power on a half size breadboard like this one from "Adafruit":https://www.adafruit.com/product/64
258
* Other parts you might want
259
** ESP-01 "breadboard adapter":https://www.addicore.com/ProductDetails.asp?ProductCode=AD-BB-ADTR
260
** "Logic Level Converter":https://www.sparkfun.com/products/12009
261
** "5V 1-Channel Relay":https://www.ebay.com/itm/5V-10A-one-1-Channel-Relay-Module-With-optocoupler-For-PIC-AVR-DSP-ARM-Arduino/310636242802?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649 board
262
263
h4. Arduino Setup
264
265 73 Hammel
This build is a wrapper around the Arduino-CLI.  It makes use of GNU Make targets with rules that call Arduino-CLI features to build the code.  It requires the "Arduino-CLI":https://docs.arduino.cc/arduino-cli/installation/ to have been previously installed.
266 56 Hammel
267 73 Hammel
h4. Required Libraries
268 56 Hammel
269 73 Hammel
This section describes required libraries.  However, it is no longer necessary to install these as the build system takes care of this automatically.
270
271 56 Hammel
|_. Required Arduino libraries |_. URL |
272
|AES|            https://github.com/spaniakos/AES/|
273
|Timer|          https://github.com/JChristensen/Timer.git|
274
|WiFiManager|    https://github.com/tzapu/WiFiManager.git
275
                 tag: 0.12
276
                 commit: 04d47882a7d662b46bb1b1dbecfe786e5bc9efa4 |
277
|aJson|          https://github.com/interactive-matter/aJson.git
278
                 Requires patch in patch/ directory. |
279 1 Hammel
|aREST|          https://github.com/marcoschwartz/aREST.git|
280
|arduino-base64| https://github.com/adamvr/arduino-base64
281 56 Hammel
                 Requires patch in patch/ directory. |
282
283
Notes on libraries
284
* AES library:  Remove the examples or the build will probably fail.
285
286 1 Hammel
h4. The pwrctrl Code
287
288 56 Hammel
The code is required to do flash updates to the ESP-01.  Before starting, be sure to install "cdtools":https://gitlab.com/cdtools/cdtools.
289 1 Hammel
290 68 Hammel
* Clone the software: _git clone https://gitlab.com/xarduino/lightsw.git_
291 56 Hammel
* Copy _lightsw/docs/arduino.sh_ to your cdtools directory (_~/bin/env_) and edit as appropriate.
292
* Setup your environment for the build:
293
**  _. cdtools_
294 1 Hammel
**  _ard lightsw_
295 56 Hammel
**  _cd?_ (to see what you can do with cdtools in this repository)
296 1 Hammel
* Change to this repos directory: _cdx_
297 56 Hammel
298
h3. Flashing the firmware
299 73 Hammel
!>{width:300px}imlightsw-flasher.png(Ironman pwrctrl Flasher)!
300 56 Hammel
301 73 Hammel
This prototype pwrctrl (attachment:imlightsw-flasher.fzz) is used to program the ESP-01.  A separate flasher circuit like this is required due to the limited number of GPIO pins on the ESP-01.
302 38 Hammel
303 53 Hammel
The "FTDI Basic board":https://www.sparkfun.com/products/9873 is required to connect the ESP-01 to a computer over a USB port.  On Linux, the port will show up as /dev/ttyUSB0 or similar.  
304
305 1 Hammel
The code must be built before it can be flashed to the ESP-01.
306 56 Hammel
307 73 Hammel
* _make pwrctrl_
308
** Binary is in ../bld/pwrctrl/*.bin
309
* _make RESET=1 pwrctrl_
310 56 Hammel
** This causes stored data in the ESP-01 to be erased on power up.  After that, you need to reflash without this flag.
311 73 Hammel
* _make SERIAL=1 pwrctrl_
312 56 Hammel
** This causes the code to use the TX line for serial output for debugging purposes.  If this is not set then the blue LED is used instead and there is not serial console output.
313
314
Finally, to flash the updated image to the ESP-01 use the _upload_ target.
315
316 73 Hammel
* _make pwrctrl-upload_
317 56 Hammel
318
An IoT sensors must be configured to operate on the same network as the Monitor's Sensor Network.  Once this has been done the IoT sensor and the Monitor can be paired.  An IoT device can only be paired with a single Monitor.
319 73 Hammel
320 61 Hammel
h3. Connect Serial Terminal to IoT Device
321
322 1 Hammel
!>{width:300px}minicom.png(Sample minicom session)!
323
324 74 Hammel
It helps, at this stage of development, to see what the ESP-01 thinks is happening while configuring it.  This can be done by connecting the FTDI Basic connector to a USB connector on a laptop.  The pwrctrl code should have been built with the SERIAL=1 environment variable.
325 58 Hammel
326
* Connect the FTDI Basic to a USB port on the laptop.
327
* Check the laptop for a port such as /dev/ttyUSB0 (this may be different on different Linux distributions).
328
* Use _minicom_ or a similar serial communication program and connect it to /dev/ttyUSB0
329
** Baud: 115200
330
** No parity
331
** 1 stop bit
332
** Terminal type should be set to ANSI (you might get garbage characters otherwise)
333 1 Hammel
334 58 Hammel
You can now watch the progress of the ESP-01 as it processes hardware and software changes in the following sections.
335
336 74 Hammel
h3. Configuring the pwrctrl to connect to the Monitor's Sensor Network
337 1 Hammel
338
!>{width:300px}iotwebui.png(IoT Device Configuration)!
339 62 Hammel
340 74 Hammel
The pwrctrl sensor has it's own WiFi Access Point at 192.168.4.1 with no password.  This is used to configure the device to connect to the Monitor's Sensor Network.
341 1 Hammel
342
* Set the Mode button to Config. 
343 74 Hammel
* Power on the pwrctrl sensor.  The device will start an access point (AP) and a web server for configuring the device to connect to another network.
344 57 Hammel
* Connect a laptop or smartphone to the _imiot_ SSID.  An IP will be assigned automatically to the laptop or smartphone.
345
* If connecting to the _imiot_ SSID does not automatically open a browser page to the IoT device's WiFi configuration page, then manually open a browser to http://192.168.4.1.
346
347
The configuration page looks like the image to the right.  This page has multiple options.  Only the first is needed to configure to the Sensor Network.
348
349 76 Hammel
%{background-color:yellow}This section needs updating.%
350
351 1 Hammel
* Click on ...tbd...
352 57 Hammel
* A scan of local WiFi access points will be shown.
353
* Choose the SSID configured for the Monitor's Sensor Network.
354
* Type in the password configured for the Monitor's Sensor Network.
355
* Click on ...tbd...
356
357 74 Hammel
At this point the device will attempt to connect to the Monitor and retrieve an IP address.  Wait about 1 minute for this to complete.  Once connected, it is safe to restart the pwrctrl sensor.
358 1 Hammel
359 74 Hammel
* Turn the sensor off.
360 1 Hammel
* Turn the Mode button to Normal.
361 74 Hammel
* Power on the sensor.
362 57 Hammel
363
The device is now ready for pairing with the Monitor.
364
365 1 Hammel
h3. Pairing with a Monitor
366 38 Hammel
367 74 Hammel
Pairing is the process where the sensor registers with the Ironman Monitor.  Registration establishes device-specific encryption between the sensor and the monitor and provides a means by which automated updates can be sent from the sensor to the monitor and the monitor can send commands for sensor changes.
368 63 Hammel
369 74 Hammel
!>{width:300px}iotpair.png(Device pairing in Minicom session)!
370
371 59 Hammel
* With the Monitor running, set the Monitor Mode switch to Pair.
372 74 Hammel
* Power on the pwrctrl sensor.
373
* Turn the Mode button on the sensor to Config.
374
* Wait for it to pair with the Monitor.  When pairing is completed the Monitor's Mode Button LED will flash for 1 second and the Blue LED on the pwrctrl sensor will light for 3 seconds.
375 59 Hammel
** The Monitor's Sensor app will show a new device that can now be managed from the Monitor.
376
* Turn the Mode switch to Normal on the Monitor.
377 74 Hammel
* Turn the pwrctrl sensor off.
378
* Turn the Mode button on the pwrctrl sensor to Normal.
379
* Power on the pwrctrl sensor.
380 59 Hammel
381 74 Hammel
The pwrctrl sensor can now be managed by the Monitor's Sensor App.
382 9 Hammel
383
table{border-collapse;width:100%}.
384 1 Hammel
|={font-size:140%;margin-bottom:15px;background-color:#fdd}. *WARNING!* |
385 74 Hammel
|={font-size:120%;margin-bottom:15px;background-color:#fdd}.  Leaving the Mode switch turned to Pair will allow random devices to attempt to pair with the Monitor.  This is a security risk.  The Mode switch should only be set to Pair long enough to pair with an pwrctrl sensor. |
386 1 Hammel
387
h2. Jarvis
388 76 Hammel
389
Jarvis is a Java application supporting voice control of Ironman Monitor supported devices.
390
391
%{background-color:yellow}This section needs updating.%
392 1 Hammel
393
h3. Prerequisites
394
395 38 Hammel
h3. Pairing with a Monitor
396
397
* With the Monitor running, set the Monitor Mode switch to Pair.
398 1 Hammel
* TBD
399
400
h3. Supported Commands
401 35 Hammel
402
h2. Addendums
403 40 Hammel
404 35 Hammel
h3. Ironman Packages
405 40 Hammel
406 74 Hammel
|_. Package   |_. Repository |_. Description |
407
|imcore       |monitor       |Package that updates a PiBox Development Ssytem for use with Ironman.  Includes network configuration updates and other config files. |
408
|imwww        |www           |Provides network configuration interface for Monitor (to be replaced with PiNet) |
409
|imrest       |imrest        |Provides IoT/Jarvis REST API for registrations, status and command.|
410
|imgpio       |gpio          |Command line tool for querying GPIO pins using syfs interface. (Will be deprecated.)|
411
|launcher     |launcher      |Ironman uses the PiBox launcher with a custom configuration. |
412
|pisensor     |pisensor      |Provides UI for managing sensors.  Uses inotify to watch for changes to registration files, which contains status information. |
413
|picam        |picam         |Generic console camera interface (same as PiBox Media Systems and PiSentry) |
414 40 Hammel
415 74 Hammel
All packages are built via the metabuild repository using the _build.sh -m ironman_ command.
416
417 1 Hammel
h3. Source Code Repositories
418
419 39 Hammel
* PiBox
420
** "Development Platform":https://gitlab.com/pibox/pibox
421
** "appmgr":https://gitlab.com/pibox/appmgr
422
** "mjpg-streamer":https://gitlab.com/pibox/mjpg-streamer
423
** "omxplayer":https://gitlab.com/pibox/omxplayer
424
** "piboxd":https://gitlab.com/pibox/piboxd
425
** "picam":https://gitlab.com/pibox/picam
426
** "pmsui":https://gitlab.com/pibox/pmsui
427 1 Hammel
** "psplash":https://gitlab.com/pibox/psplash
428 39 Hammel
* Ironman
429
** "gpio":https://gitlab.com/xironman/gpio
430
** "launcher":https://gitlab.com/xironman/launcher
431
** "monitor":https://gitlab.com/xironman/monitor
432
** "pisensor":https://gitlab.com/xironman/sensors
433
** "www":https://gitlab.com/xironman/www
434 1 Hammel
** "meta build":https://gitlab.com/xironman/meta
435 39 Hammel
* Arduino
436 74 Hammel
** "pwrctrl (imlightsw) and other sensors":https://gitlab.com/xarduino/lightsw
437 1 Hammel
438
h3. Fritzing Models
439 54 Hammel
440
* ESP-01 Flasher: attachment:imlightsw-flasher.fzz
441
* Light Switch: attachment:imlightsw-with-relay-2.fzz
442
** "ESP8266":https://github.com/ydonnelly/ESP8266_fritzing
443
** "Keyes_SRly":https://github.com/rwaldron/fritzing-components
444
** "Breadboard Power Supply":https://github.com/AchimPieters/Fritzing-Custom-Parts/blob/master/YwRobot%20Breadboard%20Power%20Supply.fzpz
445 35 Hammel
** "Hilink HLK-PM01":http://forum.fritzing.org/t/hlk-pm01-ac-dc-220v-to-5v/381
446 54 Hammel
* Monitor Switch: attachment:IronmanMonitorSwitch.fzz
447 35 Hammel
448
449
h3. Networking Internals
450
451
<pre>
452
wlan0
453
454
* This interface is used for configuration of the Monitor.
455
* Configured on the 192.168.36.0 subnet.
456
** See /etc/network/dhcpd.conf.aponly
457
458
uap0
459
460
* This interface is used as an access point for IoT devices.
461
* Configured on the 192.168.3.0 subnet.
462
** See /etc/network/dhcpd.conf.uap and dhcpd.conf.uap.tmpl
463
** The template is used to change the base subnet through the web interface.
464
** The SSID is _ironman_.
465
</pre>
466
467 74 Hammel
h3. Monitor Pair Button Usage
468 35 Hammel
469
<pre>
470
Pair/Config button is GPIO 4 (RPi pin 7)
471
Pair/Config LED is GPIO 7 (RPi pin 13)
472
	LED should only be lit on boot if button is enabled (in Config mode).
473
		In this case, we're in Config Mode to configure the networks.
474
		The web server (imwww) is on SSID _ironman_ at 192.168.36.1:1337.
475
	LED is off on boot if button is disabled (in Pair Mode).
476
	If in Pair Mode
477
		Start hostapd for aponly
478
		Start dhcpd for aponly on wlan0
479
		Start imrest web service on port 8165 for IoT devices and Jarvis interfaces.
480
	If in Config Mode
481
		Start wpa_supplicant on wlan0
482
		Create uap0 device as virtual device on wlan0
483
		Start dhcpd on uap0
484
		Start hostapd on uap0
485
		Start imwww for network configuration of the Monitor.
486
</pre>
487
488
h3. Monitor IoT Directories
489
490
<pre>
491 74 Hammel
/home/httpd/imrest/ironman/iot		Registration directory for IoT devices
492
/home/httpd/imrest/ironman/jarvis	Registration directgory for Jarvis interfaces
493 41 Hammel
</pre>
494 45 Hammel
495
h2. Privileged Apps
496
497
Some applications must be privileged in order to perform their functions, such as the camera.  The terminal application is not privileged by default.  It can be made privileged with the following steps.
498
499
# Power down the Monitor.
500
# Remove the SD card and mount it into your laptop or desktop computer.
501
# Edit this file on the SD card:  /etc/appmgr.priv
502
# Add this line:  /usr/bin/xterm
503
# Save the file and unmount the SD card.
504
# Remove the SD card from the laptop or desktop.
505
# Replace the SD card in the Monitor.
506
# Power up the Monitor.
507
508
The terminal application will now have privileged access on the monitor.
509 41 Hammel
510 1 Hammel
h2. File Attachments