Tag Archives: sitara

Generating Images for BeagleBone with Omap Image Builder

This article describes how to proceed to the autonomous creation of an image for the BeagleBone Black /Green using the Omap Image Builder. In this specific example we create the image for the BeagleBone Black Rev. C.

The informations on the procedure to be followed are available on the site

Omap image builder

As a prerequisite to the creation of the image there is the need to perform the operations on arm hardware; with other systems it is possible to have issues. To this end, we will proceed to perform tasks on a  Orange PI PC with Armbian operating system. After preparing the Armbian system for Orange PI PC, as described in

Armbian Boot on Orange PI PC

log  in  ssh on Orange PI PC; in our case we used the sviluppo/password credentials

ssh on Orange PI PC

It is possible also to connect  by enabling Remote Desktop

Remote desktop setup for Armbian on Orange PI PC

Create a folder named beaglebone

Clone the code to create the image

The folder tree is the following

We proceed first to the creation of a standard Debian 8 image for Beaglebone Black

The task takes a long time and creates other folders including the deploy folder within which we will find the images. At the end go into deploy /image folder and run

Compress the created image with the command

To create a customized image proceed as follows:

  1. Go into the image-builder/configs folder and copy a configuration as base named custom-debian.conf. We have used as a base configuration bb.org-debian-jessie-lxqt-4gb-v4.1.conf. In custom-debian.conf add the following changes in  the deb_include section; as example we add the vsftpd server; change the chroot_script value too


    To exclude packages to be installed use the deb_exclude section. In the script are commented the various sections, among which we find those about  the definition of the hostname, passwords, user name creation, etc.
  2. Navigate to the image-builder/target/chroot folder and copy beagleboard.org-jessie.sh as custom-debian.sh.
  3. If you want to add python packages edit the custom-debian.sh file and add the other packages in install_pip_pkgs function

In this example we added only the ftp server. Go into the image-builder folder and run the command

The task  takes a long time. At the end access to the deploy/imagename folder and run

Compress the created image with the command

You can create now the micro sd card  with the FTP server available in the image  and the hostname changed in beagleboneblack.

The microSD burning  is already described in the article

Debian sdcard setup for Beaglebone Black

On Omap image builder site you’ll find other images types among which we highlight those for BeagleBone Black, Green, Iot, Machine Kit (image to manage Machinekit CNC machines), etc.

C Eclipse project reading temperature and humidity on Beaglebone

After the cross building and DHT11 sensor setup on Beaglebone Black

Remote debug on Beaglebone

Sensors on Beaglebone

Temperature and humidity reading on Beaglebone in python

now we show how to create a C project , using  the C source code available with the Adafruit library

Adafruit Python DHT Sensor Library

Using Eclipse, we create a project for the reading of our sensor. It calls the functions in the C code of the Adafruit library. These sources are imported into the Eclipse project

Dht sensor Projectand using the sample C code  dhtSensor.c,  which contains the main C program, we read the sensors by calling the funtions available in Adafruit C sources; the usage is  similar to what seen in Python.

Running

 it shows the help instructions

To read the DHT11 sensor on pin P8_11 we have to run

The output is the following

DHT sensor reading in CHere is the Eclipse C project

dhtSensor Eclipse project

DHT11 sensor reading on BeagleBone with node.js

In the previous article we read the temperature and humidity from DHT11 sensor in python

Temperature and humidity reading on Beaglebone in python

We perform now the same operation in javascript. We download the  dht module for node.js. The module is available on the website

beaglebone dht

Log on BeagleBone in ssh as debian (temppwd as password) and run

to install the module globally.

For the sensor reading create a file test.js  with the following code inside

Reading is performed running

The result in our case is the following

temperature reading node.jsThe same code can be run from Cloud9 IDE. Access the IDE on BeagleBone with the link http: //beaglebone.local:3000 and create a file named dht.js with the following code inside

The script execution gives the following result

DHT11 cloud9Here is the link to download the two sample files

Node.js sample

Cloud9 sample

Temperature and humidity reading on Beaglebone in python

In the previous article we connected the DHT11 sensor to the Beaglebone

Sensors on Beaglebone

We install at this point the library in python and modules in c to read the sensor. The site with documentation about the library is

Adafruit Python DHT Sensor Library

Log in ssh on Beaglebone as root / no password and create the temperature folder from which we run

Install the prerequisites

Proceed to the installation of the library with the python command

