Content: 3. Basic installation and configuration of the control centre

Basic installation and configuration of the control centre. ______ 54 ... 138. 5.2.2. Temperature monitoring interface. ... Temperature node management interface.
262KB taille 0 téléchargements 258 vues
HCOOFDSTUKTITEL ONTENT

Content: 1.

Introduction. ______________________________________________________ 13 1.1.

Why this book? ________________________________________________ 13

1.2.

Who is this book designed for? ___________________________________ 14

1.3.

How to use this book? ___________________________________________ 15

1.4.

Abbreviations. _________________________________________________ 17

1.5.

Changes since the first edition of this book. ________________________ 18

1.6. References. ____________________________________________________ 18 1.6.1. Links ______________________________________________________ 20 2. Installing and configuring the PC software. _____________________________ 23 2.1. Linux Operating System. _________________________________________ 24 2.1.1. Configure Linux ______________________________________________ 30 2.2. WEB server related sw. __________________________________________ 2.2.1. XAMPP. ___________________________________________________ 2.2.2. Configure XAMPP ____________________________________________ 2.2.3. XAMPP development package __________________________________

38 38 40 44

2.3. Compiler sw. ___________________________________________________ 45 2.3.1. USB library installation ________________________________________ 48 3. Basic installation and configuration of the control centre. ________ 54 3.1.

Introduction ___________________________________________________ 54

3.2. WEB interface __________________________________________________ 3.2.1. Installation. _________________________________________________ 3.2.2. Configuration. _______________________________________________ 3.2.3. Execution rights. _____________________________________________ 3.2.4. Language file access rights. ____________________________________

54 54 55 56 57

3.3. Parallel port. ___________________________________________________ 3.3.1. Simple debug interface. _______________________________________ 3.3.2. Finding the address of the parallel port. ___________________________ 3.3.3. Controlling the parallel port. ____________________________________

57 59 59 60

3.4. Parallel port driver ______________________________________________ 3.4.1. Compilation & test ____________________________________________ 3.4.2. Test Web interface. ___________________________________________ 3.4.3. Installation __________________________________________________

61 61 62 63

3.5. Attached HW. __________________________________________________ 3.5.1. Wireless On/Off switch ________________________________________ 3.5.2. Parallel port hardware interface. _________________________________ 3.5.3. Parallel port WEB interface. ____________________________________ 4. Possible extensions ________________________________________________

64 65 65 68 71

4.1. Wake-On-LAN support___________________________________________ 71 4.1.1. PCI versions.________________________________________________ 71 4.1.2. How WOL works. ____________________________________________ 76

5

ELCC-2010.indd 5

03-02-11 15:52

HOOFDSTUKTITEL CONTENT

4.1.3. 4.1.4.

Remote power up of the PC.____________________________________ 79 Wake-On-LAN savings. _______________________________________ 80

4.2.

USB temperature sensor. ________________________________________ 81

4.3.

e-mail notifications. _____________________________________________ 86

4.4. SMS notifications. ______________________________________________ 93 4.4.1. Connecting the phone to the “Embedded Linux CTRL Centre”. _________ 93 4.4.2. Mobile phone interface investigations. ____________________________ 98 4.4.3. Compiling the SMS software. __________________________________ 100 4.4.4. Testing the SMS software. ____________________________________ 101

5.

4.5. Background tasks. _____________________________________________ 4.5.1. Temperature update _________________________________________ 4.5.2. Alarm handling. _____________________________________________ 4.5.3. Lamp update. ______________________________________________

102 105 106 108

4.6. USB web cam support. _________________________________________ 4.6.1. Background. _______________________________________________ 4.6.2. WEB camera utilities/debug tools. ______________________________ 4.6.3. WEB camera installation and verification._________________________ 4.6.4. Live pictures on the Internet from the “Embedded Linux CTRL Centre”. _ 4.6.4.1. Still pictures with spcacat. _________________________________ 4.6.4.2. Streaming pictures with spcaserv and spcaview. _______________ 4.6.4.3. Panning the WEB camera _________________________________

109 109 110 115 119 119 125 128

4.7. Additional extensions __________________________________________ 134 Operating the control centre. ________________________________________ 136 5.1.

Logging in to the “Embedded Linux CTRL Centre”. _________________ 136

5.2. Daily operation. _______________________________________________ 5.2.1. Lamp control interface. _______________________________________ 5.2.2. Temperature monitoring interface. ______________________________ 5.2.3. Video interface _____________________________________________ 5.2.4. Still picture interface _________________________________________ 5.2.5. Setup/Configuration interface __________________________________ 5.2.5.1. User management interface. _______________________________ 5.2.5.2. Language management interface. ___________________________ 5.2.5.3. Temperature node management interface. ____________________ 5.2.5.4. Log monitoring interface. __________________________________ 5.2.6. Power off interface __________________________________________ 5.2.7. Exit ______________________________________________________

