Project

General

Profile

Users Guide » History » Version 17

Hammel, 20 Sep 2019 15:13

1 10 Hammel
h1. Ironman Users Guide
2 1 Hammel
3 7 Hammel
table{border-collapse;width:100%}.
4 8 Hammel
|={font-size:140%;margin-bottom:15px;background-color:#fdd}. This document is under development and is likely not accurate at this time. |
5 7 Hammel
6 2 Hammel
{{>toc}}
7
8 3 Hammel
In this document the term _host system_ refers to a Linux desktop or laptop that will be used to download and install software
9
onto an SD card.
10 1 Hammel
11 10 Hammel
h2. Overview
12
13 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.
14 1 Hammel
15
|!http://redmine.graphics-muse.org/attachments/download/114!|
16
|={font-size:120%;margin-bottom:15px;background-color:#dff}. *Design Intent of the Ironman Project* |
17
|=. Mark I release is in progress.  Mark II and Mark III are future development plans.|
18
19 17 Hammel
_*Ironman*_ consists of the following components.
20 12 Hammel
21
| *Monitor* | The Nest-like control hub based on a Raspberry Pi 2/3 and the official 7" touchscreen display |
22
| *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
| *Controllers* | Network enabled control of Monitor managed devices |
25
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 17 Hammel
The _*Ironman*_ Monitor runs on a Raspberry Pi 2 or 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
h3. Installation Prerequisites
45 1 Hammel
46 11 Hammel
* A "Raspberry Pi 2 or 3":https://www.adafruit.com/product/3055
47
* The official "Raspberry Pi 7inch touchscreen display":https://www.sparkfun.com/products/13733
48
* The Pi 2/3 requires a "V / 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.
49 3 Hammel
* The Pi 2/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.
50 16 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 ared discussed in later sections.
51 5 Hammel
52 1 Hammel
<pre>
53 16 Hammel
                      ___
54
   Config/Pair Mode  |---|  Normal Mode
55
                   --------- 
56
                  |         |
57
                   --------- 
58
connector pins -->  |  |  |  
59
                    |  |   ------ Not connected
60
                    |  |
61
                    |  ----330 Ohm R-----
62
                    |  |                |
63
                    |  |  +-----LED------
64
                    |  |  |
65
          RPi pin   7  9  13     
66
         RPi GPIO   4  G  27
67 6 Hammel
</pre>
68 5 Hammel
69
* You will need to have sudo access for your Linux user id.
70 16 Hammel
71 3 Hammel
72 1 Hammel
h3. Generating the SD Card for the Pi
73 3 Hammel
74 1 Hammel
* Download the RPi 2 Development Platform 
75 4 Hammel
** _wget <url>_
76
** Unpack the archive to a directory called *image*.
77 17 Hammel
* Download the _*Ironman*_ Package Collection
78 4 Hammel
** _wget <url>_
79
** Unpack the archive to a directory called *package*.
80 3 Hammel
81 4 Hammel
In a terminal window run: _dmesg -w_
82 1 Hammel
Insert the microSD card and look for the device name for the newly added card.  It should be something like /dev/sdb or /dev/sde.
83 4 Hammel
Kill the _dmesg -w_ command with Ctrl-C.
84 3 Hammel
85 4 Hammel
From the *image* directory
86 1 Hammel
* Format the SD card
87 4 Hammel
** _sudo ./mksd.sh -d <device name>_
88 3 Hammel
** where <device name> is the name you noted from the output of dmesg -w.
89 1 Hammel
* Mount the boot partition from the sd card: 
90 4 Hammel
** _sudo mkdir -p /mnt/boot_
91
** _sudo mount <device name>1 /mnt/boot_
92 1 Hammel
** where <device name> is the name you noted from the output of dmesg -w.
93 4 Hammel
* Install the Development Platform to the SD card
94
** _sudo ./mkinstall.sh -b /mnt/boot -d <device name>2_ 
95 3 Hammel
** where <device name> is the name you noted from the output of dmesg -w.
96
97 4 Hammel
From the *package* directory
98 3 Hammel
* Mount the root partition from the sd card: 
99 4 Hammel
** _sudo mkdir -p /mnt/root_
100
** _sudo mount <device name>1 /mnt/root_
101 17 Hammel
* Copy the _*Ironman*_ Package Collection files to /root of the root partition on the SD card
102 4 Hammel
** _sudo cp *.opk /mnt/root/root_
103 3 Hammel
104
Make sure all writes to the SD card have completed
105 4 Hammel
* _sync;sync;sync_
106 3 Hammel
107
Unmount the SD card partitions
108 4 Hammel
* _sudo umount /mnt/boot_
109
* _sudo umount /mnt/root_
110 3 Hammel
111 4 Hammel
Remove the SD card from the host system and insert it into the Raspberry Pi 2.
112 1 Hammel
113
h3. First time boot
114
115
h3. Network configuration
116
117 9 Hammel
wlan0
118
119
* This interface is used for configuration of the Monitor.
120
* Configured on the 192.168.36.0 subnet.
121
** See /etc/network/dhcpd.conf.aponly
122
123
uap0
124
125
* This interface is used as an access point for IoT devices.
126
* Configured on the 192.168.3.0 subnet.
127
** See /etc/network/dhcpd.conf.uap and dhcpd.conf.uap.tmpl
128
** The template is used to change the base subnet through the web interface.
129
** The SSID is _ironman_.
130
131
<pre>
132
Pair/Config button is GPIO 4 (RPi pin 7)
133
Pair/Config LED is GPIO 7 (RPi pin 13)
134
	LED should only be lit on boot if button is enabled (in Config mode).
135
		In this case, we're in Config Mode to configure the networks.
136 17 Hammel
		The web server (imwww) is on SSID _ironman_ at 192.168.36.1:1337.
137 9 Hammel
	LED is off on boot if button is disabled (in Pair Mode).
138
	If in Pair Mode
139
		Start hostapd for aponly
140
		Start dhcpd for aponly on wlan0
141
		Start imrest web service on port 8165 for IoT devices and Jarvis interfaces.
142
	If in Config Mode
143
		Start wpa_supplicant on wlan0
144
		Create uap0 device as virtual device on wlan0
145
		Start dhcpd on uap0
146
		Start hostapd on uap0
147
		Start imwww for network configuration of the Monitor.
148
149
/etc/ironman/iot		Registration directory for IoT devices
150
/etc/ironman/jarvis		Registration directgory for Jarvis interfaces
151 14 Hammel
152
Apps
153
imcore					Package that updates a PiBox Development Platform for use with Ironman.
154
						Includes network configuration updates and other config files.
155
imwww					Contains two web servers
156
	imwww				Provides network configuration interface for Monitor
157
	imrest				Provides IoT/Jarvis REST API.  Updates /etc/ironman directories with registrations.
158
imgpio					Command line tool for querying GPIO pins using syfs interface.
159
launcher				Ironman specific launcher that adds clock interface to front panel.
160
pisensors				Provides UI for managing sensors.
161
						Uses inotify to watch for changes to /etc/ironman/iot directory.
162
picam   				Generic console camera interface (same as PiBox media systems)
163
appmgr, piboxd, omxplayer, pmsui, psplash, mjpg-streamer
164
						Same packages as in PiBox, unmodified
165 9 Hammel
</pre>
166
167
168 1 Hammel
h3. Pairing with IoT Sensors
169
170
h3. Pairing with Jarvis
171
172
h2. IoT Sensor
173
174
h3. Sensor Types
175
176
h4. Light Switch
177
178
h3. Flashing the firmware
179
180
h3. Power On
181
182
h3. Pairing with a Monitor
183
184
h2. Jarvis
185
186
h3. Prerequisites
187
188
h3. Pairing with a Monitor
189
190
h3. Supported Commands
191 15 Hammel
192
h2. Addendums
193
194
h3. Source Code Repositories
195
196
* PiBox
197
** Development Platform
198
** appmgr
199
** mjpg-streamer
200
** omxplayer
201
** piboxd
202
** picam
203
** pmsui
204
** psplash
205
* Ironman
206
** launcher
207
** monitor
208
** pisensor
209
** www
210
* Arduino
211
** Sensor Template (imlightsw)
212
213
h3. Fritzing Models
214
215
* ESP-01 Flasher
216
* Light Switch
217
** Keyes_SRly
218
** Hilink
219
* Monitor Switch