Enter the examples directory and do the following for reading the sensor values (dht 11 and pin P8_11)

The result in this case is the following

temperature reading

Sensors on Beaglebone

After describing the Beaglebone and its development tools

Startup of the Beaglebone development board

Development tools on Beaglebone

as an example we show how to interact with the Beaglebone and a temperature and humidity sensor.

Among the most popular we finde the DHT11 sensor. The sensor has 4 pin; we have to connnect it to the power supply through a resistance of 4.7 or 10 kΩ. In our case we have a three-pin DHT11 sensor with the resistance already included in the circuit. In the case of the only sensor follow as specified in the following article

DHT humidity sensor

The following image shows the connections with Beaglebone

Beaglebone DHT11In the article Development tools on Beaglebone we showed the Beaglebone headers; in this case we used  3.3V,  ground and P8_11 headers.

In the next article we will install a library in python and modules in C to read temperature and humidity

Temperature and humidity reading on Beaglebone in python

Remote debug on Beaglebone

In the previous article we have prepared the environment with Eclipse for cross building for BeagleBone

Cross building for Beaglebone

Now we shall configure Eclipse and BeagleBone to debug the code directly on BeagleBone.

On BeagleBone install gdbserver

On the Debian system with Eclipse install gdb-multiarch

From Eclipse access to Run-> Debug Configurations

debug configurationsDouble-click C++  Remote Application to set parameters

Remote debugger configurationAt the next window, create a new ssh connection with the New button

New connectionEnter the parameters for the connection

Connection parametersSet the remote destination folder for the file  and execution management; with the browse button choose where to copy the files, and with the field “Commands to execute before application” will give execute permissions to the file

Remote foldersIn our case we create a folder esempi under /root on the  BeagleBone where to debug remotely

main debug settingsSet the multarch debugger in the Debugger Tab and other startup parameters and gdb command line settings

Debugger multiarch settingsSet the port of the remote debug server installed on BeagleBone in the Gdbserver Settings Tab

debug server settingsCreate .gdbinit files in the project folder with the command

touch debugTo start debugging run the configuration we set

debug runEclipse connects with BeagleBone and performs remote debugging  opening the Debug Perspective

debug perspective

Cross building for Beaglebone

In the article on the Debian environment we prepared the linux machine for the development of embedded systems

Debian development envinronment

In the article on building an image for the Orange PI PC we installed the cross build tools for armhf environment

Building Armbian for Orange PI PC

Starting from the clean image of the Debian envinronment we list the steps required to install the cross compiling environment. We log on Debian Desktop as sviluppo/ password.

As a preliminary step we install  the cross toolchains in Debian

https://wiki.debian.org/CrossToolchains

Create the file crosstools.list in the /etc/apt/sources.list.d folder

and add the line

Save the file and add the key of  the repository embedian.org

Install the following packages and add the armhf architecture

We install at this point the Eclipse IDE for Cpp downloading the IDE for Linux 64bit

Eclipse IDE

Unzip the eclipse package under / home /sviluppo.

Install the jre java

Add the line at the end of the file

Run the following commands

Run Eclipse from the eclipse folder to start the IDE

eclipseAs a first example we create a simple program in C for BeagleBone.

Create a new project in C, by inserting the following data

new projectSelect both configurations

project configurationEnter the cross compiler prefix and path

crosscompiler prefixPress Finish.
Add to the project a source file in C

C source fileInsert the following simple code

Proceed with the build by selecting the project with the right mouse button and choosing Build Project

project build Transfer the generated files on BeagleBone. You can use scp or ftp.

Give execution permissions to the file and run it

The result is of course the text inserted in the code

sample run

Development tools on Beaglebone

In the previous article we have installed and updated to the latest Debian image our BeagleBone

Debian sd card setup for Beaglebone Black

We also enabled the network services to access the board using the hostname.

After these changes we can access the Beaglebone using the following address in the the browser

http: //beaglebone.local

The web interface presents several examples of code executed with bonescript, javascript library based on node.js framework

Node.js

You can perform these simple examples to begin to interact with the board. There are also links to the development tools such as Cloud9, Nodered and informations about these development tools

toolsClicking on Cloud9 we access at the section dedicated to this tool. It is shown how to create a simple example and to run at boot the code placing it into the autorun folder in the IDE interface. From this section we can access to the Cloud9 ide available on port 3000 of the Beaglebone site

Cloud9

For more information about the tool, refer to the site