137 138 139 140 141 143 143 146 147 149 150 151

5.3. Daily operations (reduced interface) ______________________________ 5.3.1. HOME ____________________________________________________ 5.3.2. PHP information ____________________________________________ 5.3.3. Status ____________________________________________________ 5.3.4. Lamp control _______________________________________________ 5.3.5. Temperature status. _________________________________________ 5.3.6. Still picture ________________________________________________ 5.3.7. User management. __________________________________________ 5.3.8. Using the standard interface on a mobile device. ___________________

151 152 153 153 153 154 155 156 157

6

ELCC-2010.indd 6

03-02-11 15:52

HCOOFDSTUKTITEL ONTENT

6. Trouble shooting __________________________________________________ 162 Appendix A __________________________________________________________ 170 A.1

Background and some thoughts. _________________________________ 170

A.2

First time with DSL_____________________________________________ 172

A.3

Some useful shell commands. ___________________________________ 175

A.4 Configuring the desktop.________________________________________ A.4.1 Desktop ___________________________________________________ A.4.2 Fluxbox menu configuration. ___________________________________ A.4.3 JWM menu configuration _____________________________________ A.4.4 The Windows Manager IceWM _________________________________

180 180 181 182 182

A.5 Further configuration of XAMPP. _________________________________ 188 A.5.1 Hiding your installation from the outside world. ____________________ 188 A.5.2 Wake On Lan from the Internet. ________________________________ 193 A.6

Useful Parallel port data at one place. _____________________________ 197

A.7

HARDWARE interface schematic. ________________________________ 198

A.8

PCB layout. ___________________________________________________ 199

A.9

Reverse engineering of thermo snake software interface. ____________ 201

A.10

Connecting to the “Embedded Linux CTRL Centre”. _______________ 210

A.11 C-source code description ____________________________________ A.11.1 lptout.c. ___________________________________________________ A.11.2 step.c ____________________________________________________ A.11.3 findsensor.c________________________________________________ A.11.4 measuretemp.c _____________________________________________ A.11.5 sms.c_____________________________________________________ A.11.6 temp_read_background.c. ____________________________________

219 219 221 224 229 237 253

A.12 WEB server software description. ______________________________ A.12.1 Overall description. __________________________________________ A.12.2 fields_text.inc.php ___________________________________________ A.12.3 ctrl_styles.css ______________________________________________ A.12.4 functions_main.inc.php _______________________________________ A.12.5 vars.inc.php________________________________________________ A.12.6 install_db.php ______________________________________________ A.12.7 index.php and login_form.inc.php _______________________________ A.12.8 locate.php _________________________________________________ A.12.9 control.php and control_inc.php ________________________________ A.12.10 lamp.php and lamp.inc.php _________________________________ A.12.11 statusinformation.php ______________________________________ A.12.12 pictureupdate.php and pictureupdate.inc.php ____________________ A.12.13 picturestreaming.php and picturestreaming.inc.php _______________ A.12.14 powerdown.php and powerdown.inc.php _______________________ A.12.15 temp.php and temp.inc.php __________________________________ A.12.16 control_small.php _________________________________________ A.12.17 lamp_small.php and lamp_small.inc.php _______________________ A.12.18 pictureupdate_small.php and pictureupdate_small.inc.php _________

257 257 269 269 270 270 271 278 282 284 292 298 300 306 312 315 320 323 326

7

ELCC-2010.indd 7

03-02-11 15:52

HOOFDSTUKTITEL CONTENT

A.12.19 A.12.20 A.12.21 A.12.22 A.12.23 A.12.24 A.12.25 A.12.26 A.12.27 A.12.28 A.12.29 A.12.30 A.12.31 A.12.32 A.12.33 A.12.34 A.12.35 A.13

usermgmt_small.php and usermgmt_small_form.inc.php ___________ phpstatus_small.php _______________________________________ status_small.php __________________________________________ temp_small.php ___________________________________________ lamp_test.php and lamp_test.inc.php __________________________ step_test.php and step_test.inc.php ___________________________ picture_test.php ___________________________________________ sms_test.php and sms_test.inc.php ___________________________ email_test.php and email_test.inc.php _________________________ temp_test.php ____________________________________________ admin.php and admin.inc.php ________________________________ language.php and language.inc.php ___________________________ node.php and node.inc.php __________________________________ monlog.php ______________________________________________ usermgmt.php and usermgmt_form.inc.php _____________________ send_alarm.php___________________________________________ update_lamp_status.php ____________________________________

331 339 341 343 346 349 353 355 359 363 365 372 377 390 392 400 404

Installation checklist. _________________________________________ 407

8

ELCC-2010.indd 8

03-02-11 15:52