Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 6bbc2bd7 authored by Deepak Khatri's avatar Deepak Khatri :dog:
Browse files

Update BeagleBone CookBook

Updated images, links and code.
parent 74e5b6b1
Branches
Tags
No related merge requests found
Pipeline #599 passed with stage
in 3 minutes and 6 seconds
......@@ -57,7 +57,8 @@ a new USB drive appear on your host computer. :ref:`figure below <basics_01getti
shows how it will appear on a Windows host, and Linux and Mac hosts will look similar.
The Bone acting like a USB drive and the files you see are located on the Bone.
.. todo:: Update
.. todo::
Update
.. _basics_01gettingStarted_fig:
......@@ -172,6 +173,7 @@ perform physical computing tasks without first learning Linux.
Solution
***********
Plug your board into the USB of your host computer and browse to
http://192.168.7.2:3000 using Google Chrome or Firefox (as shown in
:ref:`basics of out of the box <basics_out_of_the_box>`). In the left
......@@ -346,7 +348,8 @@ with *am57xx-debian-* is for programming the Beagle AI's.
The onboard flash is often called the *eMMC* memory. We just call it *onboard flash*, but you'll
often see *eMMC* appearing in filenames of images used to update the onboard flash.
Click the image you want to use and it will download. The images are some 500M, so it might take a while.
Click the image you want to use and it will download.
The images are some 500M, so it might take a while.
Discussion
************
......@@ -370,9 +373,16 @@ If you boot the Bone with a microSD card inserted with a valid boot image,
it will boot from the microSD card. If you boot without the microSD card
installed, it will boot from the onboard flash.
.. tip:: If you want to reflash the onboard flash memory, see :ref:`basic onboard flash <basics_onboard_flash>`.
.. tip::
If you want to reflash the onboard flash memory,
see :ref:`basic onboard flash <basics_onboard_flash>`.
.. note:: I instruct my students to use the microSD for booting. I suggest they keep an extra microSD flashed with the current OS. If they mess up the one on the Bone, it takes only a moment to swap in the extra microSD, boot up, and continue running. If they are running off the onboard flash, it will take much longer to reflash and boot from it.
.. note::
I instruct my students to use the microSD for booting. I suggest they
keep an extra microSD flashed with the current OS. If they mess up the
one on the Bone, it takes only a moment to swap in the extra microSD,
boot up, and continue running. If they are running off the onboard flash,
it will take much longer to reflash and boot from it.
Download the image you found in :ref:`basic find image <basics_find_image>`. It's more than 500 MB,
so be sure to have a fast Internet connection. Then go to http://beagleboard.org/getting-started#update and
......
......@@ -57,7 +57,8 @@ You want to acquire and attach a sensor and need to understand your basic option
Solution
*********
:ref:`sensor cape headers<sensors_cape_headers>` shows many of the possibilities for connecting a sensor.
:ref:`sensor cape headers<sensors_cape_headers>`
shows many of the possibilities for connecting a sensor.
.. _sensors_cape_headers:
......@@ -170,7 +171,8 @@ or both on the Bone, as shown in :ref:`figure below <js_pushbutton_fig>`.
Bone with pushbutton
The code in :ref:`js pushbutton code<js_pushbutton_code>` reads GPIO port *P9_42*, which is attached to the pushbutton.
The code in :ref:`js pushbutton code<js_pushbutton_code>`
reads GPIO port *P9_42*, which is attached to the pushbutton.
.. _py_pushbutton_code:
......@@ -528,6 +530,7 @@ Here, we'll use the *eQEP2* encoder via the Linux +count+ subsystem.
Then run the following commands:
.. code-block:: bash
bone$ config-pin P8_11 qep
......
......@@ -8,7 +8,8 @@ Introduction
In this chapter, you will learn how to control physical hardware via
BeagleBone Black's general-purpose input/output (GPIO) pins. The Bone has
65 GPIO pins that are brought out on two 46-pin headers, called +P8+ and +P9+, as shown in :ref:`<js_P8P9_fig>>.
65 GPIO pins that are brought out on two 46-pin headers, called
+P8+ and +P9+, as shown in :ref:`<js_P8P9_fig>>.
.. note::
All the examples in the book assume you have cloned the
......@@ -42,6 +43,7 @@ You want to know how to flash the four LEDs that are next to the Ethernet port o
Solution
*************
Locate the four onboard LEDs shown in :ref:`<js_internLED_fig>>.
They are labeled +USR0+ through +USR3+, but we'll refer to them as the +USER+ LEDs.
......@@ -80,8 +82,9 @@ Using an internal LED (internLED.js)
In the +bash+ command window, enter the following commands:
.. code-block:: bash
bone$ cd ~/BoneCookbook/docs/03displays/code
bone$ ./internLED.js
bone$ ./internLED.js
The +USER0+ LED should now be flashing.
......@@ -108,10 +111,17 @@ Connect an LED to one of the GPIO pins using a series resistor to limit the curr
* 220 &#8486; to 470 &#8486; resistor (see :ref:`app resistor <app_resistor>`)
* LED (see :ref:`app opto <app_opto>`)
.. WARNING:: The value of the current limiting resistor depends on the LED you are using. The Bone can drive only 4 to 6 mA, so you might need a larger resistor to keep from pulling too much current. A 330 &#8486; or 470 &#8486; resistor might be better.
.. WARNING::
The value of the current limiting resistor depends on the LED you are using.
The Bone can drive only 4 to 6 mA, so you might need a larger resistor to keep
from pulling too much current. A 330 &#8486; or 470 &#8486; resistor might be better.
:ref:`<displays_externLED_fig>` shows how you can wire the LED to pin 14 of the +P9+ header (+P9_14+). Every circuit in this book (:ref:`<basics_wire_breadboard>>) assumes you have already wired the rightmost bus to ground (+P9_1+) and the next bus to the left to the 3.3 V (+P9_3+) pins on the header. Be sure to get the polarity right on the LED. The _short_ lead always goes to ground.
:ref:`<displays_externLED_fig>` shows how you can wire the LED to pin 14 of
the +P9+ header (+P9_14+). Every circuit in this book (:ref:`<basics_wire_breadboard>>)
assumes you have already wired the rightmost bus to ground (+P9_1+) and the next bus to
the left to the 3.3 V (+P9_3+) pins on the header. Be sure to get the polarity right on
the LED. The _short_ lead always goes to ground.
.. _displays_externLED_fig:
......@@ -121,7 +131,8 @@ Diagram for using an external LED
:align: center
:alt: External LED
After you've wired it, start VSC (see :ref:`basic vsc<basics_vsc>`) and find the code shown in :ref:`<py_externLED_code>>.
After you've wired it, start VSC (see :ref:`basic vsc<basics_vsc>`)
and find the code shown in :ref:`<py_externLED_code>>.
.. _py_externLED_code:
......@@ -159,13 +170,15 @@ You want to control a device that runs at 120 V.
Solution
*************
Working with 120 V can be tricky--even dangerous--if you aren't careful. Here's a safe way to do it.
Working with 120 V can be tricky--even dangerous--if
you aren't careful. Here's a safe way to do it.
To make this recipe, you will need:
* PowerSwitch Tail II (see :ref:`<app_misc>>)
:ref:`<displays_powerSwitch_fig>` shows how you can wire the PowerSwitch Tail II to pin +P9_14+.
:ref:`<displays_powerSwitch_fig>` shows how you can wire
the PowerSwitch Tail II to pin +P9_14+.
.. _displays_powerSwitch_fig:
......@@ -221,6 +234,7 @@ Code for using an external LED (fadeLED.js)
Discussion
*************
The Bone has several outputs that can be use as pwm's as shown in :ref:`<cape-headers-pwm_fig>>.
There are three +EHRPWM+'s which each has a pair of pwm channels. Each pair must have the same period.
......@@ -237,6 +251,7 @@ The pwm's are accessed through +/dev/bone/pwm+
.. todo:: Should this be /dev/bone/pwm?
.. code-block:: bash
bone$ cd /dev/bone/pwm
bone$ ls
0 1 2
......@@ -244,6 +259,7 @@ The pwm's are accessed through +/dev/bone/pwm+
Here we see six pwmchips that can be used, each has two channels. Explore one.
.. code-block:: bash
bone$ cd 1
bone$ ls
a b
......@@ -255,13 +271,15 @@ Here we see six pwmchips that can be used, each has two channels. Explore one.
Attach in LED to P9_14 and if you set the period long enough you can see the LED flash.
.. code-block:: bash
bone$ echo 1000000000 > period
bone$ echo 500000000 > duty_cycle
bone$ echo 1 > enable
Your LED should now be flashing.
:ref:`<display_pwm_mapping>` are the mapping I've figured out so far. I don't know how to get to the timers.
:ref:`<display_pwm_mapping>` are the mapping I've figured out
so far. I don't know how to get to the timers.
.. _display_pwm_mapping:
......@@ -296,6 +314,7 @@ You have an I^2^C-based LED matrix to interface.
Solution
*************
There are a number of nice LED matrices that allow you to control several LEDs via one interface.
This solution uses an `Adafruit Bicolor 8x8 LED Square Pixel Matrix w/I^2^C Backpack <http://www.adafruit.com/products/902>`_.
......@@ -336,11 +355,13 @@ Using I^2^C command-line tools to discover the address of the display
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --
Here, you can see a device at +0x49+ and +0x70+. I know I have a temperature sensor at +0x49+, so the LED matrix must be at +0.70+.
Here, you can see a device at +0x49+ and +0x70+. I know I have a temperature
sensor at +0x49+, so the LED matrix must be at +0.70+.
Find the code in :ref:`<displays_matrix_i2c>` and run it by using the following command:
.. code-block:: bash
bone$ pip install smbus # (Do this only once.)
bone$ ./matrixLEDi2c.py
......@@ -379,16 +400,19 @@ You have a 5 V device to drive, and the Bone has 3.3 V outputs.
Solution
*************
If you are lucky, you might be able to drive a 5 V device from the Bone's 3.3 V output. Try it and see if it works. If not, you need a level translator.
If you are lucky, you might be able to drive a 5 V device from the Bone's 3.3 V output.
Try it and see if it works. If not, you need a level translator.
What you will need for this recipe:
* A PCA9306 level translator (see :ref:`app ic<app_ic>`)
* A 5 V power supply (if the Bone's 5 V power supply isn't enough)
The PCA9306 translates signals at 3.3 V to 5 V in both directions. It's meant to work with I^2^C devices that have a pull-up resistor, but it can work with anything needing translation.
The PCA9306 translates signals at 3.3 V to 5 V in both directions. It's meant to work with
I^2^C devices that have a pull-up resistor, but it can work with anything needing translation.
:ref:`<displays_i2cMatrixLevelTrans_fig>` shows how to wire a PCA9306 to an LED matrix. The left is the 3.3 V side and the right is the 5 V side. Notice that we are using the Bone's built-in 5 V power supply.
:ref:`<displays_i2cMatrixLevelTrans_fig>` shows how to wire a PCA9306 to an LED matrix.
The left is the 3.3 V side and the right is the 5 V side. Notice that we are using the Bone's built-in 5 V power supply.
.. _displays_i2cMatrixLevelTrans_fig:
......@@ -410,12 +434,14 @@ Writing to a NeoPixel LED String Using the PRUs
Problem
*************
You have an :ref:`Adafruit NeoPixel LED string <http://www.adafruit.com/products/1138>`_ or `Adafruit NeoPixel LED matrix <http://www.adafruit.com/products/1487>`_ and want to light it up.
You have an :ref:`Adafruit NeoPixel LED string <http://www.adafruit.com/products/1138>`_ or
`Adafruit NeoPixel LED matrix <http://www.adafruit.com/products/1487>`_ and want to light it up.
Solution
*************
The PRU Cookbook has a nice discussion (https://markayoder.github.io/PRUCookbook/05blocks/blocks.html#blocks_ws2812[WS2812 (NeoPixel) driver]) on driving NeoPixels.
The PRU Cookbook has a nice discussion
(https://markayoder.github.io/PRUCookbook/05blocks/blocks.html#blocks_ws2812[WS2812 (NeoPixel) driver]) on driving NeoPixels.
.. _py_neoPixelMatrix_fig:
......@@ -474,6 +500,7 @@ Solution
Just install the _flite_ text-to-speech program:
.. code-block:: bash
bone$ sudo apt install flite
......
......@@ -21,11 +21,19 @@ The type of motor you use depends on the type of motion you want:
When you know which type of motor to use, interfacing is easy. This chapter shows how to interface with each of these motors.
.. note:: Motors come in many sizes and types. This chapter presents some of the more popular types and shows how they can interface easily to the Bone. If you need to turn on and off a 120 V motor, consider using something like the PowerSwitch presented in :ref:`<displays_powerSwitch>`.
.. note::
Motors come in many sizes and types. This chapter presents some of the more popular
types and shows how they can interface easily to the Bone. If you need to turn on and
off a 120 V motor, consider using something like the PowerSwitch presented in :ref:`<displays_powerSwitch>`.
.. note:: The Bone has built-in 3.3 V and 5 V supplies, which can supply enough current to drive some small motors. Many motors, however, draw enough current that an external power supply is needed. Therefore, an external 5 V power supply is listed as optional in many of the recipes.
.. note::
The Bone has built-in 3.3 V and 5 V supplies, which can supply enough current to drive
some small motors. Many motors, however, draw enough current that an external power
supply is needed. Therefore, an external 5 V power supply is listed as optional in many of the recipes.
.. note:: All the examples in the book assume you have cloned the Cookbook repository on www.github.com. Go here :ref:`<basics_repo>` for instructions.
.. note::
All the examples in the book assume you have cloned the Cookbook repository on
www.github.com. Go here :ref:`<basics_repo>` for instructions.
.. _motors_servo:
......@@ -50,11 +58,16 @@ To make the recipe, you will need:
* 1 k&#8486; resistor (optional, see :ref:`<app_resistor>`)
* 5 V power supply (optional, see :ref:`<app_misc>`)
The 1 k&#8486; resistor isn't required, but it provides some protection to the general-purpose input/output (GPIO) pin in case the servo fails and draws a large current.
The 1 k&#8486; resistor isn't required, but it provides some protection to the general-purpose
input/output (GPIO) pin in case the servo fails and draws a large current.
Wire up your servo, as shown in :ref:`<motors_servoMotor>`.
.. note:: There is no standard for how servo motor wires are colored. One of my servos is wired like :ref:`<motors_servoMotor>`: red is 3.3 V, black is ground, and yellow is the control line. I have another servo that has red as 3.3 V and ground is brown, with the control line being orange. Generally, though, the 3.3 V is in the middle. Check the datasheet for your servo before wiring.
.. note::
There is no standard for how servo motor wires are colored. One of my servos is wired
like :ref:`<motors_servoMotor>`: red is 3.3 V, black is ground, and yellow is the control line.
I have another servo that has red as 3.3 V and ground is brown, with the control line being orange.
Generally, though, the 3.3 V is in the middle. Check the datasheet for your servo before wiring.
.. _motors_servoMotor:
......@@ -64,7 +77,8 @@ Wire up your servo, as shown in :ref:`<motors_servoMotor>`.
Driving a servo motor with the 3.3 V power supply
The code for controlling the servo motor is in _servoMotor.py_, shown in :ref:`<py_servoMotor_code>`. You need to configure the pin for PWM.
The code for controlling the servo motor is in _servoMotor.py_, shown
in :ref:`<py_servoMotor_code>`. You need to configure the pin for PWM.
.. code-block:: bash
......@@ -77,12 +91,14 @@ The code for controlling the servo motor is in _servoMotor.py_, shown in :ref:`<
.. _py_servoMotor_code:
Code for driving a servo motor (servoMotor.py)
.. code-block:: python
include::code/servoMotor.py[]
.. _motors_servoMotor_code:
Code for driving a servo motor (servoMotor.js)
.. code-block:: JavaScript
......@@ -111,6 +127,7 @@ Combine the code from :ref:`<digital_rotaryEncoder_js>` and :ref:`<motors_servo>
.. code-block:: bash
bone$ <strong>config-pin P9_16 pwm</strong>
bone$ <strong>config-pin P8_11 eqep</strong>
bone$ <strong>config-pin P8_12 eqep</strong>
......@@ -127,7 +144,7 @@ Code for driving a servo motor with a rotary encorder(servoEncoder.py)
.. _motors_dcSpeed:
Controlling the Speed of a DC Motor
--------------------------------------------
-------------------------------------
Problem
**************
......@@ -137,9 +154,13 @@ You have a DC motor (or a solenoid) and want a simple way to control its speed,
Solution
**********
It would be nice if you could just wire the DC motor to BeagleBone Black and have it work, but it won't. Most motors require more current than the GPIO ports on the Bone can supply. Our solution is to use a transistor to control the current to the bone.
It would be nice if you could just wire the DC motor to BeagleBone Black and have it work,
but it won't. Most motors require more current than the GPIO ports on the Bone can supply.
Our solution is to use a transistor to control the current to the bone.
Here we configure the encoder to returns value between 0 and 180 inclusive. This value is then mapped to a value between +min+ (0.6 ma) and +max+ (2.5 ms). This number is converted from milliseconds and nanoseconds (time 1000000) and sent to the servo motor via the pwm.
Here we configure the encoder to returns value between 0 and 180 inclusive. This value is then
mapped to a value between +min+ (0.6 ma) and +max+ (2.5 ms). This number is converted from
milliseconds and nanoseconds (time 1000000) and sent to the servo motor via the pwm.
Here's what you will need:
......
......@@ -4,18 +4,24 @@ Beyond the Basics
##################
Introduction
------------------------
In :ref:`<basics>`, you learned how to set up BeagleBone Black, and :ref:`<sensors>`, :ref:`<displays>`, and :ref:`<motors>` showed how to interface to the physical world. The remainder of the book moves into some more exciting advanced topics, and this chapter gets you ready for them.
---------------
In :ref:`<basics>`, you learned how to set up BeagleBone Black, and
:ref:`<sensors>`, :ref:`<displays>`, and :ref:`<motors>` showed how to
interface to the physical world. The remainder of the book moves into some
more exciting advanced topics, and this chapter gets you ready for them.
The recipes in this chapter assume that you are running Linux on your host computer (:ref:`<tips_pick_os>`) and are comfortable with using Linux. We continue to assume that you are logged in as +debian+ on your Bone.
The recipes in this chapter assume that you are running Linux on your host
computer (:ref:`<tips_pick_os>`) and are comfortable with using Linux. We
continue to assume that you are logged in as +debian+ on your Bone.
.. _tips_hdmi:
Running Your Bone Standalone
------------------------
-----------------------------
Problem
*************
*********
You want to use BeagleBone Black as a desktop computer with keyboard, mouse, and an HDMI display.
......@@ -32,9 +38,14 @@ To make this recipe, you will need:
* USB keyboard and mouse
* Powered USB hub (see :ref:`<app_misc>`)
.. note:: The microHDMI adapter is nice because it allows you to use a regular HDMI cable with the Bone. However, it will block other ports and can damage the Bone if you aren't careful. The microHDMI-to-HDMI cable won't have these problems.
.. note::
The microHDMI adapter is nice because it allows you to use a regular HDMI cable
with the Bone. However, it will block other ports and can damage the Bone if you
aren't careful. The microHDMI-to-HDMI cable won't have these problems.
.. tip:: You can also use an HDMI-to-DVI cable (:ref:`<app_misc>`) and use your Bone with a DVI-D display.
.. tip::
You can also use an HDMI-to-DVI cable (:ref:`<app_misc>`)
and use your Bone with a DVI-D display.
The adapter looks something like :ref:`<tips_HDMI_adaptor_fig>`.
......@@ -60,24 +71,25 @@ If nothing appears after the reboot, edit the _/boot/uEnv.txt_ file. Search for
Then reboot.
////
PRODUCTION: in the following tip, we're trying to display the hash symbol (#), all by itself, in constant width. Using +#+ produces an empty space in the build, and I don't know how to escape special characters within what should be literal strings.
.. PRODUCTION: in the following tip, we're trying to display the hash symbol (#), all by itself, in constant width. Using +#+ produces an empty space in the build, and I don't know how to escape special characters within what should be literal strings.
Adding to my confusion, the # signs are dropped in the first paragraph of the tip, but not in the second, which is formatted in the same exact way.
.. Adding to my confusion, the # signs are dropped in the first paragraph of the tip, but not in the second, which is formatted in the same exact way.
.. Also, using ## in the code italicizes the second # and everything after it in the line, which should not happen.
Also, using ## in the code italicizes the second # and everything after it in the line, which should not happen.
////
The _/boot/uEnv.txt_ file contains a number of configuration commands that are executed at boot time. The +#+ character is used to add comments; that is, everything to the right of a +# is ignored by the Bone and is assumed to be for humans to read. In the previous example, +###Disable auto loading+ is a comment that informs us the next line(s) are for disabling things. Two +disable_uboot_overlay+ commands follow. Both should be commented-out and won't be executed by the Bon
Why not just remove the line? Later, you might decide you need more general-purpose input/output (GPIO) pins and don't need the HDMI display. If so, just remove the +#+ from the +disable_uboot_overlay_video=1+ command. If you had completely removed the line earlier, you would have to look up the details somewhere to re-create it.
When in doubt, comment-out; don't delete.
.. note:: If you want to re-enable the HDMI audio, just comment-out the line you added.
.. note::
If you want to re-enable the HDMI audio, just comment-out the line you added.
The Bone has only one USB port, so you will need to get either a keyboard with a USB hub (see :ref:`<app_misc>`) or a USB hub. Plug the USB hub into the Bone and then plug your keyboard and mouse in to the hub. You now have a Beagle workstation; no host computer is needed.
.. tip:: A powered hub is recommended because USB can supply only 500 mA, and you'll want to plug many things into the Bone.
.. tip::
A powered hub is recommended because USB can supply only 500 mA, and you'll want to plug many things into the Bone.
Discussion
*************
......@@ -124,7 +136,9 @@ Solution
*************
:ref:`<basics_vsc_IDE>` shows how to run shell commands in the Visual Studio Code +bash+ tab. However, the Bone has Secure Shell (SSH) enabled right out of the box, so you can easily connect by using the following command to log in as user +debian+, (note the +$+ at the end of the prompt):
:ref:`<basics_vsc_IDE>` shows how to run shell commands in the Visual Studio Code +bash+ tab.
However, the Bone has Secure Shell (SSH) enabled right out of the box, so you can easily
connect by using the following command to log in as user +debian+, (note the +$+ at the end of the prompt):
.. code-block:: bash
......@@ -184,7 +198,7 @@ Looks like I'm already in the group, but if you aren't, just add yourself to the
.. code-block:: bash
host$ sudo adduser $USER dialout
host$ sudo adduser $USER dialout
You have to run +adduser+ only once. Your host computer will remember the next time you boot up. Now, install and run the +screen+ command:
......@@ -228,9 +242,13 @@ To make this recipe, you will need:
* 3.3 V FTDI cable (see :ref:`<app_misc>`)
.. warning:: Be sure to get a 3.3 V FTDI cable (shown in :ref:`<tips_FTDIcable_fig>`), because the 5 V cables won't work.
.. warning::
Be sure to get a 3.3 V FTDI cable (shown in :ref:`<tips_FTDIcable_fig>`),
because the 5 V cables won't work.
.. tip:: The Bone's Serial Debug J1 connector has Pin 1 connected to ground, Pin 4 to receive, and Pin 5 to transmit. The other pins are not attached.
.. tip::
The Bone's Serial Debug J1 connector has Pin 1 connected to ground,
Pin 4 to receive, and Pin 5 to transmit. The other pins are not attached.
.. _tips_FTDIcable_fig:
......@@ -241,7 +259,8 @@ To make this recipe, you will need:
FTDI cable
Look for a small triangle at the end of the FTDI cable (:ref:`<tips_FTDIconnector_fig>`). It's often connected to the black wire.
Look for a small triangle at the end of the FTDI cable (:ref:`<tips_FTDIconnector_fig>`).
It's often connected to the black wire.
.. _tips_FTDIconnector_fig:
......@@ -252,9 +271,9 @@ Look for a small triangle at the end of the FTDI cable (:ref:`<tips_FTDIconnecto
FTDI connector
Next, look for the FTDI pins of the Bone (labeled +J1+ on the Bone),
shown in :ref:`<tips_black_hardware_details_fig>`.
They are next to the P9 header and begin near pin 20. There is a white dot near P9_20.
Next, look for the FTDI pins of the Bone (labeled +J1+ on the Bone), shown in
:ref:`<tips_black_hardware_details_fig>`. They are next to the P9 header
and begin near pin 20. There is a white dot near P9_20.
.. _tips_black_hardware_details_fig:
......@@ -286,7 +305,9 @@ Now, run the following commands on your host computer:
beaglebone login:
.. note:: Your screen might initially be blank. Press Enter a couple times to see the login prompt.
.. note::
Your screen might initially be blank. Press Enter
a couple times to see the login prompt.
Discussion
*************
......@@ -313,7 +334,9 @@ Log in to your Bone and enter the following command:
Discussion
*************
:ref:`<basics_latest_os>` shows how to open the _ID.txt_ file to see the OS version. The _/etc/dogtag_ file has the same contents and is easier to find if you already have a command prompt. See :ref:`<basics_install_os>` if you need to update your OS.
:ref:`<basics_latest_os>` shows how to open the _ID.txt_ file to see the OS version.
The _/etc/dogtag_ file has the same contents and is easier to find if you already
have a command prompt. See :ref:`<basics_install_os>` if you need to update your OS.
Controlling the Bone Remotely with a VNC
------------------------
......@@ -382,9 +405,13 @@ Click Connect to start graphical access to your Bone, as shown in :ref:`<tips_vn
The Remmina Remote Desktop Client showing the BeagleBone desktop
.. tip:: You might need to resize the VNC screen on your host to see the bottom menu bar on your Bone.
.. tip::
You might need to resize the VNC screen on your
host to see the bottom menu bar on your Bone.
.. note:: You need to have X Windows installed and running for the VNC to work. Here's how to install it. This needs some 250M of disk space and 19 minutes to install.
.. note::
You need to have X Windows installed and running for the VNC to work.
Here's how to install it. This needs some 250M of disk space and 19 minutes to install.
.. code-block:: bash
......@@ -504,14 +531,18 @@ You want to run an editor to change a file.
Solution
*************
The Bone comes with a number of editors. The simplest to learn is +nano+. Just enter the following command:
The Bone comes with a number of editors. The simplest to learn is +nano+.
Just enter the following command:
.. code-block:: bash
bone$ nano file
bone$ nano file
You are now in nano (:ref:`<tips_nano_fig>`). You can't move around the screen using the mouse, so use the arrow keys. The bottom two lines of the screen list some useful commands. Pressing &#708;G (Ctrl-G) will display more useful commands. &#708;X (Ctrl-X) exits nano and gives you the option of saving the file.
You are now in nano (:ref:`<tips_nano_fig>`). You can't move around the screen
using the mouse, so use the arrow keys. The bottom two lines of the screen
list some useful commands. Pressing &#708;G (Ctrl-G) will display more useful
commands. &#708;X (Ctrl-X) exits nano and gives you the option of saving the file.
.. _tips_nano_fig:
......@@ -522,7 +553,9 @@ You are now in nano (:ref:`<tips_nano_fig>`). You can't move around the screen u
Editing a file with nano
.. tip:: By default, the file you create will be saved in the directory from which you opened +nano+.
.. tip::
By default, the file you create will be saved
in the directory from which you opened +nano+.
Discussion
*************
......@@ -557,7 +590,8 @@ and the other end into your home hub/router. The yellow and green link lights on
The RJ45 port on the Bone
If your router is already configured to run DHCP (Dynamical Host Configuration Protocol), it will automatically assign an IP address to the Bone.
If your router is already configured to run DHCP (Dynamical Host Configuration Protocol),
it will automatically assign an IP address to the Bone.
.. warning:: It might take a minute or two for your router to detect the Bone and assign the IP address.
......@@ -602,9 +636,12 @@ The +inet+ field shows that my Internet address is +10.0.5.144+ for the RJ45 con
On my university campus, you must register your MAC address before any device will work on the network.
The +HWaddr+ field gives the MAC address. For +eth0+, it's +c8:a0:30:a6:26:e8+.
The IP address of your Bone can change. If it's been assigned by DHCP, it can change at any time. The MAC address, however, never changes; it is assigned to your ethernet device when it's manufactured.
The IP address of your Bone can change. If it's been assigned by DHCP, it can change at any time.
The MAC address, however, never changes; it is assigned to your ethernet device when it's manufactured.
.. warning:: When a Bone is connected to some networks it becomes visible to the _world_. If you don't secure your Bone, the world will soon find it. See :ref:`<tips_passwords>` and :ref:`<tips_firewall
.. warning::
When a Bone is connected to some networks it becomes visible to the _world_. If you don't secure your Bone,
the world will soon find it. See :ref:`<tips_passwords>` and :ref:`<tips_firewall
On many home networks, you will be behind a firewall and won't be as visible.
......@@ -658,7 +695,9 @@ To make this recipe, you will need:
* USB Wifi adapter (see :ref:`<app_misc>`)
* 5 V external power supply (see :ref:`<app_misc>`)
.. warning:: Most adapters need at least 1 A of current to run, and USB supplies only 0.5 A, so be sure to use an external power supply. Otherwise, you will experience erratic behavior and random crashes.
.. warning::
Most adapters need at least 1 A of current to run, and USB supplies only 0.5 A, so be sure to use an
external power supply. Otherwise, you will experience erratic behavior and random crashes.
First, plug in the WiFi adapter and the 5 V external power supply and reboot.
......@@ -723,7 +762,7 @@ If no name appears, try +ip a+:
.. code-block:: bash
bone$ sudo nano /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
bone$ sudo nano /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
In the file you'll see:
......@@ -870,7 +909,8 @@ Web servers typically listen to port +80+. First, look up the IP address of your
It's the number following +inet addr:+, which in my case is +137.112.41.35+.
.. tip:: If you are on a wireless network, find the IP address associated with +wlan0+.
.. tip::
If you are on a wireless network, find the IP address associated with +wlan0+.
Then run the following, using your host's IP address:
......@@ -909,6 +949,7 @@ Check out https://www.howtogeek.com/devops/how-to-secure-your-linux-server-with-
I'll summarize the initial setup here.
First install and check the status:
.. code-block:: bash
bone$ sudo apt install ufw
......@@ -917,6 +958,7 @@ First install and check the status:
Now turn off everything coming in and leave on all outgoing. Note, this won't take effect until +ufw+ is enabled.
.. code-block:: bash
bone$ sudo ufw default deny incoming
......@@ -924,6 +966,7 @@ Now turn off everything coming in and leave on all outgoing. Note, this won't t
Don't enable yet, make sure +ssh+ still has access
.. code-block:: bash
bone$ sudo ufw allow 22
......@@ -973,8 +1016,8 @@ The firewall will remain on, even after a reboot. Disable it now if you don't wa
.. code-block:: bash
bone$ sudo ufw disable
Firewall stopped and disabled on system startup
bone$ sudo ufw disable
Firewall stopped and disabled on system startup
See the How-To Geek article for more examples.
......@@ -995,7 +1038,9 @@ You want to do more cool things with your BeagleBone by installing more programs
Solution
*************
.. warning:: Your Bone needs to be on the network for this to work. See :ref:`<networking_wired>`, :ref:`<networking_wireless>`, or :ref:`<networking_usb>`.
.. warning::
Your Bone needs to be on the network for this to work. See :ref:`<networking_wired>`,
:ref:`<networking_wireless>`, or :ref:`<networking_usb>`.
The easiest way to install more software is to use +apt+:
......@@ -1005,7 +1050,10 @@ The easiest way to install more software is to use +apt+:
bone$ sudo apt install "name of software"
A +sudo+ is necessary since you aren't running as +root+. The first command downloads package lists from various repositories and updates them to get information on the newest versions of packages and their dependencies. (You need to run it only once a week or so.) The second command fetches the software and installs it and all packages it depends on.
A +sudo+ is necessary since you aren't running as +root+. The first command downloads
package lists from various repositories and updates them to get information on the
newest versions of packages and their dependencies. (You need to run it only once a week or so.)
The second command fetches the software and installs it and all packages it depends on.
How do you find out what software you can install? Try running this:
......@@ -1027,7 +1075,7 @@ Suppose that you would like to install an online dictionary (+dict+). Just run t
.. code-block:: bash
bone$ sudo apt install dict
bone$ sudo apt install dict
Now you can run +dict+.
......@@ -1035,12 +1083,10 @@ Now you can run +dict+.
Discussion
*************
.. _tips_apt_remove:
Removing Packages Installed with apt
------------------------
-------------------------------------
Problem
*************
......@@ -1054,18 +1100,18 @@ Solution
.. code-block:: bash
bone$ sudo apt remove dict
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libmaa3 librecode0 recode
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
dict
0 upgraded, 0 newly installed, 1 to remove and 27 not upgraded.
After this operation, 164 kB disk space will be freed.
Do you want to continue [Y/n]? y
bone$ sudo apt remove dict
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libmaa3 librecode0 recode
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
dict
0 upgraded, 0 newly installed, 1 to remove and 27 not upgraded.
After this operation, 164 kB disk space will be freed.
Do you want to continue [Y/n]? y
Discussion
......@@ -1162,7 +1208,9 @@ Removing preinstalled packages
You might not need a few things that come preinstalled in the Debian image, including such things as OpenCV, the Chromium web browser, and some documentation.
.. note:: The Chromium web browser is the open source version of Google's Chrome web browser. Unless you are using the Bone as a desktop computer, you can probably remove it.
.. note::
The Chromium web browser is the open source version of Google's Chrome web browser.
Unless you are using the Bone as a desktop computer, you can probably remove it.
Here's how you can remove these:
......@@ -1288,7 +1336,7 @@ Discussion
.. _misc_libsoc:
Using C to Interact with the Physical World
------------------------
--------------------------------------------
Problem
*************
......
......@@ -13,7 +13,7 @@ wirelessly (:ref:`<networking_wireless>`), or through the USB to a host and then
Now that you're online, this chapter offers various things to do with your connection.
Accessing Your Host Computer's Files on the Bone
---------------------------------------------
-------------------------------------------------
Problem
*********
......@@ -65,7 +65,7 @@ and then access:
Here, we are accessing the files on the Bone as +debian+. We’ve mounted the entire file system, starting with +/+, so you can access any file. Of course, with great power comes great responsibility, so be careful.
Discussion
*********
************
The +sshfs+ command gives you easy access from one computer to another. When you are done, you can unmount the files by using the following commands:
......@@ -107,7 +107,9 @@ A sample web page (test.html)
You will see the web page shown in :ref:`<networking_node_page>`.
.. _networking_node_page:
.test.html as served by nginx
test.html as served by nginx
.. figure:: figures/nginxTest.png
:align: center
:alt: test.html served by nginx
......@@ -356,7 +358,8 @@ or
http://192.168.7.2:8081/ledRed/off
For the above example, *ledRed* is the “deviceName” and *on* or *off* are examples of possible “action”. Those routes will be identified and properly “worked”. The main steps are:
For the above example, *ledRed* is the “deviceName” and *on* or *off* are examples of
possible “action”. Those routes will be identified and properly “worked”. The main steps are:
* Convert the string “ledRED”, for example, on its equivalent GPIO pin.
......@@ -876,6 +879,7 @@ Installing Node-RED
To install Node-RED, run the following commands:
.. code-block:: bash
bone$ cd # Change to home directory
bone$ git clone https://github.com/node-red/node-red.git
bone$ cd node-red/
......@@ -955,7 +959,8 @@ Node-RED twitter authorization, step 2
.. [start=5]
- Click the "here" link, as shown in :ref:`<networking_node_twitter_auth2_fig>`, and you'll be taken to Twitter to authorize Node-RED.
- Click the "here" link, as shown in :ref:`<networking_node_twitter_auth2_fig>`, and you'll
be taken to Twitter to authorize Node-RED.
- Log in to Twitter and click the "Authorize app" button (:ref:`<networking_node_twitter_auth3_fig>`).
......@@ -969,7 +974,9 @@ Node-RED Twitter site authorization
.. [start=7]
- When you're back to Node-RED, click the Add button, add your Twitter credentials, enter the hashtags to respond to (:ref:`<networking_node_twitter_beagle_fig>`), and then click the Ok pass:[<span class="keep-together">button</span>].
- When you're back to Node-RED, click the Add button, add your Twitter credentials,
enter the hashtags to respond to (:ref:`<networking_node_twitter_beagle_fig>`), and then
click the Ok pass:[<span class="keep-together">button</span>].
.. _networking_node_twitter_beagle_fig:
......@@ -1034,7 +1041,7 @@ Click Ok and then Deploy.
Test again. The LED will toggle every time the hashtag +#BeagleBone+ is tweeted. With a little more exploring, you should be able to have your Bone ringing a bell or spinning a motor in response to tweets.
Discussion
*********
***********
Communicating over a Serial Connection to an Arduino or LaunchPad
-------------------------------------------------------------------
......@@ -1065,9 +1072,8 @@ Wiring a LaunchPad to a Bone via the common serial port
:align: center
:alt: MSP430 LaunchPad
Add the code (or _sketch_, as it's called in Arduino-speak) in
:ref:`<js_launchPad_code>` to a file called _launchPad.ino_
and run it on your LaunchPad.
Add the code (or _sketch_, as it's called in Arduino-speak) in :ref:`<js_launchPad_code>`
to a file called _launchPad.ino_ and run it on your LaunchPad.
.. _js_launchPad_code:
......@@ -1128,7 +1134,7 @@ Code for communicating via the UART (launchPad.js)
Table of UART outputs
Discussion
*********
************
When you run the script in :ref:`<js_launchPadBeagle_code>`, the Bone opens up the
serial port and every second sends a new command, either +r+ or +g+.
......
......@@ -16,11 +16,13 @@ can have multiple kernels on your system at the same time and select from among
// TODO is this still true?
.. note:: We assume here that you are logged on to your Bone as +root+ and superuser privileges. You also need to be logged in to your Linux host computer as a nonsuperuser.
.. note::
We assume here that you are logged on to your Bone as +root+ and superuser privileges.
You also need to be logged in to your Linux host computer as a nonsuperuser.
Updating the Kernel
---------------------------------
---------------------
Problem
***********
......@@ -109,13 +111,16 @@ When compiling on the Bone, all you need to do is load the Kernel Headers for th
.. code-block:: bash
bone$ sudo apt install linux-headers-`uname -r`
bone$ sudo apt install linux-headers-`uname -r`
.. note:: ((("&#x60; character (backtick)")))((("backtick (&#x60;) character")))The quotes around +`uname -r`+ are backtick characters. On a United States keyboard, the backtick key is to the left of the 1 key.
.. note::
The quotes around +`uname -r`+ are backtick characters. On a United States keyboard,
the backtick key is to the left of the 1 key.
This took a little more than three minutes on my Bone. The +`uname -r`+ part of the command looks up what version of the kernel you are running and loads the headers for it.
This took a little more than three minutes on my Bone. The +`uname -r`+ part of the command
looks up what version of the kernel you are running and loads the headers for it.
Next, add the code in :ref:`<kernel_Makefle>` to a file called _Makefile_.
......@@ -129,7 +134,9 @@ Simple Kernel Module (_Makefile_)
.. note:: Replace the two instances of +<TAB>+ with a tab character (the key left of the Q key on a United States keyboard). The tab characters are very important to makefiles and must appear as shown.
.. note::
Replace the two instances of +<TAB>+ with a tab character (the key left of the Q key on a United States keyboard).
The tab characters are very important to makefiles and must appear as shown.
Now, compile the kernel module by using the +make+ command:
......@@ -262,6 +269,7 @@ First, you need to map the +P9+ header location to GPIO number using :ref:`<kern
.. _kernel_gpio_map_fig:
.Mapping P9_42 header position to GPIO 7
.. figure:: figures/cape-headers-digitalGPIO7.png
:align: center
:alt: Mapping Header Position to GPIO Numbers
......@@ -367,7 +375,9 @@ Solution
This is easier than it sounds, thanks to some very powerful scripts.
.. warning:: Be sure to run this recipe on your host computer. The Bone has enough computational power to compile a module or two, but compiling the entire kernel takes lots of time and resourses.
.. warning::
Be sure to run this recipe on your host computer. The Bone has enough computational
power to compile a module or two, but compiling the entire kernel takes lots of time and resourses.
Downloading and Compiling the Kernel
......@@ -456,12 +466,15 @@ Now, while in the _bb-kernel_ directory, run the following command:
Are you 100% sure, on selecting [/dev/sdb] (y/n)? y
The script lists the partitions it sees and asks if you have the correct one. If you are sure, press Y, and the script will uncompress and copy the files to the correct locations on your card. When this is finished, eject your card, plug it into the Bone, and boot it up. Run +uname -a+, and you will see that you are running your compiled kernel.
The script lists the partitions it sees and asks if you have the correct one.
If you are sure, press Y, and the script will uncompress and copy the files to
the correct locations on your card. When this is finished, eject your card, plug
it into the Bone, and boot it up. Run +uname -a+, and you
will see that you are running your compiled kernel.
Discussion
***********
.. _kernel_using_cross_compiler:
Using the Installed Cross Compiler
......@@ -470,7 +483,8 @@ Using the Installed Cross Compiler
Problem
***********
You have followed the instructions in :ref:`<kernel_compiling>` and want to use the cross compiler it has downloaded.
You have followed the instructions in :ref:`<kernel_compiling>`
and want to use the cross compiler it has downloaded.
[TIP]
......@@ -488,7 +502,10 @@ Then skip down to :ref:`<kernel_skip_to_here>`.
Solution
***********
:ref:`<kernel_compiling>` installs a cross compiler, but you need to set up a couple of things so that it can be found. :ref:`<kernel_compiling>` installed the kernel and other tools in a directory called _bb-kernel_. Run the following commands to find the path to the cross compiler:
:ref:`<kernel_compiling>` installs a cross compiler, but you need to set up a
couple of things so that it can be found. :ref:`<kernel_compiling>` installed the
kernel and other tools in a directory called _bb-kernel_. Run the
following commands to find the path to the cross compiler:
.. code-block:: bash
......@@ -498,7 +515,8 @@ Solution
gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux.tar.xz
Here, the path to the cross compiler contains the version number of the compiler. Yours might be different from mine. +cd+ into it:
Here, the path to the cross compiler contains the version number
of the compiler. Yours might be different from mine. +cd+ into it:
.. code-block:: bash
......@@ -532,7 +550,8 @@ At this point, we are interested in what's in _bin_:
arm-linux-gnueabihf-gdb arm-linux-gnueabihf-strip
What you see are all the cross-development tools. You need to add this directory to the +$PATH+ the shell uses to find the commands it runs:
What you see are all the cross-development tools. You need to add this directory
to the +$PATH+ the shell uses to find the commands it runs:
.. code-block:: bash
......@@ -545,7 +564,9 @@ What you see are all the cross-development tools. You need to add this directory
/usr/games:/usr/local/games
The first command displays the path to the directory where the cross-development tools are located. The second shows which directories are searched to find commands to be run. Currently, the cross-development tools are not in the +$PATH+. Let's add it:
The first command displays the path to the directory where the cross-development
tools are located. The second shows which directories are searched to find commands
to be run. Currently, the cross-development tools are not in the +$PATH+. Let's add it:
.. code-block:: bash
......@@ -557,7 +578,8 @@ The first command displays the path to the directory where the cross-development
/usr/games:/usr/local/games
.. note:: Those are backtick characters (left of the "1" key on your keyboard) around +pwd+.((("&#x60; character (backtick)")))((("backtick (&#x60;) character")))
.. note::
Those are backtick characters (left of the "1" key on your keyboard) around +pwd+.
The second line shows the +$PATH+ now contains the directory with the cross-development tools.
......@@ -658,7 +680,8 @@ Look in the _hello_ directory to see what was created:
Discussion
***********
:ref:`<kernel_building_modules>` shows how to build and install a module, and :ref:`<kernel_create_patch>` shows how to create your own patch file.
:ref:`<kernel_building_modules>` shows how to build and install a module, and :ref:`<kernel_create_patch>`
shows how to create your own patch file.
.. _kernel_create_patch:
......@@ -671,6 +694,7 @@ You made a few changes to the kernel, and you want to share them with your frien
Solution
***********
Create a patch file that contains just the changes you have made. Before making your changes, check out a new branch:
.. code-block:: bash
......
......@@ -162,7 +162,8 @@ Your C code isn't responding fast enough to the input signal. You want to read t
Solution
**********
The solution is to use a simple utility called +devmem2+, with which you can read and write registers from the command line.
The solution is to use a simple utility called +devmem2+, with which
you can read and write registers from the command line.
.. warning::
......@@ -179,7 +180,8 @@ First, download and install +devmem2+:
bone$ <strong>sudo mv devmem2 /usr/bin</strong>
This solution will read a pushbutton attached to +P9_42+ and flash an LED attached to +P9_13+. Note that this is a
change from the previous solutions that makes the code used here much simpler. Wire up your Bone as shown in :ref:`<realtime_pushLEDmmap_fig>`.
change from the previous solutions that makes the code used here much simpler. Wire up your Bone as
shown in :ref:`<realtime_pushLEDmmap_fig>`.
.. _realtime_pushLEDmmap_fig:
......@@ -204,7 +206,11 @@ Finding +P9_13+ at GPIO 31, export GPIO 31 and make it an output:
The LED will turn on when +1+ is echoed into +value+ and off when +0+ is echoed.
Now that you know the LED is working, look up its memory address. This is where things get very detailed. First, download the http://bit.ly/1B4Cm45[AM335x Technical Reference Manual]. Look up +GPIO0+ in the Memory Map chapter (sensors). Table 2-2 indicates that +GPIO0+ starts at address +0x44E0_7000+. Then go to Section 25.4.1, "GPIO Registers." This shows that +GPIO_DATAIN+ has an offset of +0x138+, +GPIO_CLEARDATAOUT+ has an offset of +0x190+, and +GPIO_SETDATAOUT+ has an offset of +0x194+.
Now that you know the LED is working, look up its memory address. This is where things get very detailed.
First, download the http://bit.ly/1B4Cm45[AM335x Technical Reference Manual]. Look up +GPIO0+ in the
Memory Map chapter (sensors). Table 2-2 indicates that +GPIO0+ starts at address +0x44E0_7000+. Then
go to Section 25.4.1, "GPIO Registers." This shows that +GPIO_DATAIN+ has an offset of +0x138+, +GPIO_CLEARDATAOUT+
has an offset of +0x190+, and +GPIO_SETDATAOUT+ has an offset of +0x194+.
This means you read from address +0x44E0_7000+ + +0x138+ = +0x44E0_7138+ to see the status of the LED:
......@@ -216,7 +222,9 @@ This means you read from address +0x44E0_7000+ + +0x138+ = +0x44E0_7138+ to see
Value at address 0x44E07138 (0xb6f8e138): 0xC000C404
The returned value +0xC000C404+ (+1100 0000 0000 0000 1100 0100 0000 0100+ in binary) has bit 31 set to +1+, which means the LED is on. Turn the LED off by writing +0x80000000+ (+1000 0000 0000 0000 0000 0000 0000 0000+ binary) to the +GPIO_CLEARDATA+ register at +0x44E0_7000+ + +0x190+ = +0x44E0_7190+:
The returned value +0xC000C404+ (+1100 0000 0000 0000 1100 0100 0000 0100+ in binary) has bit 31 set to +1+,
which means the LED is on. Turn the LED off by writing +0x80000000+ (+1000 0000 0000 0000 0000 0000 0000 0000+ binary)
to the +GPIO_CLEARDATA+ register at +0x44E0_7000+ + +0x190+ = +0x44E0_7190+:
.. code-block:: bash
......@@ -334,7 +342,8 @@ Solution
The Kernel can be compiled with PREEMPT_RT enabled which reduces the delay from when a thread is scheduled to when it runs.
Switching to a PREEMPT_RT kernel is rather easy, but be sure to follow the steps in the Discussion to see how much the latencies are reduced.
Switching to a PREEMPT_RT kernel is rather easy, but be sure to follow the steps in the
Discussion to see how much the latencies are reduced.
* First see which kernel you are running:
......@@ -349,6 +358,7 @@ Switching to a PREEMPT_RT kernel is rather easy, but be sure to follow the steps
.. _realtime_kernel_update_fig:
The regular and RT kernels
.. figure:: figures/kernel_update.pn
:align: centerg
:alt: The regular and RT kernels
......@@ -403,7 +413,8 @@ Cyclictest
**********
+cyclictest+ is one tool for measuring the latency from when a thread is schduled and when it runs.
The +code/rt+ directory in the git repo has some scripts for gathering latency data and plotting it. Here's how to run the scripts.
The +code/rt+ directory in the git repo has some scripts for gathering latency data and plotting it.
Here's how to run the scripts.
* First look in :ref:`<realtime_install_fig>` to see what to install.
......@@ -420,7 +431,8 @@ The +code/rt+ directory in the git repo has some scripts for gathering latency d
bone$ <strong>time sudo ./hist.gen > nort.hist</strong>
:ref:`<realtime_hist_gen_fig>` shows what's being run. It defaults to 100,000 loops, so it takes a while. The data is saved in +nort.hist+, which stands for no RT histogram.
:ref:`<realtime_hist_gen_fig>` shows what's being run. It defaults to 100,000 loops, so it takes a while.
The data is saved in +nort.hist+, which stands for no RT histogram.
.. _realtime_hist_gen_fig:
......@@ -461,7 +473,9 @@ try running ./setup.sh. If that doesn't work try:
Congratulations you are running the RT kernel.
.. note:: If the Beagle appears to be running (the LEDs are flashing) but you are having trouble connecting via +ssh 192.168.7.2+, you can try connecting using the approach shown in :ref:`<tips_FTDI>`.
.. note::
If the Beagle appears to be running (the LEDs are flashing) but you are having trouble connecting
via +ssh 192.168.7.2+, you can try connecting using the approach shown in :ref:`<tips_FTDI>`.
Now run the scipt again (note it's being saved in +rt.hist+ this time.)
......
......@@ -18,7 +18,8 @@ A cape is simply a board--often a printed circuit board (PCB) that connects to t
and +P9+ headers and follows a few standard pin usages. You can stack up to four capes onto the
Bone. Capes can range in size from Bone-sized (:ref:`<capes_miniDisplay>`) to much larger than the Bone (:ref:`<capes_7inLCD>`).
This chapter shows how to attach a couple of capes, move your design to a protoboard, then to a PCB, and finally on to mass production.
This chapter shows how to attach a couple of capes, move your design to a protoboard, then to a PCB,
and finally on to mass production.
.. _capes_7inLCD:
......@@ -39,7 +40,10 @@ from `CircuitCo http://circuitco.com/`_ (shown in :ref:`<capes_7inLCD_fig>`) to
.. _capes_7inLCD_fig:
.. note:: Seven-inch LCD from CircuitCo, :ref:`<capes_7inLCD_fig>` was originally posted by CircuitCo at http://elinux.org/File:BeagleBone-LCD7-Front.jpg under a `Creative Commons Attribution-ShareAlike 3.0 Unported License <http://creativecommons.org/licenses/by-sa/3.0/>`_.
.. note::
Seven-inch LCD from CircuitCo, :ref:`<capes_7inLCD_fig>` was originally posted by CircuitCo
at http://elinux.org/File:BeagleBone-LCD7-Front.jpg under a
`Creative Commons Attribution-ShareAlike 3.0 Unported License <http://creativecommons.org/licenses/by-sa/3.0/>`_.
.. figure:: figures/LCD.png
:align: center
......@@ -72,7 +76,7 @@ Discussion
.. _capes_miniDisplay:
Using a 128 x 128-Pixel LCD Cape
-----------------------------
---------------------------------
Problem
***********
......@@ -82,7 +86,8 @@ You want to use a small LCD to display things other than the desktop.
Solution
***********
The http://bit.ly/1xd0r8p[MiniDisplay] is a 128 x 128 full-color LCD cape that just fits on the Bone, as shown in :ref:`<capes_miniDisplay_fig>`.
The http://bit.ly/1xd0r8p[MiniDisplay] is a 128 x 128 full-color LCD cape that just fits on the
Bone, as shown in :ref:`<capes_miniDisplay_fig>`.
.. _capes_miniDisplay_fig:
......@@ -99,6 +104,7 @@ To make this recipe, you will need:
Attach to the Bone and apply power. Then run the following commands:
.. code-block:: bash
# From http://elinux.org/CircuitCo:MiniDisplay_Cape
# Datasheet:
# https://www.crystalfontz.com/products/document/3277/ST7735_V2.1_20100505.pdf
......@@ -125,6 +131,7 @@ The `manufacturer's website <http://bit.ly/1xd0r8p>`_ suggests enabling SPI0 by
Hmmm, something isn't working here. Here's how to see what happened:
.. code-block:: bash
bone$ <strong>dmesg | tail</strong>
[ 625.334497] bone_capemgr.9: part_number 'BB-SPIDEV0', version 'N/A'
[ 625.334673] bone_capemgr.9: slot #11: generic override
......@@ -278,7 +285,7 @@ Discussion
.. _capes_soldering:
Moving from a Breadboard to a Protoboard
-----------------------------
-----------------------------------------
Problem
***********
......@@ -579,7 +586,6 @@ Looking at the stimulus you'll generate *before* you connect up your hardware wi
Discussion
***********
.. _capes_layout:
Laying Out Your Cape PCB
......@@ -621,7 +627,9 @@ through what's called a _via_. One of the goals of PCB design is to minimize the
:ref:`<capes_quickRobo_pcb>` wasn't my first try or my last. My approach was to see what was needed to hook where and
move the components around to make it easier for the autorouter to carry out its job.
.. note:: There are entire books and websites dedicated to creating PCB layouts. Look around and see what you can find. http://bit.ly/1wXTLki[SparkFun's guide to making PCBs] is particularly useful.
.. note::
There are entire books and websites dedicated to creating PCB layouts. Look around and see
what you can find. http://bit.ly/1wXTLki[SparkFun's guide to making PCBs] is particularly useful.
Customizing the Board Outline
*******************************
......@@ -657,7 +665,8 @@ Outline SVG for BeagleBone cape (beaglebone_cape_boardoutline.svg)
.. </dl>
.. ++++
The measurements are taken from the http://bit.ly/1C5rSa8[BeagleBone Black System Reference Manual], as shown in :ref:`<capes_dimensions_fig>`.
The measurements are taken from the http://bit.ly/1C5rSa8[BeagleBone Black System Reference Manual],
as shown in :ref:`<capes_dimensions_fig>`.
.. _capes_dimensions_fig:
......@@ -775,6 +784,7 @@ Windows, Mac, and Linux, but it has three `limitations <http://bit.ly/1E5Kh3l>`_
You can install Eagle PCB on your Linux host by using the following command:
.. code-block:: bash
host$ <strong>sudo apt install eagle</strong>
Reading package lists... Done
Building dependency tree
......@@ -840,7 +850,8 @@ The Eagle start screen
Ensure that the correct version number appears.
If you are moving a design from Fritzing to Eagle, see :ref:`<capes_schematic_migration>` for tips on converting from one to the other.
If you are moving a design from Fritzing to Eagle, see :ref:`<capes_schematic_migration>`
for tips on converting from one to the other.
*DesignSpark PCB*
......@@ -851,13 +862,16 @@ but it runs only on Windows. Also, it doesn't seem to have the following of Eagl
*Upverter*
In addition to free solutions you run on your desktop, you can also work with a browser-based tool called https://upverter.com/[Upverter]. With Upverter, you can collaborate easily, editing your designs from anywhere on the Internet. It also provides many conversion options and a PCB fabrication service.
In addition to free solutions you run on your desktop, you can also work with a browser-based
tool called https://upverter.com/[Upverter]. With Upverter, you can collaborate easily, editing
your designs from anywhere on the Internet. It also provides many conversion options and a PCB fabrication service.
.. note:: Don't confuse Upverter with Upconverter (:ref:`<capes_schematic_migration>`). Though their names differ by only three letters, they differ greatly in what they do.
.. note::
Don't confuse Upverter with Upconverter (:ref:`<capes_schematic_migration>`).
Though their names differ by only three letters, they differ greatly in what they do.
.. _capes_kicad:
*Kicad*
Unlike the previously mentioned free (no-cost) solutions, `Kicad <http://bit.ly/1b2bnBg >`_
......@@ -885,6 +899,7 @@ to convert the Fritzing file for the diagram shown in :ref:`<capes_quickRobo_fig
I found it necessary to install +libfreetype6+ and +freetype-py+ onto my system, but you might not need this first step:
.. code-block:: bash
host$ <strong>sudo apt install libfreetype6</strong>
Reading package lists... Done
Building dependency tree
......@@ -902,7 +917,9 @@ I found it necessary to install +libfreetype6+ and +freetype-py+ onto my system,
Cleaning up...
.. note:: All these commands are being run on the Linux-based host computer, as shown by the +host$+ prompt. Log in as a normal user, not +root+.
.. note::
All these commands are being run on the Linux-based host computer, as shown by the +host$+ prompt.
Log in as a normal user, not +root+.
Now, install the +schematic-file-converter+ tool:
......@@ -1037,7 +1054,9 @@ To make this recipe, you will need:
* Multimeter (see :ref:`app misc<app_misc>`)
* Your other components
Upload your design to http://oshpark.com[OSH Park] and order a few boards. :ref:`<capes_oshpark_share>` shows a resulting http://bit.ly/1MtlzAp[shared project page for the quickBot cape] created in :ref:`<capes_layout>`. We'll proceed to break down how this design was uploaded and shared to enable ordering fabricated PCBs.
Upload your design to http://oshpark.com[OSH Park] and order a few boards. :ref:`<capes_oshpark_share>`
shows a resulting http://bit.ly/1MtlzAp[shared project page for the quickBot cape] created in
:ref:`<capes_layout>`. We'll proceed to break down how this design was uploaded and shared to enable ordering fabricated PCBs.
.. _capes_oshpark_share:
......
......@@ -22,4 +22,3 @@ A cookbook for programming Beagles
07kernel/kernel.rst
08realtime/realtime.rst
09capes/capes.rst
10parts/parts.rst
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment