GETTING STARTED WITH BEAGLEBONE BLACK PDF
Getting. Started with. BeagleBone. Updated for the latest. BeagleBones running .. When Gerald Coley, the hardware designer of BeagleBone Black and all of. BeagleBone Black is his newest, strongest— and most affordable—tool for . For example: “Getting Started With BeagleBone by Matt Richardson (Maker Media). The Beagle Bone is a great step up from microcontrollers (such as AVR, PIC, Windows and its tougher to install the drives on Win than other OS's we'll start . and Ethernet works, wouldn't it be nice to get rid of that Ethernet cable? This tutorial may not work on beaglebone black or the latest versions of.
|Language:||English, Spanish, German|
|ePub File Size:||24.43 MB|
|PDF File Size:||11.24 MB|
|Distribution:||Free* [*Regsitration Required]|
Read the step-by-step getting started tutorial below to begin developing with BeagleBone · BeagleBone Black · BeagleBone Black Wireless. dutytowarn.info Please download the . You will get an output similar to the one shown belowname. Grant Root dutytowarn.info BeagleBone Black has faster processor, more memory Getting Started with.
This is the chapter web page to support the content in Chapter 1 of the book: The summary introduction to the chapter is as follows:. In this chapter, you are introduced to the BeagleBone platform hardware and its variant boards. In addition, the chapter lists accessories that can be very helpful in developing your own Beagle-based projects. By the end of this chapter, you should have an appreciation of the power and complexity of this computing platform. You should also be aware of the first steps to take to protect your boards from physical damage. The poster images are large format images that have been rendered for an A3 page size, which is
Next to the power connector, you have an LED to indicate when power is applied to the board. There are also four LEDs next to the reset button that can be programmed by you with software. Expansion Headers. These two expansion headers, labeled P8 and P9, allow you to integrate your BeagleBone into electronics projects.
The major components of the BeagleBone Black 8. Mini USB Port. Your computer will not only pro- vide power to the board over USB, but it also acts as a means of com- municating with it. You can also access BeagleBone reference informa- tion stored on-board; it will simply appear as a storage device when you plug it in to your computer.
MicroSD Card Slot. On a BeagleBone Black, the operating system is stored on the onboard flash memory see below and can be updated using the MicroSD card slot. Serial Header BeagleBone Black only. While both the original Beagle- Bone and the BeagleBone Black have serial outputs for accessing the terminal, only the BeagleBone Black breaks out one of the serial ports in its own header.
In the technical manuals, this memory is referred to as the eMMC. Boot Switch BeagleBone Black only. Holding down the boot switch when you power on your BeagleBone Black instructs the hardware to boot from the MicroSD card instead of the on-board flash memory. However, having all of these components handy will help you try out the projects in this book: By default, it uses Linux, which is free and open source.
dutytowarn.info - getting-started
While there are many different flavors, or distributions of Linux out there, BeagleBoard. There was a large software update in April The examples throughout this book will expect that you have at least this version.
Appen- dix A walks you through how to create an up-to-date MicroSD card. Connecting to Your BeagleBone As I mentioned before, there are a lot of ways to get things done with the BeagleBone and especially so when it comes to ways of connecting to its command line terminal. Most of the time, I prefer having the BeagleBone connected to my home network router via Ethernet.
Open your terminal and connect to the BeagleBone: Enter You can dismiss this message. If you have an original BeagleBone, be sure that the included MicroSD card is inserted into the slot.
To avoid this, hold the BeagleBone by its length-side edges as you plug in the cables Figure Connect to it via SSH: The Basics and Getting Set Up 11 www.
You can also use the IP address of the board instead. The first time you connect, your SSH client may warn you that the host is unknown.
To get to the terminal, click Applications, System Tools, then Terminal. Some operations, like creating, modifying and moving files around can also be done from the desktop environment if you prefer.
For more information on using the desktop environment, see Chapter 8. The Basics and Getting Set Up 13 www. Open a terminal window and type: The screen will blank besides a blinking cursor. Hit enter to display the login screen Figure The serial log in screen 5. Log in with the user name root.
Download and install PuTTY. Launch PuTTY. For the Connection Type, choose Serial. Type in the name of the serial port for your connection. On my system, it was COM7. Click OK. For Speed, type The rest of the defaults should be fine see Figure PuTTY settings for Windows computers 8. Press enter to be taken to the login screen.
The Basics and Getting Set Up 15 www. Connect the USB side of a 3. For now, however, your best bet is to get your BeagleBone on your Ethernet network. The Basics and Getting Set Up 17 www. It comes with a lot of power, customizability, and is heavily influenced by operating systems that date back to the early days of computing.
Besides the price free , the best part of using a Linux OS is the huge community of users, who have contributed their knowledge to the code itself and to help- ing other users.
While there are many different distributions, or flavors, of Linux, the people at BeagleBoard. At this prompt, you can enter commands to start programs, work with files such as create, delete, copy, and move them , compile your own programs, update system settings, and much more. The user account root is considered the superuser, or administrator of the sys- tem. But with great power comes great responsibility: This is how other computers on your net- work refer to your BeagleBone.
If you run a command to create a file without specifying another location, the file will be created in the working directory. This is the prompt for input. Filesystem Just like in many other operating systems, the Linux filesystem is an organ- ized structure of files within folders, or directories. Within the root of the filesystem, there are a few main directories, most of which are listed in Table Table Directories in the root of the filesystem. It tells you where you are in the filesystem.
You can use the cd command: To be sure, we can always exe- cute pwd again: Getting Around with Linux 21 www. An example directory structure. Use ls to show the contents of your home directory: For more information, see Chapter 8. Creating Files and Directories Use the command mkdir to create a new directory: We use the greater than sign to redirect that output to the file hello. Getting Around with Linux 23 www.
If you want to append text to the end of a file, the command you type will look like this: To see the results, use cat again: What a beautiful day! In other words, it will take a series of files and appends one after the other. To try that out, first make a few file: See you real soon! All these command line tools can make it fairly easy to work with files, but sometimes you might just want to get inside a file to view and edit its 24 Getting Started With BeagleBone www.
For that, I recommend the text editor nano. To open your file in nano, simply type nano followed by the file you want to open. To save, type Control-O and to exit, type Control-X.
Nano can do a lot of stuff including searching, clipboard operations, and spell check. To view the help information within nano, type Control-G. Of course, you can also create new files with nano. Just type the name of the file you want to create after the nano command and that file will be written when you save within nano.
Copying, Moving, and Renaming Files Copying and moving files around from the command line is fairly straight- forward. Date and Time Most computers have a real time clock, a piece of hardware that keeps track of the date and time.
Unfortu- nately, the BeagleBone does not have a real time clock. This means that when you boot up the BeagleBone, it will have no idea what the date and time are.
To prove it, try the date command: The time just needs to be set every time it boots up. First, backup the old localtime file by renaming it localtime. A symbolic link is like a forwarding notice for a file. You can place one in a directory and most software that wants to read or write the file will be redirected to the file in another location.
The shell prompt in the following example is truncated slightly to fit on the screen without wrapping the text. Edit the ntpdate configuration file with nano: Feel free to pick your own NTP server if you wish.
Save the file by typing Control-O and exit nano with Control-X. Now run the ntpdate-sync command to have the BeagleBone fetch the latest time. After a few moments, try executing the date command again: The BeagleBone is also pre-configured by default to synchronize with the NTP server once an hour, so you may have a period of time after booting when the time is incorrect.
You can always run ntpdate-sync to force it to synchronize immediately. See Appendix B for how to set up ntpdate-sync to happen automatically on start up. Software Installation, Updates If your BeagleBone has a connection to the Internet, you can easily install or upgrade software and code libraries. The software comes in packages and Getting Around with Linux 27 www. To update the list of available packages, simply execute: If you want to update the software, the opkg command upgrade will upgrade all of your installed packages if there are new versions available.
To install the version control system git, for instance, you would run: For instance if you only wanted to upgrade Python, you could run: To edit the hostname, execute the following, keeping in mind that the host- name can only contain letters, numbers, or a hyphen.
After you save the file and quit nano, you need to reboot your BeagleBone. After you log in again, you should see your custom hostname in the prompt.
To set or change the password, use the command passwd: To shut down the BeagleBone properly, issue the following command: The board will turn back on when you reconnect it to power. If you just want to reboot the board, use the reboot command. Each header has 46 pins and if you look closely you can see that pins 1, 2, 45, and 46 are labeled on each header Figure Header P8 Figure Most pins can even be switched between modes to accommodate dif- ferent possible functions.
GPIO pins have two states: We say such a pin is floating. Other platforms, like the Arduino, may use 5 volts. Use only 3. Otherwise you can permanently damage the board. Once you get to know how the Linux kernel uses a virtual filesystem to read and write pins, it makes programming the BeagleBone much easier. As long as you can read and write files, you can work with GPIO. First Steps with Digital Electronics 33 www.
Be very careful not to accidentally connect the rail to the 5 volt source on pins 5 and 6. The GPIO pins can only han- dle 3. Place an LED in the breadboard so that the cathode side the shorter wire is connected to the negative rail and the anode side is in one of the rows of the breadboard.
Using a ohm resistor, connect the anode side of the LED to another row on the breadboard. Connect the other side of the ohm resistor to pin 12 on header P8. On a ohm resistor, the color bands printed on it will be brown, black, brown, and then gold or silver. Your circuit should look like Figure Even if you look at BeagleBoard.
Many of the pins default to other modes. First Steps with Digital Electronics 35 www. On the command line, change to the gpio directory: Start typing the first few letters of the directory or file and then hit tab key. If the system has a single file or directory that matches that, it will fill in the rest of the name for you. To do that, use the echo command to write the number 44 to the export file: For example, if you attach a BeagleBone expansion board, or cape, it may request access to a few of these pins for itself.
Change to that directory: Write 1 to the value file: We can then set the pin low and turn off the LED by writing a 0 to the value file: Feel free to experiment with the other pins in Figure Input If you can control an output pin by writing to the value file, it stands to reason that you can read an input pin by reading the value file.
By doing this, you can check the state of physical buttons and switches. Place a push button into the breadboard so that it straddles the center channel. Connect one lead of the button to the positive rail. Connect the other lead of the button to the input pin 11 on header P8. See Figure of BeagleBone wired up. Connect a 10K pulldown resistor from the ground rail to the button lead that connects to the input pin. That is to say, connected to either 3. The 10K pull- down resistor in the step above ensures that when the button is not pressed and the connection between 3.
Using a resistor ensures that when the switch is closed, the 3. Instead, it goes to the input pin. First, export the pin to the user- space and change to its directory. Set the pin direction as an input: This should return 0 for low. This means that the pin is connected to ground. Now press and hold the button while you execute the cat value command again. If you have the button wired up correctly, you should now see a 1, indicating the pin is high connected to 3. An easy way to execute a command again is to hit the up arrow key on your keyboard and then hit enter.
You can keep hitting up to scroll back through your history of com- mands. Just hit enter when you get to the command you want. It may seem trivial, but these examples represent the very basic foundation of digital electronics with the BeagleBone.
With the right circui- try, these could easily become tilt sensors, blenders, door security sensors, buzzers, motors, and much more. And since the BeagleBone is already network-enabled, it lets you change the settings of your outlet timer from the comfort of our computer, or even from the other side of the globe. This project will also demonstrate the basics of using shell scripting as one method to programmatically execute commands. Using another strand of hookup wire, connect pin 2 from the Power- Switch Tail to one of the ground pins on the BeagleBone.
Be sure the lamp is switched on. The PowerSwitch Tail is a high voltage relay circuit that has been packaged up for easy use. It lets you use the 3. First Steps with Digital Electronics 41 www. Execute the following commands to actuate the relay and turn the lamp on. Make sure you run the unexport commands shown there before you try this example.
Now unexport the pin. While shell scripts have the potential to be powerful and complex, they can also be very basic and as easy to write as entering the commands onto the command line. This will launch the nano text editor. Type in the following code: Use nano to create another file called lightOff.
To make both of those scripts executable, execute the following com- mands: Now when you type. When you type. You will need to be in the home directory to do this. Add the following lines to the end of the file: The cron scheduler will allow you to execute com- mands as frequently as once a minute or you can even set a command to execute many years in the future. Each crontab entry is on its own line with 5 space-delimited settings sometimes 6, in the case of specifying years followed by another space and then the command that should be executed as you can see in Table See Table for what the entry would look like.
If you want to adjust the timing of the lamp, all you have to do is log into your BeagleBone and edit your crontab. First Steps with Digital Electronics 45 www. The downside to the flexibility that the BeagleBone affords is that there are many different ways to do the same thing.
This chapter will walk you through one way to use code to interact with the pins on the board. However, on an embedded Linux system like the BeagleBone, the compiler or interpreter exists on the board itself. This chapter will show you how to use the Python interpreter on the Beagle- Bone to program the pins to behave the way you want. The code is relatively easy to understand and there are many libraries that help with complex tasks.
However, this would take a long time. Luckily for us, the fine engineers at Adafruit have created an open source Python library for accessing the pins. I especially like this library because it follows a lot of the same conventions as the popular RPi.
From the command line, update the package listing. Python 2. Using Python, you can create an infinite loop to turn the LED on and off until you terminate your script. See Figure Python Pin Control 49 www. This will allow you to easily down- load files to your computer, edit them, and upload them back to the Beagle- Bone. My favorite FTP client, Transmit, even lets me edit the files in a text editor and automatically uploads them to the board whenever I hit save. See Chapter 8. Use the code from Example for the contents of your file.
Source code for blink. OUT while True: HIGH time. LOW time. Unlike many other languages, the indentation you use for each line of code is important to get right. You can uses spaces or tabs, just as long as you keep it consistent throughout your code. If not, check the errors that are displayed and check your code against the code above.
Python evaluates the code one line at a time, starting at the top of the script. When it gets to the line that says while True: The while statement can be used to test for conditions as well. Any time the condition evaluates as true, it runs the code beneath it again, which is why while True: This line tells the system the location of the Python interpreter to process your code. From the command line, use the following command to do that: When executing files, you need to be explicit about their location unless you move the script to a directory that is included in your path.
Read on for more on that. To view directories that are in your path, run the following command sample output is shown: However, the actual directory may not already exist.
Put the code from Example in it. Example Source code for button. IN while True: Python Pin Control 53 www. Print a message to the terminal. Try it out before we dig into the details of the code: Why is that? For one, you can hold up the Python script until the button is released, like in the code in Example Holding the process until the button is released! You can have your code look for a pin going high rising , going low falling , or just changing from one state to the other.
These are called interrupts. Using interrupts to indicate when the button is pushed or released! Enable a network connection Step 3: Getting Started Beagles are tiny computers with the capability of modern systems, without the bulk, expense, or noise. For user supplied tips on getting started, visit the eLinux or other community wiki pages: Download the latest software image Download the lastest Debian image from beagleboard.
Install SD card programming utility Download and install Etcher. If using an original BeagleBone or PocketBeagle, you are done. Start your Beagle If any step fails, it is recommended to update to the latest software image to use the instructions above. Power and boot Most Beagles include a USB cable, providing a convenient way to provide both power to your Beagle and connectivity to your computer.
Boards Getting Started Support.
Chapter 1: The Beagle Hardware Platform
Note 5: These drivers have been tested to work up to Windows Do you have any suggestions or a favorite? I have had moderate success with an Edimax EWUn Mbps dongle, plugged into a powered hub, but I am not happy with it. I would rather go wired and often do, but would like to go wired with wireless freedom for my prototyping rig. My home network is both wired and wireless, containing many switches. Thank you sir! But I need to get a quick networking on subnets, etc.
More when I know it! Question might be answered Derek, thank you! Hi Gary, interesting follow-up. Yes, I have tried a few access points and I have had good success with most. Like you I have several access points but the one that is closest to my work space is a Netgear router and it gives a stable connection.
Hope you get a setup that is stable — please let me know what works and what causes difficulties. Kind regards, Derek. Thanks Andrew, I thought that I had added that one to the errata list already — definitely adding it now. Thanks for the update, Derek. I am going to build a pid controller in the circuit Instrumentation with ds18b20 temperature sensor and cadmium. Sulfide cell light sensor resistive light sensor, then as transducer a stepper motor.
Have you designed your own restful API or are there other free services developers can use to create profiles and deployment?
Thanks Ron, I was disappointed that Xively changed their access policies after the book was published — Hopefully you received an account okay. If you want to do this from first principles you should have a look at my blog post: A very interesting approach towards teaching embedded linux.
You seem well experienced and talented in both teaching as well as in linux. In chapter 1 you emphasize on the face that the linux Operating System is a non-preemptive system. Hi there, the Completely Fair Scheduler was introduced in 2. Just an update on Dereks comment. Your book is a pretty good guide for new developers, I really appreciate your work. Please keep going.
In other topic, I was wondering if you can include a new Chapter for your book about how to create a new beagle bone cape mostly related to firmware: Device Tree, Driver Creation and implementation, Kernel, etc. Could you help me with some material? Derek, thank you so much for providing such a good website for bob, the way you present information, graphical design is so attractive and engaging, artistically also so appealing, I believe you succeeded combining art and technology very well I am talking about your web design, graphic design of the web site and animation stuff.
Thank Erol — thanks for your kind words! Have a look at my now quite dated videos on Qt touch screen development. Save my name, email, and website in this browser for the next time I comment.
The summary introduction to the chapter is as follows: Learning Outcomes After completing this chapter, you should be able to: Describe the capability of the Beagle boards and their suitability for different project types.
Source the important documents that will assist you in working with the Beagle platform. Describe the major hardware systems and subsystems on the different boards. Identify important peripherals and accessories that you can buy to enhance the capability of your board.
Have an appreciation of the power and complexity of the Beagle boards as physical computing devices. Be aware of the first steps to take in protecting your boards from physical damage. Contents 1 Introduction 1. Share this page: Digital Media Resources.
TOP Related Files:
- INDIAN VEGETARIAN RECIPES PDF IN TELUGU
- GENERAL APTITUDE QUESTIONS WITH ANSWERS PDF
- MINDY KALING IS EVERYONE HANGING OUT WITHOUT ME EBOOK
- PRO ANDROID PYTHON WITH SL4A PDF
- GU FAMILY BOOK DONT FORGET ME SONGS
- ENGINEERING WITH EXCEL LARSEN PDF
- GET SET GO BOOK
- CGI PROGRAMMING WITH PERL 2ND EDITION PDF
- DEVELOPING WEB APPLICATIONS WITH ORACLE ADF ESSENTIALS PDF
- NISSAN PATROL Y61 SERVICE MANUAL PDF
- DARK SOULS 2 FUTURE PRESS PDF
- NEW ENGLISH FILE PDF
- ORHAN PAMUK ISTANBUL PDF