Project

General

Profile

Users Guide » History » Version 9

Hammel, 19 Sep 2019 17:18

1 1 Hammel
h1. Users Guide
2
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 3 Hammel
h2. The Ironman Monitor
12
13
The Ironman Monitor runs on a Raspberry Pi 2 or 3 and provides a central hub for management of home automation devices.
14
15
h3. Installation Prerequisites
16
17 4 Hammel
* The Pi 2/3 requires a 5V / 2A power supply.  For best results, use a power supply rated to at least 5.25V to avoid under voltage conditions.
18 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.
19 5 Hammel
* A switch should be connected to the Pi GPIOs to allow for pairing the Monitor with IoT Sensors and Jarvis.  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.
20
21
<pre>
22
                    ___
23
           Normal  |---|  Pair Mode
24
                 --------- 
25
                |         |
26
                 --------- 
27
        pins -->  |  |  |  
28
29
       RPi GPIO   4  G  27
30 6 Hammel
        RPi pin   7  9  13     
31
                     |  |
32
                     |  +---LED---+
33
                     |            |
34
                     +---330 R----+
35 5 Hammel
</pre>
36
37
* You will need to have sudo access for your Linux user id.
38 6 Hammel
39 3 Hammel
40 1 Hammel
h3. Generating the SD Card for the Pi
41 3 Hammel
42 1 Hammel
* Download the RPi 2 Development Platform 
43 4 Hammel
** _wget <url>_
44
** Unpack the archive to a directory called *image*.
45 1 Hammel
* Download the Ironman Package Collection
46 4 Hammel
** _wget <url>_
47
** Unpack the archive to a directory called *package*.
48 3 Hammel
49 4 Hammel
In a terminal window run: _dmesg -w_
50 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.
51 4 Hammel
Kill the _dmesg -w_ command with Ctrl-C.
52 3 Hammel
53 4 Hammel
From the *image* directory
54 1 Hammel
* Format the SD card
55 4 Hammel
** _sudo ./mksd.sh -d <device name>_
56 3 Hammel
** where <device name> is the name you noted from the output of dmesg -w.
57 1 Hammel
* Mount the boot partition from the sd card: 
58 4 Hammel
** _sudo mkdir -p /mnt/boot_
59
** _sudo mount <device name>1 /mnt/boot_
60 1 Hammel
** where <device name> is the name you noted from the output of dmesg -w.
61 4 Hammel
* Install the Development Platform to the SD card
62
** _sudo ./mkinstall.sh -b /mnt/boot -d <device name>2_ 
63 3 Hammel
** where <device name> is the name you noted from the output of dmesg -w.
64
65 4 Hammel
From the *package* directory
66 3 Hammel
* Mount the root partition from the sd card: 
67 4 Hammel
** _sudo mkdir -p /mnt/root_
68
** _sudo mount <device name>1 /mnt/root_
69 3 Hammel
* Copy the Ironman Package Collection files to /root of the root partition on the SD card
70 4 Hammel
** _sudo cp *.opk /mnt/root/root_
71 3 Hammel
72
Make sure all writes to the SD card have completed
73 4 Hammel
* _sync;sync;sync_
74 3 Hammel
75
Unmount the SD card partitions
76 4 Hammel
* _sudo umount /mnt/boot_
77
* _sudo umount /mnt/root_
78 3 Hammel
79 4 Hammel
Remove the SD card from the host system and insert it into the Raspberry Pi 2.
80 1 Hammel
81
h3. First time boot
82
83
h3. Network configuration
84
85 9 Hammel
wlan0
86
87
* This interface is used for configuration of the Monitor.
88
* Configured on the 192.168.36.0 subnet.
89
** See /etc/network/dhcpd.conf.aponly
90
91
uap0
92
93
* This interface is used as an access point for IoT devices.
94
* Configured on the 192.168.3.0 subnet.
95
** See /etc/network/dhcpd.conf.uap and dhcpd.conf.uap.tmpl
96
** The template is used to change the base subnet through the web interface.
97
** The SSID is _ironman_.
98
99
<pre>
100
Pair/Config button is GPIO 4 (RPi pin 7)
101
Pair/Config LED is GPIO 7 (RPi pin 13)
102
	LED should only be lit on boot if button is enabled (in Config mode).
103
		In this case, we're in Config Mode to configure the networks.
104
		The web server (imwww) is on SSID "ironman" at 192.168.36.1:1337.
105
	LED is off on boot if button is disabled (in Pair Mode).
106
	If in Pair Mode
107
		Start hostapd for aponly
108
		Start dhcpd for aponly on wlan0
109
		Start imrest web service on port 8165 for IoT devices and Jarvis interfaces.
110
	If in Config Mode
111
		Start wpa_supplicant on wlan0
112
		Create uap0 device as virtual device on wlan0
113
		Start dhcpd on uap0
114
		Start hostapd on uap0
115
		Start imwww for network configuration of the Monitor.
116
117
/etc/ironman/iot		Registration directory for IoT devices
118
/etc/ironman/jarvis		Registration directgory for Jarvis interfaces
119
</pre>
120
121
122 1 Hammel
h3. Pairing with IoT Sensors
123
124
h3. Pairing with Jarvis
125
126
h2. IoT Sensor
127
128
h3. Sensor Types
129
130
h4. Light Switch
131
132
h3. Flashing the firmware
133
134
h3. Power On
135
136
h3. Pairing with a Monitor
137
138
h2. Jarvis
139
140
h3. Prerequisites
141
142
h3. Pairing with a Monitor
143
144
h3. Supported Commands