Project

General

Profile

Users Guide » History » Version 11

Hammel, 20 Sep 2019 10:14

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
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.  Ironman consists of the following components.
14
15
| *Monitor* | The Nest-like control hub based on a Raspberry Pi 2/3 and the official 7" touchscreen display |
16
| *Sensors* | Arduino based devices running code based on a sensor template for pairing and secure communication with the Monitor |
17
| *Jarvis*  | A Java application that supports voice control of Monitor managed devices |
18
19
|!http://redmine.graphics-muse.org/attachments/download/114!|
20
|={font-size:120%;margin-bottom:15px;background-color:#dff}. *Design Intent of the Ironman Project* |
21
|=. Mark I release is in progress.  Mark II and Mark III are future development plans.|
22
23
h3. Security
24
25
Ironman supports AES encrypted communication with IoT sensors and Jarvis interfaces.
26
27 1 Hammel
h2. The Ironman Monitor
28 3 Hammel
29 10 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.
30 3 Hammel
31
h3. Installation Prerequisites
32 1 Hammel
33 11 Hammel
* A "Raspberry Pi 2 or 3":https://www.adafruit.com/product/3055
34
* The official "Raspberry Pi 7inch touchscreen display":https://www.sparkfun.com/products/13733
35
* 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.
36 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.
37 10 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 lit in normal mode and off in Pair Mode until something tries to pair with the Pi.
38 5 Hammel
39
<pre>
40
                    ___
41
           Normal  |---|  Pair Mode
42
                 --------- 
43
                |         |
44
                 --------- 
45
        pins -->  |  |  |  
46
47
       RPi GPIO   4  G  27
48 6 Hammel
        RPi pin   7  9  13     
49
                     |  |
50
                     |  +---LED---+
51
                     |            |
52
                     +---330 R----+
53 5 Hammel
</pre>
54
55 6 Hammel
* You will need to have sudo access for your Linux user id.
56 3 Hammel
57 1 Hammel
h3. Generating the SD Card for the Pi
58 3 Hammel
59 1 Hammel
* Download the RPi 2 Development Platform 
60 4 Hammel
** _wget <url>_
61
** Unpack the archive to a directory called *image*.
62 1 Hammel
* Download the Ironman Package Collection
63 4 Hammel
** _wget <url>_
64
** Unpack the archive to a directory called *package*.
65 3 Hammel
66 4 Hammel
In a terminal window run: _dmesg -w_
67 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.
68 4 Hammel
Kill the _dmesg -w_ command with Ctrl-C.
69 3 Hammel
70 4 Hammel
From the *image* directory
71 1 Hammel
* Format the SD card
72 4 Hammel
** _sudo ./mksd.sh -d <device name>_
73 3 Hammel
** where <device name> is the name you noted from the output of dmesg -w.
74 1 Hammel
* Mount the boot partition from the sd card: 
75 4 Hammel
** _sudo mkdir -p /mnt/boot_
76
** _sudo mount <device name>1 /mnt/boot_
77 1 Hammel
** where <device name> is the name you noted from the output of dmesg -w.
78 4 Hammel
* Install the Development Platform to the SD card
79
** _sudo ./mkinstall.sh -b /mnt/boot -d <device name>2_ 
80 3 Hammel
** where <device name> is the name you noted from the output of dmesg -w.
81
82 4 Hammel
From the *package* directory
83 3 Hammel
* Mount the root partition from the sd card: 
84 4 Hammel
** _sudo mkdir -p /mnt/root_
85
** _sudo mount <device name>1 /mnt/root_
86 3 Hammel
* Copy the Ironman Package Collection files to /root of the root partition on the SD card
87 4 Hammel
** _sudo cp *.opk /mnt/root/root_
88 3 Hammel
89
Make sure all writes to the SD card have completed
90 4 Hammel
* _sync;sync;sync_
91 3 Hammel
92
Unmount the SD card partitions
93 4 Hammel
* _sudo umount /mnt/boot_
94
* _sudo umount /mnt/root_
95 3 Hammel
96 4 Hammel
Remove the SD card from the host system and insert it into the Raspberry Pi 2.
97 1 Hammel
98
h3. First time boot
99
100
h3. Network configuration
101
102 9 Hammel
wlan0
103
104
* This interface is used for configuration of the Monitor.
105
* Configured on the 192.168.36.0 subnet.
106
** See /etc/network/dhcpd.conf.aponly
107
108
uap0
109
110
* This interface is used as an access point for IoT devices.
111
* Configured on the 192.168.3.0 subnet.
112
** See /etc/network/dhcpd.conf.uap and dhcpd.conf.uap.tmpl
113
** The template is used to change the base subnet through the web interface.
114
** The SSID is _ironman_.
115
116
<pre>
117
Pair/Config button is GPIO 4 (RPi pin 7)
118
Pair/Config LED is GPIO 7 (RPi pin 13)
119
	LED should only be lit on boot if button is enabled (in Config mode).
120
		In this case, we're in Config Mode to configure the networks.
121
		The web server (imwww) is on SSID "ironman" at 192.168.36.1:1337.
122
	LED is off on boot if button is disabled (in Pair Mode).
123
	If in Pair Mode
124
		Start hostapd for aponly
125
		Start dhcpd for aponly on wlan0
126
		Start imrest web service on port 8165 for IoT devices and Jarvis interfaces.
127
	If in Config Mode
128
		Start wpa_supplicant on wlan0
129
		Create uap0 device as virtual device on wlan0
130
		Start dhcpd on uap0
131
		Start hostapd on uap0
132
		Start imwww for network configuration of the Monitor.
133
134
/etc/ironman/iot		Registration directory for IoT devices
135
/etc/ironman/jarvis		Registration directgory for Jarvis interfaces
136
</pre>
137
138
139 1 Hammel
h3. Pairing with IoT Sensors
140
141
h3. Pairing with Jarvis
142
143
h2. IoT Sensor
144
145
h3. Sensor Types
146
147
h4. Light Switch
148
149
h3. Flashing the firmware
150
151
h3. Power On
152
153
h3. Pairing with a Monitor
154
155
h2. Jarvis
156
157
h3. Prerequisites
158
159
h3. Pairing with a Monitor
160
161
h3. Supported Commands