Introduction |
|
1 | (4) |
|
|
1 | (1) |
|
|
2 | (1) |
|
|
2 | (1) |
|
|
3 | (1) |
|
|
3 | (2) |
Part I: Getting Started with the BeagfeBone |
|
5 | (42) |
|
Chapter 1 Introducing the BeagleBone |
|
|
7 | (10) |
|
Touring the Original BeagleBone and the BeagleBone Black |
|
|
8 | (5) |
|
Exploring Uses for the BeagleBone |
|
|
13 | (1) |
|
Accessorizing Your BeagleBone |
|
|
13 | (4) |
|
Chapter 2 Installing the Operating System |
|
|
17 | (12) |
|
|
18 | (1) |
|
|
18 | (4) |
|
Knowing the factory defaults on your BeagleBone |
|
|
18 | (1) |
|
Downloading your Linux distribution |
|
|
19 | (1) |
|
Decompressing your Linux distribution |
|
|
20 | (2) |
|
Flashing and Inserting Your microSD Card |
|
|
22 | (5) |
|
Flashing a microSD card in Windows |
|
|
23 | (1) |
|
Flashing a microSD card in Mac OS X |
|
|
24 | (1) |
|
Flashing a microSD card in Linux |
|
|
25 | (1) |
|
Inserting your microSD card |
|
|
26 | (1) |
|
Flashing the Onboard eMMC |
|
|
27 | (2) |
|
Chapter 3 Connecting Your BeagleBone |
|
|
29 | (18) |
|
|
29 | (3) |
|
|
30 | (1) |
|
Browsing to your BeagleBone |
|
|
31 | (1) |
|
Blinking the onboard LEDs |
|
|
32 | (1) |
|
Connecting via SSH over USB |
|
|
33 | (3) |
|
|
34 | (1) |
|
|
35 | (1) |
|
Connecting via SSH over Ethernet |
|
|
36 | (3) |
|
|
36 | (2) |
|
|
38 | (1) |
|
Connecting the Original BeagleBone via Serial over USB |
|
|
39 | (2) |
|
|
39 | (1) |
|
|
40 | (1) |
|
Connecting the BeagleBone Black via Serial over USB |
|
|
41 | (8) |
|
|
42 | (2) |
|
|
44 | (3) |
Part II: Covering the Basics |
|
47 | (86) |
|
Chapter 4 Introducing the Linux Shell |
|
|
49 | (40) |
|
|
49 | (2) |
|
Introducing the root superuser |
|
|
51 | (1) |
|
Exploring the Linux File System |
|
|
52 | (25) |
|
Listing files and directories |
|
|
53 | (2) |
|
Understanding the directory tree |
|
|
55 | (1) |
|
|
55 | (2) |
|
Understanding relative and absolute paths |
|
|
57 | (2) |
|
|
59 | (1) |
|
|
60 | (2) |
|
Creating, editing, and viewing text files |
|
|
62 | (4) |
|
Removing files and directories |
|
|
66 | (2) |
|
Copying and renaming files |
|
|
68 | (1) |
|
Selecting multiple files in Linux |
|
|
69 | (5) |
|
Using long-listing format and permissions |
|
|
74 | (3) |
|
Managing Software on Your BeagleBone |
|
|
77 | (4) |
|
|
78 | (1) |
|
|
79 | (1) |
|
|
79 | (1) |
|
|
80 | (1) |
|
Seeing what's installed on your BeagleBone |
|
|
81 | (1) |
|
Changing the Hostname and Password |
|
|
81 | (1) |
|
Shutting Down and Rebooting |
|
|
82 | (1) |
|
Commanding the Prompt Like a Jedi Master |
|
|
83 | (6) |
|
Recalling previous commands |
|
|
83 | (1) |
|
|
84 | (1) |
|
|
85 | (2) |
|
|
87 | (2) |
|
Chapter 5 Designing Circuits |
|
|
89 | (18) |
|
|
89 | (4) |
|
Voltage, current, and resistance |
|
|
90 | (1) |
|
|
91 | (1) |
|
|
92 | (1) |
|
|
93 | (3) |
|
|
93 | (1) |
|
|
94 | (1) |
|
|
95 | (1) |
|
|
95 | (1) |
|
|
96 | (11) |
|
|
96 | (5) |
|
|
101 | (2) |
|
|
103 | (2) |
|
|
105 | (2) |
|
Chapter 6 Introducing Digital Electronics with the BeagleBone |
|
|
107 | (26) |
|
Looking for the Right Tools |
|
|
108 | (4) |
|
|
108 | (3) |
|
|
111 | (1) |
|
Essential Components and Parts |
|
|
112 | (1) |
|
|
113 | (1) |
|
Understanding How GPIOs Work |
|
|
114 | (1) |
|
Viewing the GPIO pins layout |
|
|
114 | (1) |
|
|
115 | (5) |
|
Wiring the circuit for an LED |
|
|
115 | (3) |
|
|
118 | (2) |
|
|
120 | (2) |
|
Wiring the circuit for a pushbutton |
|
|
120 | (2) |
|
|
122 | (1) |
|
|
122 | (6) |
|
Wiring the circuit for a brightness-regulated LED |
|
|
124 | (1) |
|
|
124 | (4) |
|
|
128 | (1) |
|
Adding Capes to the BeagleBone |
|
|
129 | (6) |
|
|
129 | (1) |
|
|
130 | (1) |
|
|
130 | (1) |
|
|
130 | (1) |
|
|
131 | (1) |
|
|
131 | (1) |
|
BeagleBone HD Camera Cape |
|
|
132 | (1) |
Part III: Programming with BoneScript |
|
133 | (46) |
|
Chapter 7 Introducing BoneScript |
|
|
135 | (18) |
|
Introducing JavaScript, Node.js, and BoneScript |
|
|
135 | (1) |
|
|
136 | (1) |
|
|
137 | (4) |
|
|
138 | (2) |
|
Creating a folder and .js file |
|
|
140 | (1) |
|
Blinking an Onboard LED with BoneScript |
|
|
141 | (6) |
|
|
142 | (1) |
|
Loading the BoneScript module |
|
|
143 | (1) |
|
|
143 | (1) |
|
|
144 | (1) |
|
Setting the default pin state |
|
|
144 | (1) |
|
|
145 | (1) |
|
|
145 | (1) |
|
|
146 | (1) |
|
Blinking More LEDs with BoneScript |
|
|
147 | (6) |
|
|
147 | (2) |
|
Opening the blinked.js demo |
|
|
149 | (2) |
|
|
151 | (2) |
|
Chapter 8 Experimenting with BoneScript |
|
|
153 | (26) |
|
|
154 | (4) |
|
|
154 | (2) |
|
Writing the code to read the state of a pushbutton |
|
|
156 | (1) |
|
Running the script to read the state of a pushbutton |
|
|
157 | (1) |
|
Controlling an LED with a Pushbutton |
|
|
158 | (4) |
|
Wiring an LED and a pushbutton |
|
|
159 | (1) |
|
|
160 | (1) |
|
|
161 | (1) |
|
Adjusting the Brightness with an RGB LED |
|
|
162 | (5) |
|
|
163 | (2) |
|
|
165 | (2) |
|
|
167 | (1) |
|
Sweeping a Servo with a Potentiometer |
|
|
167 | (6) |
|
|
168 | (2) |
|
Wiring everything together |
|
|
170 | (2) |
|
Writing the code to sweep a servo with a potentiometer |
|
|
172 | (1) |
|
Running the script to sweep a servo with a potentiometer |
|
|
173 | (1) |
|
Detecting Movement with a Motion Sensor |
|
|
173 | (8) |
|
|
174 | (1) |
|
Writing the code for motion detection |
|
|
174 | (2) |
|
Running the script for motion detection |
|
|
176 | (3) |
Part IV: Programming with Python |
|
179 | (74) |
|
Chapter 9 Introducing Python |
|
|
181 | (16) |
|
Getting Started with Python |
|
|
181 | (2) |
|
Making sure your libraries are up to date |
|
|
182 | (1) |
|
|
183 | (1) |
|
Blinking an LED with Python |
|
|
183 | (7) |
|
Wiring the circuit for an LED |
|
|
183 | (1) |
|
Writing the code for an LED |
|
|
184 | (5) |
|
Running the script for blinking an LED |
|
|
189 | (1) |
|
Reading a Pushbutton with Python |
|
|
190 | (7) |
|
Wiring the circuit for a pushbutton |
|
|
190 | (1) |
|
Writing the code and running the script for a pushbutton |
|
|
190 | (2) |
|
Writing the code with interrupts |
|
|
192 | (1) |
|
Introducing if... else and if... elif statements |
|
|
193 | (2) |
|
Getting to know the print function |
|
|
195 | (2) |
|
Chapter 10 Experimenting with Python |
|
|
197 | (40) |
|
Fading an RGB LED with Python |
|
|
197 | (6) |
|
|
198 | (2) |
|
Writing the code for fading an RGB LED |
|
|
200 | (3) |
|
Running the script for fading an RGB LED |
|
|
203 | (1) |
|
Working with Analog Sensors |
|
|
203 | (10) |
|
Using the right voltage for the ADC |
|
|
204 | (1) |
|
Wiring an IR distance sensor |
|
|
205 | (3) |
|
Writing the code to measure distance |
|
|
208 | (2) |
|
Running the script to measure distance |
|
|
210 | (1) |
|
Wiring a temperature sensor |
|
|
210 | (2) |
|
Writing the code to read temperature |
|
|
212 | (1) |
|
Running the script to read temperature |
|
|
212 | (1) |
|
Sending an Email with Python |
|
|
213 | (4) |
|
Knowing the prerequisites |
|
|
213 | (1) |
|
Writing the code to send an email |
|
|
214 | (3) |
|
Running the script to send an email |
|
|
217 | (1) |
|
Mixing Up Projects and Creating Functions |
|
|
217 | (12) |
|
Creating a function with Python |
|
|
217 | (3) |
|
Sending temperature readings by email |
|
|
220 | (2) |
|
Controlling an RGB LED with distance readings |
|
|
222 | (7) |
|
|
229 | (8) |
|
Wiring the BeagleBone to an UART device |
|
|
230 | (1) |
|
Writing the code to test UART |
|
|
231 | (3) |
|
Running the script to test UART |
|
|
234 | (1) |
|
Understanding UART's uses |
|
|
235 | (2) |
|
Chapter 11 Mastering the Art of Coding |
|
|
237 | (16) |
|
|
237 | (4) |
|
Variables and function names |
|
|
238 | (1) |
|
|
239 | (1) |
|
Comments, white space, and indentation |
|
|
240 | (1) |
|
|
241 | (4) |
|
Diving into Binary and Data Storage |
|
|
245 | (3) |
|
|
246 | (1) |
|
|
247 | (1) |
|
|
247 | (1) |
|
BoneScript-Specific Programming Tips |
|
|
248 | (2) |
|
Looping, looping, and more looping |
|
|
248 | (1) |
|
Understanding the importance of JavaScript callbacks |
|
|
249 | (1) |
|
Python-Specific Programming Tips |
|
|
250 | (5) |
|
Creating functions to clear up the mess |
|
|
250 | (1) |
|
Creating time-dependent code |
|
|
250 | (3) |
Part V: Turning Your BeagleBone into a Desktop Computer |
|
253 | (58) |
|
Chapter 12 Using Your BeagleBone Black as a Desktop Computer |
|
|
255 | (32) |
|
|
255 | (1) |
|
Connecting the Peripherals and Booting Up |
|
|
256 | (5) |
|
Connecting a Micro HDMI cable or DVI display |
|
|
258 | (1) |
|
Connecting a USB hub, keyboard, and mouse |
|
|
258 | (1) |
|
Connecting to your router |
|
|
259 | (1) |
|
|
260 | (1) |
|
|
260 | (1) |
|
|
261 | (2) |
|
Roaming the Desktop Environment |
|
|
263 | (4) |
|
Viewing the Applications menu |
|
|
263 | (1) |
|
|
263 | (3) |
|
Working with multiple desktops |
|
|
266 | (1) |
|
Customizing the BeagleBone |
|
|
267 | (4) |
|
Customizing the desktop appearance |
|
|
267 | (1) |
|
|
268 | (1) |
|
Creating icons on the desktop |
|
|
269 | (1) |
|
Changing the desktop background |
|
|
270 | (1) |
|
|
271 | (6) |
|
Navigating the File Manager |
|
|
272 | (3) |
|
|
275 | (1) |
|
|
275 | (1) |
|
Opening a folder in the terminal |
|
|
275 | (1) |
|
Accessing external storage devices |
|
|
276 | (1) |
|
|
277 | (1) |
|
|
278 | (5) |
|
Using the Customization menu |
|
|
278 | (1) |
|
|
279 | (1) |
|
Finding words within web pages |
|
|
280 | (1) |
|
|
280 | (1) |
|
Adding and using bookmarks |
|
|
281 | (1) |
|
|
282 | (1) |
|
Shutting Down, Rebooting, and Logging Off |
|
|
283 | (4) |
|
Chapter 13 Building Your Website |
|
|
287 | (24) |
|
Introducing HTML, CSS, and JavaScript |
|
|
287 | (1) |
|
|
288 | (1) |
|
Using a BeagleBone Black as a desktop computer |
|
|
288 | (1) |
|
Controlling the BeagleBone remotely through SSH |
|
|
289 | (1) |
|
Creating Your First Website |
|
|
289 | (2) |
|
|
289 | (1) |
|
|
289 | (1) |
|
|
290 | (1) |
|
Structuring an HTML document |
|
|
290 | (1) |
|
Formatting Your HTML Content |
|
|
291 | (7) |
|
|
291 | (1) |
|
|
292 | (1) |
|
|
293 | (1) |
|
|
293 | (1) |
|
|
294 | (1) |
|
|
295 | (1) |
|
|
296 | (2) |
|
Formatting Your HTML Document |
|
|
298 | (1) |
|
Styling Your HTML Content with CSS |
|
|
298 | (6) |
|
|
298 | (2) |
|
Knowing the basics of CSS |
|
|
300 | (1) |
|
Experimenting with colors |
|
|
300 | (1) |
|
|
301 | (1) |
|
Understanding the box model |
|
|
302 | (2) |
|
Styling Your HTML Elements |
|
|
304 | (5) |
|
|
305 | (1) |
|
|
305 | (1) |
|
Customizing your logo and navigation bar |
|
|
306 | (1) |
|
Customizing your container |
|
|
307 | (1) |
|
|
308 | (1) |
|
Publishing Your First Website |
|
|
309 | (2) |
Part VI: Playing with the BeagleBone |
|
311 | (50) |
|
Chapter 14 Building Your First Project |
|
|
313 | (24) |
|
|
313 | (2) |
|
|
315 | (5) |
|
|
316 | (1) |
|
Writing the code for the LCD |
|
|
316 | (3) |
|
Running the script for the LCD |
|
|
319 | (1) |
|
Programming the Email Reader |
|
|
320 | (2) |
|
|
322 | (11) |
|
|
322 | (1) |
|
Understanding the concept |
|
|
323 | (1) |
|
|
324 | (9) |
|
Adding the LED and Buzzer |
|
|
333 | (4) |
|
Wiring the LED and buzzer |
|
|
334 | (1) |
|
Writing the code for the LED and buzzer |
|
|
335 | (1) |
|
Running the script of the complete project |
|
|
335 | (2) |
|
Chapter 15 Running Your Home Automation Web Server |
|
|
337 | (24) |
|
Exploring What You Can Do |
|
|
337 | (1) |
|
|
338 | (2) |
|
|
339 | (1) |
|
Keeping your files organized |
|
|
339 | (1) |
|
Repurposing your previous HTML and CSS |
|
|
340 | (1) |
|
|
340 | (1) |
|
|
340 | (3) |
|
|
341 | (1) |
|
Adding JavaScript to your web page |
|
|
341 | (1) |
|
Explaining your main JavaScript |
|
|
342 | (1) |
|
|
343 | (3) |
|
Loading modules and initializing a variable |
|
|
343 | (1) |
|
|
344 | (1) |
|
Establishing socket communication |
|
|
344 | (1) |
|
Launching your web server |
|
|
345 | (1) |
|
Accessing Your BeagleBone with Another Device |
|
|
346 | (1) |
|
Dropping Your LED and Controlling an Appliance |
|
|
347 | (2) |
|
Adjusting Outputs with PWM |
|
|
349 | (5) |
|
|
350 | (1) |
|
|
351 | (1) |
|
|
352 | (2) |
|
Launching the web server to control a PWM output |
|
|
354 | (1) |
|
Connecting a temperature sensor |
|
|
354 | (9) |
|
|
356 | (1) |
|
|
357 | (2) |
|
Launching the web server for your temperature monitoring |
|
|
359 | (2) |
Part VII: The Part of Tens |
|
361 | (16) |
|
Chapter 16 Ten Amazing Projects for the BeagleBone |
|
|
363 | (8) |
|
Underwater Exploration Robot |
|
|
363 | (1) |
|
Autonomous Sailboat to Tame the Seas |
|
|
364 | (1) |
|
Autonomous Robot for BeagleBone Black |
|
|
365 | (1) |
|
|
366 | (1) |
|
Multimedia Center with Kodi |
|
|
366 | (1) |
|
BeagleBone Gaming Console |
|
|
367 | (1) |
|
BeagleBone As Super Nintendo |
|
|
368 | (1) |
|
BeagleBone Cape for Drones |
|
|
369 | (1) |
|
Desktop Five-Axis CNC Mill |
|
|
369 | (1) |
|
|
370 | (1) |
|
Chapter 17 Ten Resources and Tips for BeagleBone Users |
|
|
371 | (6) |
|
Finding Components and Parts |
|
|
371 | (1) |
|
Acquiring Electronics Starter Kits |
|
|
372 | (1) |
|
Protecting Your BeagleBone with a Case |
|
|
373 | (1) |
|
Attending Events and Workshops |
|
|
373 | (1) |
|
Joining the BeagleBoard Community |
|
|
374 | (1) |
|
Interacting with the Community |
|
|
374 | (1) |
|
Sharing Your BeagleBone Projects with Others |
|
|
375 | (1) |
|
|
375 | (1) |
|
Looking for Project Ideas |
|
|
376 | (1) |
|
Finding Out More about BeagleBone |
|
|
376 | (1) |
Appendix A: Troubleshooting |
|
377 | (8) |
|
|
377 | (2) |
|
|
379 | (1) |
|
|
380 | (5) |
|
Expanding the file system on your microSD card |
|
|
381 | (1) |
|
Accessing external storage devices when using the Linux Shell |
|
|
382 | (3) |
Appendix B: Controlling BeagleBone's GPIOs |
|
385 | (4) |
|
Controlling the GPIO with the File System |
|
|
385 | (1) |
|
Controlling the GPIO with BoneScript |
|
|
386 | (1) |
|
Controlling the GPIO with Python |
|
|
386 | (3) |
Appendix C: Guide to the BeagleBone's GPIOs |
|
389 | (4) |
Index |
|
393 | |