From 7c38c511ba67d5244c18ca3cec06716e3a074b8c Mon Sep 17 00:00:00 2001 From: Gerardo Marx Date: Tue, 6 Sep 2022 00:07:59 +0200 Subject: [PATCH] Bash command line test --- Readme.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Readme.md diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..d3f51f3 --- /dev/null +++ b/Readme.md @@ -0,0 +1,63 @@ +# Introduction + +Please considers that the BeagleBone Black is a single board computer based on the Cortex-A8 CPU with embedded linux. The board has SDRAM and some low-level peripherals. Thus, at the end of the programming process, any used language will be converted to machine code to be properly interpreted by the CPU. Therefore, the used or selected programming language will depends on the final application usage. + +# Connect the BeagleBoneBlack + +First connect your BeagleBoneBlack (BBB) board by using the USB connection: `ssh debian@192.168.6.2` in GNU/Linux or MacOS, and `ssh debian@192.168.7.2` in Windows. + +# Command line tests + +First, considers that there are some LEDs already installed on the BBB board. These LEDs are used to let the user knows specific activity on the board, but that can be reprogrammed or used for user’s tasks. + +![](https://beagleboard.org/static/uploads/LEDs.PNG) + +Next, there is a system called **sysfs** that allows the OS to gives information and access to devices and drivers that will be only accessible through the Linux Kern space. + +Note: this virtual file system is easy to use from Bash, but is not the best and efficient way. + +At the command line, go to the `sysfs` system to access the LEDs: + +``` +cd /sys/class/leds +ls -al +``` + +you must probably get an answer like this: +``` +drwxr-xr-x 2 root root 0 Jan 1 00:00 . +drwxr-xr-x 48 root root 0 Jan 1 00:00 .. +lrwxrwxrwx 1 root root 0 Jan 1 00:00 beaglebone:green:usr0 -> ../../devices/ocp.2/gpio-leds.7/leds/beaglebone:green:usr0 +lrwxrwxrwx 1 root root 0 Jan 1 00:00 beaglebone:green:usr1 -> ../../devices/ocp.2/gpio-leds.7/leds/beaglebone:green:usr1 +lrwxrwxrwx 1 root root 0 Jan 1 00:00 beaglebone:green:usr2 -> ../../devices/ocp.2/gpio-leds.7/leds/beaglebone:green:usr2 +lrwxrwxrwx 1 root root 0 Jan 1 00:00 beaglebone:green:usr3 -> ../../devices/ocp.2/gpio-leds.7/leds/beaglebone:green:usr3 +``` +there are some symbolic links the real directions and can be used to test our LED. Thus, go inside the folder/file `beaglebone:green:usr0` and prints out the contents of the file trigger by: + +``` +cd beaglebone:green:usr0 +more trigger +none nand-disk mmc0 mmc1 timer oneshot [heartbeat] backlight gpio cpu0 default-on transient +``` + +that means the `heartbeat` is the option that triggers the blinking activity. + +Then, if we want to stop this triggering and manage the LED activity, let us follow the next steps: + +``` +echo none > trigger +echo 1 > brightness +echo 0 > brightness +``` + +thus, you must probably observe that the LED turns on and off with the 1 or 0 values, respectively. + +Can you try different options???? +Can you handle the other LEDs???? +Can you make it blink?? + +Try by yourself please! + + + + \ No newline at end of file