Cloud9

Accessing to the Nodered section we find  the link  to the web page about the basic informations about Nodered

Getting stared with Nodered

and the link to the Nodered ide, running at 1880 port of the web server running on BeagleBone

Beaglebone Nodered

Nodered beaglebone

In the web page about the first steps for Nodered there are examples with which to start using the tool. From the web site https://nodered.org we can have more informations about the tool.

In addition to tools in javascript on BeagleBone there are C/C++ compilers, Python interpreter and the possibility  to add additional development tools.

From the home page of the our BeagleBone board web interface, http: //beaglebone.local, we find the informations about all available headers and functions. The following image shows the  expansion headers

cape headers

In next articles we will show some code examples with the development board.

Debian sd card setup for Beaglebone Black

In the previous article we started up the development board Beaglebone Black / Green.

Startup of the Beaglebone

Let’s look  how to install an updated image of Debian for BeagleBone. As a first step we have to access the site which contains the Beaglebone  images

Beaglebone images

We download, having a BeagleBone Black Rev. C, bone-debian-8.6-lxqt-4gb-armhf-2016-11-06-4gb.img.xz. Unpack the 7zip image and load into a micro sd card with Win32DiskImager, as done for the Orange PI PC

SD card setup for Orange PI PC

If we wanted to load that image on the internal flash, we must edit the /boot/uEnv.txt files on a Linux system and uncomment the line

In that case, when we start the board the system will rewrite the operating system present on the internal flash with the version loaded on the micro sd card. We do not follow this road in order to do all the tests on the sd card leaving the internal partition unmodified. So let’s connect our Beaglebone to a network router. We insert the micro sd card and startup the development board. In some boards we need to press of the USER / BOOT button

 beaglebone black

because the operating system boots from micro sd card; with our board it is not necessary to perform this operation. We have to log on Beagleone now; the avahi-daemon service is already active on the Beaglebone and Linux systems resolve the address by hostname; Windows, instead, needs tha samba service activated to solve the Beaglebone hostname; installing samba we obtain the hostname recognition with the protocol netbios from Windows. If you are using a Windows machine to work with the Beagelbone you must first check the ip assigned by the network router to the  BeagleBone. From a Linux system, for example, connect to the Beaglebone using ssh as debian / temppwd and the beaglebone hostname

ssh BeagleboneIn Windows we need to install the samba service first to have the same functionality. Proceed at this point with the updating and samba installation

After the updates and samba services activation, we are ready to show examples with our BeagleBone and we are able to connect to it using the beaglebone and beaglebone.local hostnames. In the next article we will see tools already available on the board and how to add more features.

We can install the ftp service too, as we could use it in next articles

 To deactivate and activate it use the following commands

Startup of the Beaglebone development board

In a previous article we have given a brief description of Beaglebone Black board and its variants.

 Beaglebone development board

The BeagleBone in this review comes with 4GB of space on board, and with the operating system already installed.

We can access the BeagleBone, in our case the Black, without using the Ethernet network, but connecting it to a PC through the mini service USB connection as specified on the BeagleBone site

Getting started with Beaglebone

After connecting the BeagleBone Black to the PC via the USB cable we find  another removable  device to the existing disks

Beaglebone removable diskRunning start.htm we start an interface similar to the one available on  the  getting-started web site

getting startedWe proceed to the installation of network-over-USB drivers for the  operating system, Windows 64-bit in our case

driver network over usbProceed to download the file and run it, providing the permissions required by Windows

beaglebone driver installerAt the end the window with the performed operations is shown

beaglebone driver installer summaryUsing Firefox or Chrome we access to the following address http://192.168.7.2; we access in this way to the web server, running on Beaglebone board, through network over  USB

beaglebone web siteThe page shows how to update the system, login to the IDECloud9, perform various  Bonescript examples.

The access to the Cloud9 IDE

Cloud9 IDE Informations

takes place on port 3000 to the IP address specified above, ie http://192.168.7.2:3000

cloud9 ideIn our examples, we will not change the operating system present on the internal eMMC card but we will download an updated version of Debian for BeagleBone and will install it on a micro sd card.

The system can be closed  using  the Power button on board

power buttonor by connecting via ssh at 192.168.7.2 address with the debian user ,using temppwd as password, and executing the command “sudo poweroff”

sshIn the next article we will proceed to download and install on a micro sd card the last Debian image for BeagleBone

Debian sd card setup for Beaglebone Black