https://elinux.org/api.php?action=feedcontributions&user=Yoder&feedformat=atomeLinux.org - User contributions [en]2024-03-28T12:42:45ZUser contributionsMediaWiki 1.31.0https://elinux.org/index.php?title=ECE434_Project_-_Water_Sim_Toy&diff=581425ECE434 Project - Water Sim Toy2024-02-22T17:52:56Z<p>Yoder: /* Executive Summary */</p>
<hr />
<div>[[Category:ECE497 |PT]]<br />
[[Category:ECE434Winter2023 |PT]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Sappon|Owen Sapp]], [[user:Bejlovba|Bryce Bejlovec]]<br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
Add Extras<br />
<br />
09 Executive Summary<br />
09 Packaging<br />
09 Installation Instructions <br />
09 User Instructions<br />
09 Highlights<br />
09 Theory of Operation<br />
09 Work Breakdown<br />
09 Future Work/Conclusions<br />
09 Hackster.io<br />
09 Demo/Poster<br />
00 Not Late<br />
<br />
Score: 90/100<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
[[File:Splash.jpg|thumb|splash project]]<br />
<br />
This project aims to create a fluid-like simulation that is displayed on an LCD screen and interacted with through an accelerometer. <br />
<br />
'''Currently Working Features:'''<br />
<br />
Fluid Simulation<br />
<br />
SPI LCD Screen Output<br />
<br />
Accelerometer Input<br />
<br />
Touch Screen Input<br />
<br />
<br />
This project creates an example application for a touch-screen input with the ILI9341 SPI LCD and a gyroscope. The application is reminiscent of a water simulation that is able to be played with to create ripples and depth. <br />
<br />
<br />
'''GITHUB LINK:''' https://github.com/rhit-sappon/EmbeddedLinuxFinalBejSapp<br />
<br />
'''HACKSTER LINK:''' https://www.hackster.io/rhit-sappon/splash-water-simulation-toy-fc002c<br />
<br />
== Development Timeline ==<br />
<br />
Fluid-Like Python Simulaiton: 2/2/24<br />
<br />
Interface with SPI LCD Screen: 2/2/24<br />
<br />
Accelerometer Input: 2/2/24<br />
<br />
Rewrite in C: 2/4/24<br />
<br />
Touch Screen Input: 2/15/24<br />
<br />
SystemD Daemon: 2/15/24<br />
<br />
== Packaging ==<br />
[[File:Splash pack1.JPG|thumb|splash packaging 1]]<br />
[[File:Splash pack2.JPG|thumb|splash packaging 2]]<br />
<br />
The packaging for this project consists of cutouts from foam-board to create a box around the Beagle Bone and a half-length breadboard. As visible in the images, the cutouts can be made with tabs to assist in positioning and securing the box in place. <br />
<br />
The LCD screen is positioned in a cutout to only let the screen through, and leave the PCB behind the foam board in the box. Screws are then tightened into the foam board to attach the LCD to the top of the box.<br />
<br />
== Installation Instructions ==<br />
<br />
Github Link: https://github.com/rhit-sappon/EmbeddedLinuxFinalBejSapp/settings<br />
<br />
Fritzing Wiring: <br />
<br />
LCD:<br />
<br />
* Lite <--> P9_16<br />
* Reset <--> P9_25<br />
* DC <--> P9_27<br />
* CS <--> P9_28<br />
* MISO <--> P9_29<br />
* MOSI <--> P9_30<br />
* CLK <--> P9_31<br />
<br />
Touch:<br />
<br />
* T_IRQ <--> P9_23<br />
* T_DO <--> P9_18<br />
* T_DIN <--> P9_21<br />
* T_CS <--> P9_17<br />
* T_CLK <--> P9_22<br />
<br />
Gyro:<br />
<br />
* CS <--> VCC (3.3V)<br />
* SDO <--> Ground<br />
* SDA <--> P9_20<br />
* SCL <--> P9_19<br />
<br />
<br />
'''Installation:'''<br />
<br />
Clone the git repo to a directory of your choosing. Then cd into the directory EmbeddedLinuxFinalBejSapp, and run ./install.sh This will clone the device trees, make, install, and set up uEnv.txt to properly initialize the devices. <br />
<br />
Note on systemd:<br />
<br />
We were unable to get systemd running splash on startup. This is due to two things, either the .system instructions execute out of sequence breaking requirements, or occasionally the splash command runs, creating a looping function that halts the bootup of the rest of Linux.<br />
<br />
== User Instructions ==<br />
<br />
When the software has been installed and the wiring completed correctly, you can start the program by running first setupgyro.sh in the /init subfolder and then running the splash executable in the /splash subfolder. <br />
<br />
This setupgyro only needs to be run once, and it is inconsistent on necessity between devices. Some test devices automatically detected i2c device address 0x53 (gyroscope), while others did not. Similarly, this changed per reboot, and as such this is not within the scope of a setup file. <br />
<br />
Running splash will cause a blue color to display on the LCD. <br />
<br />
To interact with the software, use either the stylus to input touch to the LCD causing a small ripple on the touched location, or use the gyroscope. The gyroscope will change the "depth" of the pool depending on tilt, and sudden movements will cause the simulator to have large "waves" appear in the direction of sudden movement.<br />
<br />
== Highlights ==<br />
<br />
Demo Video:<br />
https://www.youtube.com/watch?v=LNkLKK6UXgA<br />
<br />
Touch Screen Input - Ripples that track the touched location.<br />
<br />
Gyroscope Input - Controls depth, creates ripples with enough impact.<br />
<br />
== Theory of Operation ==<br />
<br />
Water Ripple Generation and Propagation: <br />
By taking in data from the gyroscope and touch screen in order to determine where the initial starting ripples are generated, forces can be added to an 80x60 array of X and Y axis motion vectors. This array is then iterated using a modified version of the [https://web.archive.org/web/20160116150939/http://freespace.virgin.net/hugo.elias/graphics/x_water.htm Hugo Elias algorithm]. As would be the case with real water, a visible ripple is only generated when a substantial amount of force is applied, so testing the delta of previous gyroscope input to the current reading against a threshold, the specific side of the motion vector array is given a line of forces based on the magnitude of the force past the threshold. As for the touch screen input, the ADS7846 driver relays information about the pressure being applied to the screen and that data is used to set the value at the location of the stylus in the motion vector array.<br />
<br />
<br />
Reading Touch Input:<br />
In order to utilize the XPT2046/ADS7846 SPI touch controller, a device tree overlay was needed that allowed the kernel driver for this device to be accessed. After compiling and installing the device tree overlay, the Linux input library was used to read the events of the device from <code>/dev/input/event1</code><br />
<br />
<br />
Modifying the Framebuffer:<br />
Based on the [https://gist.github.com/FredEckert/3425429 work by FredEckert on GitHub], we modify the framebuffer directly via mmap(). Each frame is stored locally with 24bit color but, because of the SPI display only supporting 16bit color, 5 bits for red and blue, 6 for green, we are limited to shift the bits of each channel accordingly.<br />
<br />
== Work Breakdown ==<br />
<br />
Major Tasks:<br />
<br />
Fluid Simulation - Set up and initialize a fluid-like simulation with example input and output functions.<br />
<br />
SPI LCD Screen Output - Modify the simulator to output on the ILI9341 SPI-LCD Screen. <br />
<br />
Accelerometer Input - Modify the simulator to take in input signals from a ADXL345 Accelerometer.<br />
<br />
Touch Screen Input - Modify the simulator and LCD connections to interface with the LCD's touch screen. <br />
<br />
Setup and Install - Creation of an installation script using RegEx and shell scripts.<br />
<br />
== Conclusions ==<br />
<br />
We believe that this project was successful in implementing a touch-screen application that is usable on the BeagleBoard. This project implements the touch screen feature of the SPI LCD screen and uses the input location to modify the state of a fluid-like simulation. In this process, we created a functional simulator using C, adapted it to output pixel values to the frame buffer, and used a Hugo-Alias algorithm to create ripples around the touch input. <br />
<br />
== Future Work ==<br />
<br />
Some potential additional work could be adding custom user input color schemes to utilize. This project went with blue to mimic water, but it is theoretically possible to modify the color as the user desires, possibly in real time. <br />
Rotary encoders or buttons could be used to set the RGB channel values. <br />
<br />
Another potential additional feature could be an efficient upscaling algorithm. Currently, we are transferring an 80x60 model to an 240x320 display.</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_12a_2.4_TFT_LCD_display_via_SPI&diff=580567EBC Exercise 12a 2.4 TFT LCD display via SPI2024-01-09T15:59:27Z<p>Yoder: /* tinyDRM */</p>
<hr />
<div>[[Category:ECE497]]<br />
[[Category:EmbeddedBeagleClass]]<br />
{{YoderHead}}<br />
<br />
[[File:Ili9341.png|thumb|2.4" TFT LCD]]<br />
<br />
This is an exercise in interfacing the 2.4" TFT LCD display (ili9341) via a SPI bus. The newer using the '''tinyDRM'''<br />
driver and the older uses '''fbtft'''.<br />
<br />
== The Hardware ==<br />
<br />
This table shows how to wire the LCD display for SPI 0.<br />
<br />
{| class="wikitable"<br />
|-<br />
! LCD !! Bone<br />
|-<br />
| MISO || P9_21<br />
|-<br />
| LED || P9_16<br />
|-<br />
| SCK || P9_22<br />
|-<br />
| MOSI || P9_18<br />
|-<br />
| D/C || P9_19<br />
|-<br />
| RESET || P9_20<br />
|-<br />
| CS || P9_17<br />
|-<br />
| GND || P9_2<br />
|-<br />
| VCC || P9_4<br />
|}<br />
<br />
<br />
This table shows how to wire the LCD display for SPI 1.<br />
<br />
{| class="wikitable"<br />
|-<br />
! LCD !! Bone<br />
|-<br />
| MISO || P9_29<br />
|-<br />
| LED || P9_16<br />
|-<br />
| SCK || P9_31<br />
|-<br />
| MOSI || P9_30<br />
|-<br />
| D/C || P9_27<br />
|-<br />
| RESET || P9_25<br />
|-<br />
| CS || P9_28<br />
|-<br />
| GND || P9_2<br />
|-<br />
| VCC || P9_4<br />
|}<br />
<br />
== tinyDRM ==<br />
<br />
The tinyDRM driver requires a 4.19 kernel or newer. Run '''uname -a''' to see which kernel is being run.<br />
If it isn't new enough update it.<br />
<br />
Add uboot_overlay_addr4=BB-LCD-ADAFRUIT-24-SPI'''1'''-00A0.dtbo to /boot/uEnv.txt if you are using SPI1.<br />
<br />
Edit '''/boot/uEnv.txt''' and find the line starting with<br />
#uboot_overlay_addr4=<br />
Uncomment it and change it to:<br />
uboot_overlay_addr4=/lib/firmware/BB-LCD-ADAFRUIT-24-SPI1-00A0.dtbo<br />
Next, verify the file is there.<br />
bone$ '''ls -ls /lib/firmware/BB-LCD-ADAFRUIT-24-SPI1-00A0.dtbo'''<br />
4 -rw-r--r-- 1 root root 3606 Aug 21 2021 /lib/firmware/BB-LCD-ADAFRUIT-24-SPI1-00A0.dtbo<br />
If the file is not there, follow the instructions in the next section. If the file is there,<br />
skip to the '''Using the LCD display''' section.<br />
<br />
=== Compiling and installing BB-LCD-ADAFRUIT-24-SPI1-00A0.dtbo ===<br />
Do this if BB-LCD-ADAFRUIT-24-SPI1-00A0.dtbo isn't there.<br />
bone$ '''cd /opt/source/dtb-5.10-ti'''<br />
bone$ '''make'''<br />
This will take a while, then:<br />
bone$ '''cp src/arm/overlays/BB-LCD-ADAFRUIT-24-SPI1-00A0.dtb0 /lib/firmware'''<br />
Now you should be ready to use the display.<br />
<br />
=== Using the LCD display ===<br />
<br />
Reboot and check for '''/dev/fb0'''<br />
bone$ '''sudo reboot'''<br />
After rebooting...<br />
bone$ ls -ls /dev/fb0<br />
0 crw-rw---- 1 root video 29, 0 Oct 3 10:07 /dev/fb0<br />
<br />
The LCD should be showing some text.<br />
<br />
You can control the backlight with:<br />
bone$ '''cd /sys/class/backlight/backlight_pwm'''<br />
Turn the display off, then on with: (Yup, it's backwards.)<br />
bone$ '''echo 1 > bl_power''' <br />
bone$ '''echo 0 > bl_power'''<br />
Change the brightness to 25% with:<br />
bone$ '''echo 25 > brightness'''<br />
<br />
Now jump to the Using the Frame Buffer section to see how to display images, etc..<br />
<br />
== Using the framebuffer ==<br />
<br />
=== Displaying Images ===<br />
Follow the instructions in '''install.sh''' to download '''fbi''' and some images.<br />
bone$ '''sudo apt update'''<br />
bone$ '''sudo apt install fbi'''<br />
Display them with:<br />
bone$ '''sudo fbi -noverbose -T 1 -a boris.png'''<br />
You should now see Boris the Beagle on your display.<br />
<br />
=== Playing Movies ===<br />
Install '''mplayer''' and load a movie on the Bone (see install.sh). <br />
bone$ '''sudo apt install mplayer'''<br />
Get something to play<br />
bone$ '''wget http://hubblesource.stsci.edu/sources/video/clips/details/images/hst_1.mpg'''<br />
And play it<br />
bone$ '''mplayer -vo fbdev2 -nolirc -framedrop hst_1.mpg'''<br />
<br />
If you get an error you might need:<br />
bone$ '''export SDL_VIDEODRIVER=fbcon''' <br />
bone$ '''export SDL_FBDEV=/dev/fb0'''<br />
<br />
Play the movie. Rotate the movie.<br />
<br />
=== Generate Text ===<br />
Install imagemagick. <br />
bone$ '''sudo apt install imagemagick'''<br />
<br />
See '''text.sh''' for an example of using imagemagick to write text to the LCD display. <br />
Write your name on the LCD. <br />
Display an image and write some text on it.<br />
<br />
# Here's how to use imagemagick to display text<br />
# Make a blank image<br />
SIZE=320x240<br />
TMP_FILE=/tmp/frame.png<br />
<br />
# From: http://www.imagemagick.org/Usage/text/<br />
convert -background lightblue -fill blue -font Times-Roman -pointsize 24 \<br />
-size $SIZE \<br />
label:'ImageMagick\nExamples\nby Anthony' \<br />
-draw "text 0,200 'Bottom of Display'" \<br />
$TMP_FILE<br />
<br />
sudo fbi -noverbose -T 1 $TMP_FILE<br />
<br />
=== pygame ===<br />
It's not hard to get pygame to display on the LCD.<br />
<br />
bone$ '''sudo apt install python3-pygame'''<br />
bone$ '''cd exercises/displays/ili9341/pygame'''<br />
bone$ '''sudo ./clock.py'''<br />
<br />
Look in '''clock.py''' to see how to direct the graphics to the LCD.<br />
<br />
== fbtft ==<br />
<br />
fbtft is no longer supported after the 5.4 kernel. <br />
(https://github.com/notro/fbtft/wiki#fbtft_device-and-flexfb-are-gone-in-54)<br />
<br />
Clone the course repo.<br />
<br />
bone$ '''git clone https://github.com/MarkAYoder/BeagleBoard-exercises.git exercises'''<br />
<br />
and then<br />
<br />
bone$ '''cd exercises/display/ili9341/fb'''<br />
bone$ '''git pull'''<br />
bone$ '''./on.sh'''<br />
<br />
After a moment the display should turn dark. Look in '''on.sh''' to see what it did.<br />
If the display doesn't turn on, look in '''on.sh''' and make sure it's set for the correct SPI bus.<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_12a_2.4_TFT_LCD_display_via_SPI&diff=580564EBC Exercise 12a 2.4 TFT LCD display via SPI2024-01-09T15:45:22Z<p>Yoder: /* tinyDRM */ Added /lib/firmware</p>
<hr />
<div>[[Category:ECE497]]<br />
[[Category:EmbeddedBeagleClass]]<br />
{{YoderHead}}<br />
<br />
[[File:Ili9341.png|thumb|2.4" TFT LCD]]<br />
<br />
This is an exercise in interfacing the 2.4" TFT LCD display (ili9341) via a SPI bus. The newer using the '''tinyDRM'''<br />
driver and the older uses '''fbtft'''.<br />
<br />
== The Hardware ==<br />
<br />
This table shows how to wire the LCD display for SPI 0.<br />
<br />
{| class="wikitable"<br />
|-<br />
! LCD !! Bone<br />
|-<br />
| MISO || P9_21<br />
|-<br />
| LED || P9_16<br />
|-<br />
| SCK || P9_22<br />
|-<br />
| MOSI || P9_18<br />
|-<br />
| D/C || P9_19<br />
|-<br />
| RESET || P9_20<br />
|-<br />
| CS || P9_17<br />
|-<br />
| GND || P9_2<br />
|-<br />
| VCC || P9_4<br />
|}<br />
<br />
<br />
This table shows how to wire the LCD display for SPI 1.<br />
<br />
{| class="wikitable"<br />
|-<br />
! LCD !! Bone<br />
|-<br />
| MISO || P9_29<br />
|-<br />
| LED || P9_16<br />
|-<br />
| SCK || P9_31<br />
|-<br />
| MOSI || P9_30<br />
|-<br />
| D/C || P9_27<br />
|-<br />
| RESET || P9_25<br />
|-<br />
| CS || P9_28<br />
|-<br />
| GND || P9_2<br />
|-<br />
| VCC || P9_4<br />
|}<br />
<br />
== tinyDRM ==<br />
<br />
The tinyDRM driver requires a 4.19 kernel or newer. Run '''uname -a''' to see which kernel is being run.<br />
If it isn't new enough update it.<br />
<br />
Add uboot_overlay_addr4=BB-LCD-ADAFRUIT-24-SPI'''1'''-00A0.dtbo to /boot/uEnv.txt if you are using SPI1.<br />
<br />
Edit '''/boot/uEnv.txt''' and find the line starting with<br />
#uboot_overlay_addr4=<br />
Uncomment it and change it to:<br />
uboot_overlay_addr4=/lib/firmware/BB-LCD-ADAFRUIT-24-SPI1-00A0.dtbo<br />
Then reboot and check of '''/dev/fb0'''<br />
bone$ '''sudo reboot'''<br />
After rebooting...<br />
bone$ ls -ls /dev/fb0<br />
0 crw-rw---- 1 root video 29, 0 Oct 3 10:07 /dev/fb0<br />
<br />
The LCD should be showing some text.<br />
<br />
You can control the backlight with:<br />
bone$ '''cd /sys/class/backlight/backlight_pwm'''<br />
Turn the display off, then on with: (Yup, it's backwards.)<br />
bone$ '''echo 1 > bl_power''' <br />
bone$ '''echo 0 > bl_power'''<br />
Change the brightness to 25% with:<br />
bone$ '''echo 25 > brightness'''<br />
<br />
Now jump to the Using the Frame Buffer section to see how to display images, etc..<br />
<br />
== Using the framebuffer ==<br />
<br />
=== Displaying Images ===<br />
Follow the instructions in '''install.sh''' to download '''fbi''' and some images.<br />
bone$ '''sudo apt update'''<br />
bone$ '''sudo apt install fbi'''<br />
Display them with:<br />
bone$ '''sudo fbi -noverbose -T 1 -a boris.png'''<br />
You should now see Boris the Beagle on your display.<br />
<br />
=== Playing Movies ===<br />
Install '''mplayer''' and load a movie on the Bone (see install.sh). <br />
bone$ '''sudo apt install mplayer'''<br />
Get something to play<br />
bone$ '''wget http://hubblesource.stsci.edu/sources/video/clips/details/images/hst_1.mpg'''<br />
And play it<br />
bone$ '''mplayer -vo fbdev2 -nolirc -framedrop hst_1.mpg'''<br />
<br />
If you get an error you might need:<br />
bone$ '''export SDL_VIDEODRIVER=fbcon''' <br />
bone$ '''export SDL_FBDEV=/dev/fb0'''<br />
<br />
Play the movie. Rotate the movie.<br />
<br />
=== Generate Text ===<br />
Install imagemagick. <br />
bone$ '''sudo apt install imagemagick'''<br />
<br />
See '''text.sh''' for an example of using imagemagick to write text to the LCD display. <br />
Write your name on the LCD. <br />
Display an image and write some text on it.<br />
<br />
# Here's how to use imagemagick to display text<br />
# Make a blank image<br />
SIZE=320x240<br />
TMP_FILE=/tmp/frame.png<br />
<br />
# From: http://www.imagemagick.org/Usage/text/<br />
convert -background lightblue -fill blue -font Times-Roman -pointsize 24 \<br />
-size $SIZE \<br />
label:'ImageMagick\nExamples\nby Anthony' \<br />
-draw "text 0,200 'Bottom of Display'" \<br />
$TMP_FILE<br />
<br />
sudo fbi -noverbose -T 1 $TMP_FILE<br />
<br />
=== pygame ===<br />
It's not hard to get pygame to display on the LCD.<br />
<br />
bone$ '''sudo apt install python3-pygame'''<br />
bone$ '''cd exercises/displays/ili9341/pygame'''<br />
bone$ '''sudo ./clock.py'''<br />
<br />
Look in '''clock.py''' to see how to direct the graphics to the LCD.<br />
<br />
== fbtft ==<br />
<br />
fbtft is no longer supported after the 5.4 kernel. <br />
(https://github.com/notro/fbtft/wiki#fbtft_device-and-flexfb-are-gone-in-54)<br />
<br />
Clone the course repo.<br />
<br />
bone$ '''git clone https://github.com/MarkAYoder/BeagleBoard-exercises.git exercises'''<br />
<br />
and then<br />
<br />
bone$ '''cd exercises/display/ili9341/fb'''<br />
bone$ '''git pull'''<br />
bone$ '''./on.sh'''<br />
<br />
After a moment the display should turn dark. Look in '''on.sh''' to see what it did.<br />
If the display doesn't turn on, look in '''on.sh''' and make sure it's set for the correct SPI bus.<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_11b_gpio_via_mmap&diff=580501EBC Exercise 11b gpio via mmap2023-12-19T21:53:01Z<p>Yoder: /* devmem2 */</p>
<hr />
<div>[[Category:EmbeddedBeagleClass]]<br />
[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
In previous exercises ([[EBC Exercise 10 Flashing an LED]] and [[EBC Exercise 11 gpio Polling and Interrupts]]) we saw how to interact with the general purpose I/O pins via sysfs files. These are rather easy ways to work with gpio; however they tend to be slow and require a lot of the CPU. In this exercise we explore accessing gpio directly via mmap. First we'll do it via <code>devmem2</code> and the command line and later via a C program.<br />
<br />
== Memory Map ==<br />
One of the nice things about using gpio via sysfs is you don't need to know little details like what gpio pin is mapped to what memory address. Now you need to know those details. Let's flash the USR3 LED by directly writing to memory. First turn off the trigger.<br />
<br />
bone$ '''cd /sys/class/leds/beaglebone\:green\:usr3'''<br />
bone$ '''echo none > trigger'''<br />
bone$ '''echo 1 > brightness'''<br />
The USR3 LED should be on. Now find which gpio it is attached to.<br />
bone$ '''gpioinfo | less'''<br />
Search for '''usr'''<br />
gpiochip'''1''' - 32 lines:<br />
line 0: "GPMC_AD0" "P8_25" input active-high [used]<br />
line 1: "GPMC_AD1" "P8_24" input active-high [used]<br />
...<br />
line 16: "GPMC_A0" "P9_15" input active-high [used]<br />
line 17: "GPMC_A1" "P9_23" input active-high [used]<br />
'''line 18: "GPMC_A2" "P9_14" input active-high [used]'''<br />
line 19: "GPMC_A3" "P9_16" input active-high [used]<br />
line 20: "GPMC_A4" unused input active-high <br />
line 21: "GPMC_A5" "beaglebone:green:usr0" output active-high [used]<br />
line 22: "GPMC_A6" "beaglebone:green:usr1" output active-high [used]<br />
line 23: "GPMC_A7" "beaglebone:green:usr2" output active-high [used]<br />
'''line 24: "GPMC_A8" "beaglebone:green:usr3" output active-high [used]'''<br />
line 25: "GPMC_A9" unused input active-high <br />
line 26: "GPMC_A10" unused input active-high <br />
It's attached to gpio port (chip) 1, bit (line) 24. To find the address of this register, look up the am335x Technical Reference Manual (Google it). Look for GPIO1 in the Memory Map table. You'll see its base address is '''0x4804_C000'''. Click on the GPIO1 link and you'll see '''Table 25-5. GPIO REGISTERS'''. This shows you what to add to the base address to get the various registers for GPIO1. For example, to see how the 32 GPIO1 pins are set you read the GPIO_DATAOUT register who's offset is 0x13Ch. Therefore you want to access 0x4804c000 + 0x13c = 0x4804c13c.<br />
<br />
== devmem2 ==<br />
(See if memtool https://manpages.ubuntu.com/manpages/xenial/man8/memtool.8.html will work instead of devmem2.)<br />
<br />
An easy way to read the contents of a memory location is with '''devmem2'''. First install it with:<br />
<br />
bone$ '''sudo apt install ti-devmem2'''<br />
<br />
If that doesn't work, try:<br />
bone$ '''wget https://bootlin.com/pub/mirror/devmem2.c'''<br />
bone$ '''gcc devmem2.c –o devmem2'''<br />
bone$ '''sudo mv devmem2 /usr/bin'''<br />
<br />
Now use it<br />
bone$ '''sudo devmem2 0x4804c13c'''<br />
/dev/mem opened.<br />
Memory mapped at address 0xb6f99000.<br />
Read at address 0x4804C13C (0xb6f9913c): 0x01800000<br />
The address passed is the physical address. devmem2 returns the virtual address along with the contents of the memory location. USR3 is gpio1_24, which is the 24th bit of this value, which is '''1''' if the LED is on.<br />
<br />
The '''GPIO_CLEARDATAOUT''' (0x190) register is used to clear given bits in a register.<br />
bone$ '''sudo devmem2 0x4804c190 w 0x01000000'''<br />
/dev/mem opened.<br />
Memory mapped at address 0xb6f53000.<br />
Read at address 0x4804C190 (0xb6f53190): 0x01800000<br />
Write at address 0x4804C190 (0xb6f53190): 0x01000000, readback 0x01000000<br />
The LED should be off now. Turn it on using the GPIO_SETDATAOUT (0x194) register.<br />
bone$ '''sudo devmem2 0x4804c194 w 0x01000000'''<br />
/dev/mem opened.<br />
Memory mapped at address 0xb6f9f000.<br />
Read at address 0x4804C194 (0xb6f9f194): 0x00800000<br />
Write at address 0x4804C194 (0xb6f9f194): 0x01800000, readback 0x01800000<br />
The USR3 LED should be back on again.<br />
<br />
== mmap via c ==<br />
devmem2 is an easy way to access memory mapped devices from the shell prompt, but if you need speed, you need access from a C program. '''mmap''' is a way of mapping an address space into a user-space program. For example, the following code uses mmap to point '''gpio_addr''' to the base address for GPIO1. It then computes the addresses for the SETDATAOUT and CLEARDATAOUT registers.<br />
<br />
Note: This file can be found in '''exercises/sensors/mmap/gpioToggle.c'''<br />
<br />
#define GPIO1_START_ADDR 0x4804C000<br />
#define GPIO1_END_ADDR 0x4804e000<br />
#define GPIO1_SIZE (GPIO1_END_ADDR - GPIO1_START_ADDR)<br />
<br />
#define GPIO_SETDATAOUT 0x194<br />
#define GPIO_CLEARDATAOUT 0x190<br />
#define USR3 (1<<24)<br />
<br />
volatile void *gpio_addr;<br />
volatile unsigned int *gpio_setdataout_addr;<br />
volatile unsigned int *gpio_cleardataout_addr;<br />
int fd = open("/dev/mem", O_RDWR);<br />
gpio_addr = mmap(0, GPIO1_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, GPIO1_START_ADDR);<br />
<br />
gpio_setdataout_addr = gpio_addr + GPIO_SETDATAOUT;<br />
gpio_cleardataout_addr = gpio_addr + GPIO_CLEARDATAOUT;<br />
<br />
'''gpio_setdataout_addr''' points to the register that sets the GPIO1 pins, therefore USR3 LED can be turned on with<br />
*gpio_setdataout_addr = USR3;<br />
and turned off with<br />
*gpio_cleardataout_addr = USR3;<br />
<br />
== mmap via python ==<br />
Here's a python version of mmap().<br />
<br />
From: https://graycat.io/tutorials/beaglebone-io-using-python-mmap/<br />
<br />
Note: This file can be found in '''exercises/sensors/mmap/gpioToggle.py'''<br />
<br />
from mmap import mmap<br />
import time, struct <br />
<br />
Mapping the entire /dev/mem file would require that over a gigabyte be<br />
allocated in Python's heap, so the offset address and size variables are <br />
used to keep the mmap as small as possible, in this case just the GPIO1 register. <br />
These values are straight out of the memory map in section 2.1 of the <br />
Technical Reference Manual. the GPIO_OE, GPIO_SETDATAOUT and GPIO_CLEARDATAOUT <br />
addresses are found in section 25.4, which shows the address offsets of each <br />
register within the GPIO modules, starting from the base module address. <br />
Chapter 25 explains how to use the GPIO registers. <br />
All we need to do is set a pin as an output, then set and clear its output state. <br />
To do the first, we need the 'output enable' register (GPIO_OE above). <br />
Then the GPIO_SETDATAOUT and GPIO_CLEARDATAOUT registers will do the rest. <br />
Each one of these registers is 32 bits long, each bit of which corresponding <br />
to one of 32 GPIO pins, so for pin 24 we need bit 24, or 1 shifted left 24 places.<br />
<br />
GPIO1_offset = 0x4804c000<br />
GPIO1_size = 0x4804cfff-GPIO1_offset<br />
GPIO_OE = 0x134<br />
GPIO_SETDATAOUT = 0x194<br />
GPIO_CLEARDATAOUT = 0x190<br />
USR3 = 1<<24<br />
<br />
Next we need to make the mmap, using the desired size and offset:<br />
with open("/dev/mem", "r+b" ) as f:<br />
mem = mmap(f.fileno(), GPIO1_size, offset=GPIO1_offset)<br />
<br />
The mmap is addressed byte by byte, so we can't just set a single bit. <br />
The easiest thing to do is grab the whole 4-byte register:<br />
packed_reg = mem[GPIO_OE:GPIO_OE+4]<br />
<br />
We now have 32 bits packed into a string, so to do any sort of bitwise operations with it we must unpack it:<br />
The 'L' tells struct.unpack() to unpack the string into an unsigned long, <br />
which will give us the full 32-bit register. The '<' tells it that the <br />
string is packed little-endian, or least-significant byte first. <br />
The BeagleBone's memory is little-endian, so if we tell this to struct.unpack() <br />
it will return the 32 bits in the order they are shown in the reference manual register maps.<br />
reg_status = struct.unpack("<L", packed_reg)[0]<br />
<br />
We now have the 32-bit integer value of the register, so we can configure <br />
the LED as an output by clearing its bit:<br />
reg_status &= ~(USR3)<br />
<br />
Now all that's left to do is to pack it little-endian back into a string and update the mmap:<br />
<br />
mem[GPIO_OE:GPIO_OE+4] = struct.pack("<L", reg_status)<br />
<br />
Now that we know the pin is configured as an output, it's time to get blinking. <br />
We could use the GPIO_DATAOUT register to do this, <br />
but we would want to preserve the state of all the other bits in it, <br />
so we would need to do the same process of unpacking, manipulating then repacking. <br />
That's what the SETDATAOUT and CLEARDATAOUT registers are for. <br />
Writes to them affect only the pins whose bits are set to 1, making the next step much easier:<br />
try:<br />
while(True):<br />
mem[GPIO_SETDATAOUT:GPIO_SETDATAOUT+4] = struct.pack("<L", USR3)<br />
time.sleep(0.5)<br />
mem[GPIO_CLEARDATAOUT:GPIO_CLEARDATAOUT+4] = struct.pack("<L", USR3)<br />
time.sleep(0.5)<br />
Then run with:<br />
sudo ./LEDtoggle.py<br />
Hit ^C to stop.<br />
<br />
== gpioToggle.c ==<br />
'''gpioToggle.c''' is a complete example using mmap. Run it with<br />
beagle$ '''cd ~/exercises/sensors/mmap'''<br />
beagle$ '''make'''<br />
cc -O3 -g -o gpioThru gpioThru.c<br />
cc -O3 -g -o gpioToggle gpioToggle.c<br />
beagle$ '''sudo ./gpioToggle'''<br />
Mapping 4804C000 - 4804E000 (size: 2000)<br />
GPIO mapped to 0xb6f40000<br />
GPIO OE mapped to 0xb6f40134<br />
GPIO SETDATAOUTADDR mapped to 0xb6f40194<br />
GPIO CLEARDATAOUT mapped to 0xb6f40190<br />
GPIO1 configuration: F60FFFFF<br />
GPIO1 configuration: F60FFFFF<br />
Start blinking LED USR3<br />
^C<br />
Ctrl-C pressed, cleaning up and exiting...<br />
Notice it reports addresses 0x4804C000 and 0xb6f40000. The first is the physical address of the GPIO1 base register. 0xb6f40000 is the virtual address of the same register. Running '''gpioToggle''' again will have the same physical address, but the virtual address might change.<br />
<br />
== gpioThru ==<br />
'''gpioThru''' using '''mmap''' to read an input pin and write it to an output pin. You can use this program to see how quickly the Beagle can respond to an input. Be sure to run '''setup.gpioThru.sh''' before the first time so the pin directions will be set.<br />
[[File:MmapGPIOdelay.png|right|400px]]<br />
beagle$ '''./setup.gpioThru.sh'''<br />
beagle$ '''./gpioThru'''<br />
Mapping 44E07000 - 44E09000 (size: 2000)<br />
GPIO mapped to 0xb6f36000<br />
GPIO OE mapped to 0xb6f36134<br />
GPIO SETDATAOUTADDR mapped to 0xb6f36194<br />
GPIO CLEARDATAOUT mapped to 0xb6f36190<br />
Start copying GPIO_07 to GPIO_03<br />
^C<br />
Ctrl-C pressed, cleaning up and exiting...<br />
<br />
I'm seeing delays between 220ns and 600ns. The gpio subsystem runs at 100MHz, so I would expect delays in the 10's of ns, not 100's.<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_16_git_-_Beagle_repos&diff=580498EBC Exercise 16 git - Beagle repos2023-12-19T16:36:24Z<p>Yoder: /* Beagle github repos */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
The repositories used for the Beagle seem to be scattered all over the place. Here's an attempt to list them. <br />
<br />
== Collaboration ==<br />
<br />
; Discord<br />
: https://bbb.io/discord<br />
<br />
; Slack<br />
: https://beagleboard.slack.com<br />
<br />
; Forum<br />
: https://forum.beagleboard.org/<br />
<br />
== Documentation ==<br />
<br />
; git.beagleboard.org<br />
: https://git.beagleboard.org/docs/docs.beagleboard.io/-/tree/main/<br />
<br />
; git.beagleboard.org/yoder<br />
: https://git.beagleboard.org/yoder/docs.beagleboard.io<br />
<br />
; Formatted<br />
: https://docs.beagleboard.org/latest/index.html<br />
<br />
; Staged<br />
: https://docs.beagleboard.io/latest/index.html<br />
<br />
; Mine<br />
: https://yoder.beagleboard.io/docs.beagleboard.io/latest/<br />
<br />
== Images ==<br />
<br />
; Latest<br />
: https://forum.beagleboard.org/tag/latest-images<br />
<br />
; Snapshot<br />
: https://rcn-ee.net/rootfs/snapshot/<br />
<br />
== System Reference Manuals ==<br />
<br />
; Black<br />
: https://github.com/beagleboard/beaglebone-black/wiki/System-Reference-Manual<br />
<br />
; Pocket<br />
: https://github.com/beagleboard/pocketbeagle/wiki/System-Reference-Manual<br />
<br />
; AI<br />
: https://github.com/beagleboard/beaglebone-ai/wiki/System-Reference-Manual<br />
<br />
; Cape<br />
: https://elinux.org/Beagleboard:BeagleBone_cape_interface_spec<br />
<br />
== Technical Reference Manuals ==<br />
<br />
; am335x<br />
: http://www.ti.com/lit/pdf/spruh73 Black, Pocket, etc.<br />
<br />
; am572x<br />
: http://www.ti.com/lit/ug/spruhz6k/spruhz6k.pdf AI<br />
<br />
== Beagle github repos ==<br />
<br />
; repos<br />
: https://github.com/rcn-ee/repos<br />
<br />
;Kernel<br />
: https://git.beagleboard.org/RobertCNelson/ti-linux-kernel-dev<br />
: https://github.com/RobertCNelson/bb-kernel<br />
<br />
; Test images<br />
: https://rcn-ee.com/rootfs/bb.org/testing/<br />
<br />
; Device Trees<br />
: https://github.com/beagleboard/BeagleBoard-DeviceTrees Look in src/arm. am5729-beagleboneai.dts is for the AI.<br />
<br />
; Overlays<br />
: https://github.com/beagleboard/bb.org-overlays This may already be in <code>/opt/source/bb.org-overlays</code><br />
<br />
; Boot Scripts<br />
: https://github.com/RobertCNelson/boot-scripts Just a bunch of useful scripts placed under /opt/scripts/.<br />
<br />
; Image Builder<br />
: https://github.com/beagleboard/image-builder Image builder and eeprom database.<br />
<br />
; Beagle Tester<br />
: https://github.com/jadonk/beagle-tester Simplify and standardize testing of BeagleBoard.org designs<br />
<br />
; udev rules<br />
: https://github.com/beagleboard/customizations Look in etc/udev/rules.d for udev rules<br />
<br />
; Cloud9 Examples<br />
: https://github.com/beagleboard/cloud9-examples.git These are the files that appear in the navigation tree on the left of Cloud9.<br />
<br />
; BoneScript<br />
: https://github.com/beagleboard/bonescript Scripting tools for the BeagleBoard and BeagleBone<br />
<br />
; Adafruit BeagleBone Python<br />
: https://github.com/adafruit/adafruit-beaglebone-io-python Adafruit's BeagleBone IO Python Library<br />
<br />
; Seed Grove kernel module<br />
: https://github.com/Seeed-Studio/seeed-linux-dtoverlays/tree/master/modules<br />
<br />
; BeagleBoard exercieses<br />
: https://github.com/MarkAYoder/BeagleBoard-exercises.git This is the repo I use for my class.<br />
<br />
; BeagleBone Cookbook<br />
: https://atlas.oreilly.com/oreillymedia/beaglebone-cookbook You need a password for this one.<br />
<br />
; PRU Cookbook<br />
: https://github.com/MarkAYoder/PRUCookbook.git The repo for the PRU Cookbook. No password needed.<br />
<br />
; Exploring BeagleBoard<br />
: https://github.com/derekmolloy/exploringBB.git A great book by Derek Molloy.<br />
<br />
; Mag Pi Downloader<br />
: https://github.com/joergi/MagPiDownloader.git Good source of ideas.<br />
<br />
== Header files ==<br />
<br />
; BeagleBone Black P8<br />
:https://github.com/derekmolloy/boneDeviceTree/blob/master/docs/BeagleboneBlackP8HeaderTable.pdf<br />
<br />
; BeagleBone Black P9<br />
:https://github.com/derekmolloy/boneDeviceTree/blob/master/docs/BeagleboneBlackP9HeaderTable.pdf<br />
<br />
; PocketBeagle pins<br />
: https://docs.google.com/spreadsheets/d/1FRGvYOyW1RiNSEVprvstfJAVeapnASgDXHtxeDOjgqw/edit#gid=0<br />
<br />
; BeagleBone AI P8 Header<br />
: https://docs.google.com/spreadsheets/d/1opaOLjF7_EDNCR3g5NiEILsJba8h5ZumSeBwOvD1-6Q/edit#gid=0<br />
<br />
; BeagleBone AI P9 Header<br />
: https://docs.google.com/spreadsheets/d/12qkmnyM3qgxL-F6tBKBaA220u_hGWrLgVg9rrCykZ2Q/edit#gid=0<br />
<br />
; BeagleBone AI PRU pins<br />
: https://docs.google.com/spreadsheets/d/19u2rtqVGChSOd0_8ZJj_E3XosuGBpWy7j633__siOvw/edit#gid=0<br />
<br />
; BeagleBone Cape Header Pins<br />
: https://docs.google.com/spreadsheets/d/1fE-AsDZvJ-bBwzNBj1_sPDrutvEvsmARqFwvbw_HkrE/edit?ts=5d3a7a23#gid=1518010293<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_08_Installing_Development_Tools_4.4&diff=580495EBC Exercise 08 Installing Development Tools 4.42023-12-19T16:02:42Z<p>Yoder: /* Installing the kernel package - build_deb.sh */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
Early in the class most of the exercises we will do will all run on the BeagleBoard. You'll be able to edit ([https://aws.amazon.com/cloud9/ cloud9]), compile ([http://gcc.gnu.org/ gcc]) and run all on the Beagle. Later, when we start compiling the [http://www.kernel.org/ kernel] or the boot loader, ([http://www.denx.de/wiki/U-Boot U-boot]) you will need to cross compile on a Linux machine and copy the results to the Beagle.<br />
<br />
The purpose of this exercise is to install all the tools needed for compiling on your host so they will be ready when you need them.<br />
<br />
'''Tip:''' Run this exercise using a wired connection if you can. The Ubuntu wireless driver can be finicky, and if it stops working you'll have to restart some of this.<br />
<br />
== The 5.x Kernel ==<br />
<br />
=== Getting the 5.x Kernel ===<br />
<br />
These notes taken from [http://www.youtube.com/watch?v=HJ9nUqYMjqs&t=4m10s Beaglebone: Adding USB Wi-Fi & Building a Linux Kernel] starting around 4 minutes and ending around 21 minutes. Uses kernel from [http://eewiki.net/display/linuxonarm/BeagleBone+Black Robert C. Nelson's BeagleBone Black] page.<br />
<br />
host$ '''git clone git@git.beagleboard.org:RobertCNelson/ti-linux-kernel-dev.git''' (65M)<br />
host$ '''cd ti-linux-kernel-dev'''<br />
<br />
host$ '''git tag | wc'''<br />
1857 1857 32406<br />
The last command lists all the versions of the kernel that are available and counts them. There are over 1700 versions!<br />
Let's narrow it a bit.<br />
host$ '''git tag | grep 5.10.168'''<br />
5.10.168-ti-arm64-r100<br />
5.10.168-ti-arm64-r101<br />
...<br />
5.10.168-ti-arm64-r112<br />
5.10.168-ti-arm64-r113<br />
5.10.168-ti-r60<br />
5.10.168-ti-r61<br />
...<br />
5.10.168-ti-r69<br />
5.10.168-ti-r70<br />
5.10.168-ti-r71<br />
5.10.168-ti-r72<br />
5.10.168-ti-r73<br />
5.10.168-ti-r74<br />
5.10.168-ti-rt-r60<br />
5.10.168-ti-rt-r61<br />
...<br />
5.10.168-ti-rt-r69<br />
5.10.168-ti-rt-r70<br />
5.10.168-ti-rt-r71<br />
5.10.168-ti-rt-r72<br />
5.10.168-ti-rt-r73<br />
5.10.168-ti-rt-r74 <br />
Pick one and check it out. I usually pick the one with the highest<br />
version number not equal to the version I'm running.<br />
host$ '''git checkout 5.10.168-ti-r74 -b 5.10.168-ti-r74'''<br />
Switched to a new branch '5.10.168-ti-r74'<br />
<br />
Now at this point you have a choice, you can run '''./build_kernel.sh'''<br />
and build the kernel, or run '''./build_deb.sh''' which will also build<br />
the kernel, but it will combine all the output files in<br />
one '''.deb''' install file. I suggest running '''./build_deb.sh''',<br />
<br />
host$ '''./build_deb.sh'''<br />
+ Detected build host [Ubuntu 22.04.3 LTS]<br />
+ host: [x86_64]<br />
+ git HEAD commit: [1f23d7ca554505f54938ba393020c50b2ed9ced2]<br />
-----------------------------<br />
cpio: cpio (GNU cpio) 2.13<br />
You're missing command lz4<br />
Please install missing commands<br />
-----------------------------<br />
<br />
You ''may'' need to install some additional files. Run the suggested commands.<br />
<br />
host$ '''sudo apt update'''<br />
host$ '''sudo apt install lzop'''<br />
host$ '''./build_deb.sh'''<br />
+ Detected build host [Ubuntu 20.04.1 LTS]<br />
+ host: [x86_64]<br />
+ git HEAD commit: [a7ff6610037f33b2a8c19d7f111cf9e43aa3c4ef]<br />
-----------------------------<br />
cpio: cpio (GNU cpio) 2.13<br />
lzop: lzop 1.04<br />
Debian/Ubuntu/Mint: missing dependencies, please install:<br />
-----------------------------<br />
sudo apt-get update<br />
sudo apt-get install build-essential fakeroot lzma gettext bison flex pkg-config libmpc-dev u-boot-tools libncurses5-dev:amd64<br />
libssl-dev:amd64 <br />
-----------------------------<br />
* Failed dependency check<br />
<br />
host$ '''sudo apt-get install build-essential fakeroot lzma gettext bison flex pkg-config libmpc-dev u-boot-tools libncurses5-dev:amd64 libssl-dev:amd64 libssl-dev:amd64'''<br />
<br />
Then run again.<br />
host$ '''./build_deb.sh'''<br />
+ Detected build host [Ubuntu 22.04.3 LTS]<br />
+ host: [x86_64]<br />
+ git HEAD commit: [1f23d7ca554505f54938ba393020c50b2ed9ced2]<br />
-----------------------------<br />
cpio: cpio (GNU cpio) 2.13<br />
lz4: *** LZ4 command line interface 64-bits v1.9.3, by Yann Collet ***<br />
'/home/yoder/ti-linux-kernel-dev/system.sh.sample' -> '/home/yoder/ti-linux-kernel-dev/system.sh'<br />
glibc: 2.35<br />
Installing Toolchain: gcc_10_arm<br />
<br />
At this point the scripts are downloading the cross compiler, the kernel sources and anything else you need to compile the kernel for the bone.<br />
<br />
=== Building the 5.x Kernel ===<br />
At some point you will see<br />
<br />
[[File:KernelConfig2.png]]<br />
<br />
Hit the right arrow to select '''Exit''' and then hit ENTER. <br />
<br />
The compilation will continue. It took some 23 minutes on my laptop.<br />
<br />
=== Installing the Kernel on Your Bone ===<br />
The following are three ways you can use to install a new kernel on your Bone. <br />
The first method works if you ran '''build_deb.sh'''.<br />
<br />
The other two methods are used if you ran '''build_kernel.sh'''<br />
<br />
You only need to use one method. If you ran '''build_kernel.sh''' <br />
I suggest you use the second one since you don't have to remove the SD card from the bone.<br />
<br />
==== Installing the kernel package - build_deb.sh ====<br />
The '''./build_deb.sh''' script creates a single '''.deb''' file that contains<br />
all the files needed for the new kernel. You find it here:<br />
host$ '''cd ti-linux-kernel-dev/deploy'''<br />
host$ '''ls -sh'''<br />
total 40M<br />
7.3M linux-headers-5.8.11-bone17_1xross_armhf.deb 8.0K linux-upstream_1xross_armhf.buildinfo<br />
31M linux-image-5.8.11-bone17_1xross_armhf.deb 4.0K linux-upstream_1xross_armhf.changes<br />
1.1M linux-libc-dev_1xross_armhf.deb<br />
<br />
The '''linux-image-''' file is the one we want. It contains over 3000 files.<br />
host$ '''dpkg -c linux-image-5.8.11-bone17_1xross_armhf.deb | wc<br />
3252 19512 379622<br />
The dpkg command lists all the files in the .deb file and the '''wc''' counts<br />
all the lines in the output. You can see those files with:<br />
host$ '''dpkg -c linux-image-5.8.11-bone17_1xross_armhf.deb | less'''<br />
drwxr-xr-x root/root 0 2020-09-29 14:16 ./<br />
drwxr-xr-x root/root 0 2020-09-29 14:16 ./boot/<br />
-rw-r--r-- root/root 4285674 2020-09-29 14:16 ./boot/System.map-5.8.11-bone17<br />
-rw-r--r-- root/root 182474 2020-09-29 14:16 ./boot/config-5.8.11-bone17<br />
drwxr-xr-x root/root 0 2020-09-29 14:16 ./boot/dtbs/<br />
drwxr-xr-x root/root 0 2020-09-29 14:16 ./boot/dtbs/5.8.11-bone17/<br />
-rwxr-xr-x root/root 87267 2020-09-29 14:16 ./boot/dtbs/5.8.11-bone17/am335x-abbbi.dtb<br />
-rwxr-xr-x root/root 86826 2020-09-29 14:16 ./boot/dtbs/5.8.11-bone17/am335x-baltos-ir2110.dtb<br />
-rwxr-xr-x root/root 87544 2020-09-29 14:16 ./boot/dtbs/5.8.11-bone17/am335x-baltos-ir3220.dtb<br />
You can see it's putting things in the '''/boot''' directory.<br />
<br />
Note: You can also look into the other two .deb files and see what they install.<br />
<br />
Move the '''linux-image-''' file to your Bone.<br />
host$ '''scp linux-image-5.10.168-ti-r74_1xross_armhf.deb bone:.'''<br />
<br />
Hint: You might have to add '''-P<port>''' if you changed your port number.<br />
You might have to use debian@192.168.7.2 for bone if you haven't set everything up.<br />
<br />
Now ssh to the bone.<br />
host$ '''ssh bone'''<br />
bone$ '''ls'''<br />
bin exercises linux-image-5.10.168-ti-r74_1xross_armhf.deb<br />
Now install it.<br />
bone$ '''sudo dpkg --install linux-image-5.8.11-bone17_1xross_armhf.deb'''<br />
Wait a while. Once done check /boot.<br />
bone$ '''ls -sh /boot'''<br />
total 70M<br />
4.0K SOC.sh 188K config-5.10.168-ti-r74 4.0K uboot<br />
4.6M System.map-5.10.168-ti-r72 4.0K dtbs 11M vmlinuz-5.10.168-ti-r72<br />
4.6M System.map-5.10.168-ti-r73 7.5M initrd.img-5.10.168-ti-r72 11M vmlinuz-5.10.168-ti-r73<br />
4.6M System.map-5.10.168-ti-r74 7.8M initrd.img-5.10.168-ti-r73 11M vmlinuz-5.10.168-ti-r74<br />
188K config-5.10.168-ti-r72 7.8M initrd.img-5.10.168-ti-r74<br />
188K config-5.10.168-ti-r73 4.0K uEnv.txt<br />
You see the new kernel files. Check uEnv.txt.<br />
bone$ '''head /boot/uEnv.txt'''<br />
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0<br />
uname_r=5.10.168-ti-r73<br />
# uname_r=5.10.168-ti-r74<br />
I added the commented out '''uname_r''' line to make it easy to switch between<br />
versions of the kernel.<br />
<br />
Reboot and test out the new kernel.<br />
bone$ '''sudo reboot'''<br />
<br />
==== Copying to SD card on a running Bone - build_kernel.sh====<br />
You can stop here if you've just finished the build_deb.sh method of installing the kernel.<br />
<br />
The Bone can have multiple versions of the kernel installed on it. <br />
It's possible to update the kernel on the Bone while it's running. <br />
After compiling on the host you need to install sshfs (you only need to do this once).<br />
<br />
host$ '''sudo apt install sshfs '''<br />
<br />
Then copy '''may_install_kernel.sh''' to the bb-kernel directory.<br />
host$ '''cd ~/BeagleBoard/bb-kernel'''<br />
host$ '''cp ~/BeagleBoard/exercises/linux/kernel/may_install_kernel.sh tools'''<br />
Now you can install the files using the following. Note, you must run '''may_install_kernel.sh''' from the directory above as shown.<br />
host$ '''tools/may_install_kernel.sh'''<br />
Mounting sshfs<br />
-----------------------------<br />
sshfs mounted<br />
Installing 4.4.15-bone11 to sshfs<br />
‘/home/yoder/BeagleBoard/bb-kernel/deploy/4.4.15-bone11.zImage’ -> ‘/home/yoder/BeagleBoard/bb-kernel/deploy/disk/zImage’<br />
Installing 4.4.15-bone11-dtbs.tar.gz to sshfs<br />
Installing 4.4.15-bone11 to sshfs<br />
‘/home/yoder/BeagleBoard/bb-kernel/deploy/4.4.15-bone11.zImage’ -> ‘/home/yoder/BeagleBoard/bb-kernel/deploy/disk/boot/vmlinuz-4.4.15-bone11’<br />
Installing 4.4.15-bone11-dtbs.tar.gz to sshfs<br />
info: /boot/uEnv.txt: uname_r=4.4.15-bone11<br />
Installing 4.4.15-bone11-modules.tar.gz to sshfs<br />
tar: ./lib/modules/4.4.15-bone11/build: Cannot utime: No such file or directory<br />
tar: ./lib/modules/4.4.15-bone11/source: Cannot utime: No such file or directory<br />
tar: Exiting with failure status due to previous errors<br />
‘/home/yoder/BeagleBoard/bb-kernel/deploy/config-4.4.15-bone11’ -> ‘/home/yoder/BeagleBoard/bb-kernel/deploy/disk/boot/config-4.4.15-bone11’<br />
info: [4.4.15-bone11] now installed...<br />
You may see about couple of error messages about ''build'' and ''source'', but it seems to work anyway.<br />
If you look in /boot/uEvt.txt, you'll see it's ready to boot your new kernel.<br />
bone$ '''head -3 /boot/uEnv.txt'''<br />
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0<br />
<br />
uname_r=4.4.15-bone11<br />
If you change your mind about which kernel to boot, just edit the '''uname''' line.<br />
<br />
==== Copying to the SD Card on Host - build_kernel.sh====<br />
You can also install the kernel on an SD card that is mounted on your host computer. Plug it into your host and machine and run:<br />
host$ '''tools/install_kernel.sh'''<br />
<br />
This works like the '''may_install_kernel.sh''', but it copies it to local host. Once copied, eject the SD card and plug it into your Bone and boot.<br />
<br />
=== Updating to a new version of the kernel ===<br />
<br />
When you build your kernel the uImage file has some version information in the name. For example '''vmlinuz-4.4.21-ti-r47'''. The '''4.4.21''' is the version of the kernel and the '''-ti-r47''' is the version of the patches applied to the kernel for the BeagleBone. Over time new patches will be posted. These instructions show how to get the latest version.<br />
<br />
How do you know if you have the latest version? Run<br />
bone$ '''uname -a'''<br />
Linux yoder-debian-bone 4.4.21-ti-r47 #1 SMP Fri Sep 23 22:23:02 UTC 2016 armv7l GNU/Linux<br />
<br />
This [https://groups.google.com/forum/#!topic/beagleboard/D3wRnulVE1I post to the Google Group] lists the steps as "You need to recheckout master, delete your old branch and re-pull". Here's how you do it.<br />
<br />
host$ '''cd linux-dev'''<br />
host$ '''git checkout master'''<br />
error: Your local changes to the following files would be overwritten by checkout:<br />
patches/defconfig<br />
Please, commit your changes or stash them before you can switch branches.<br />
Aborting<br />
Hmm.... something has changed. See what it is.<br />
host$ '''git diff patches/defconfig'''<br />
diff --git a/patches/defconfig b/patches/defconfig<br />
index d903776..3268287 100644<br />
--- a/patches/defconfig<br />
+++ b/patches/defconfig<br />
@@ -2041,6 +2041,7 @@ CONFIG_JHD629_I2C=y<br />
# CONFIG_SERIAL_NONSTANDARD is not set<br />
# CONFIG_N_GSM is not set<br />
# CONFIG_TRACE_SINK is not set<br />
+CONFIG_LPD8806=m<br />
CONFIG_DEVKMEM=y<br />
<br />
#<br />
It looks like some configuration setting have changed. Since we are getting a new version of the kernel, let's revert back to the previous file and try again.<br />
<br />
host$ '''git checkout patches/defconfig'''<br />
host$ '''git checkout master'''<br />
Switched to branch 'master'<br />
Success, now step 2.<br />
host$ '''git branch -d am33x-v3.8'''<br />
warning: deleting branch 'am33x-v3.8' that has been merged to<br />
'refs/remotes/origin/am33x-v3.8', but not yet merged to HEAD.<br />
Deleted branch am33x-v3.8 (was 3fc8a73).<br />
Now repull<br />
host$ '''git pull'''<br />
Then start over again<br />
host$ '''git checkout origin/am33x-v3.8 -b am33x-v3.8'''<br />
Branch am33x-v3.8 set up to track remote branch am33x-v3.8 from origin.<br />
Switched to a new branch 'am33x-v3.8'<br />
Your '''system.sh''' file should be unchanged, so start building<br />
host$ '''./build_kernel.sh'''<br />
Mine took some 26 minutes on an 8 core machine.<br />
<br />
== Recovering ==<br />
If your Beagle fails to boot, follow the [[EBC_Exercise_22_Recovering]] instructions to recover.<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_08_Installing_Development_Tools_4.4&diff=580492EBC Exercise 08 Installing Development Tools 4.42023-12-19T15:47:41Z<p>Yoder: /* Building the 5.x Kernel */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
Early in the class most of the exercises we will do will all run on the BeagleBoard. You'll be able to edit ([https://aws.amazon.com/cloud9/ cloud9]), compile ([http://gcc.gnu.org/ gcc]) and run all on the Beagle. Later, when we start compiling the [http://www.kernel.org/ kernel] or the boot loader, ([http://www.denx.de/wiki/U-Boot U-boot]) you will need to cross compile on a Linux machine and copy the results to the Beagle.<br />
<br />
The purpose of this exercise is to install all the tools needed for compiling on your host so they will be ready when you need them.<br />
<br />
'''Tip:''' Run this exercise using a wired connection if you can. The Ubuntu wireless driver can be finicky, and if it stops working you'll have to restart some of this.<br />
<br />
== The 5.x Kernel ==<br />
<br />
=== Getting the 5.x Kernel ===<br />
<br />
These notes taken from [http://www.youtube.com/watch?v=HJ9nUqYMjqs&t=4m10s Beaglebone: Adding USB Wi-Fi & Building a Linux Kernel] starting around 4 minutes and ending around 21 minutes. Uses kernel from [http://eewiki.net/display/linuxonarm/BeagleBone+Black Robert C. Nelson's BeagleBone Black] page.<br />
<br />
host$ '''git clone git@git.beagleboard.org:RobertCNelson/ti-linux-kernel-dev.git''' (65M)<br />
host$ '''cd ti-linux-kernel-dev'''<br />
<br />
host$ '''git tag | wc'''<br />
1857 1857 32406<br />
The last command lists all the versions of the kernel that are available and counts them. There are over 1700 versions!<br />
Let's narrow it a bit.<br />
host$ '''git tag | grep 5.10.168'''<br />
5.10.168-ti-arm64-r100<br />
5.10.168-ti-arm64-r101<br />
...<br />
5.10.168-ti-arm64-r112<br />
5.10.168-ti-arm64-r113<br />
5.10.168-ti-r60<br />
5.10.168-ti-r61<br />
...<br />
5.10.168-ti-r69<br />
5.10.168-ti-r70<br />
5.10.168-ti-r71<br />
5.10.168-ti-r72<br />
5.10.168-ti-r73<br />
5.10.168-ti-r74<br />
5.10.168-ti-rt-r60<br />
5.10.168-ti-rt-r61<br />
...<br />
5.10.168-ti-rt-r69<br />
5.10.168-ti-rt-r70<br />
5.10.168-ti-rt-r71<br />
5.10.168-ti-rt-r72<br />
5.10.168-ti-rt-r73<br />
5.10.168-ti-rt-r74 <br />
Pick one and check it out. I usually pick the one with the highest<br />
version number not equal to the version I'm running.<br />
host$ '''git checkout 5.10.168-ti-r74 -b 5.10.168-ti-r74'''<br />
Switched to a new branch '5.10.168-ti-r74'<br />
<br />
Now at this point you have a choice, you can run '''./build_kernel.sh'''<br />
and build the kernel, or run '''./build_deb.sh''' which will also build<br />
the kernel, but it will combine all the output files in<br />
one '''.deb''' install file. I suggest running '''./build_deb.sh''',<br />
<br />
host$ '''./build_deb.sh'''<br />
+ Detected build host [Ubuntu 22.04.3 LTS]<br />
+ host: [x86_64]<br />
+ git HEAD commit: [1f23d7ca554505f54938ba393020c50b2ed9ced2]<br />
-----------------------------<br />
cpio: cpio (GNU cpio) 2.13<br />
You're missing command lz4<br />
Please install missing commands<br />
-----------------------------<br />
<br />
You ''may'' need to install some additional files. Run the suggested commands.<br />
<br />
host$ '''sudo apt update'''<br />
host$ '''sudo apt install lzop'''<br />
host$ '''./build_deb.sh'''<br />
+ Detected build host [Ubuntu 20.04.1 LTS]<br />
+ host: [x86_64]<br />
+ git HEAD commit: [a7ff6610037f33b2a8c19d7f111cf9e43aa3c4ef]<br />
-----------------------------<br />
cpio: cpio (GNU cpio) 2.13<br />
lzop: lzop 1.04<br />
Debian/Ubuntu/Mint: missing dependencies, please install:<br />
-----------------------------<br />
sudo apt-get update<br />
sudo apt-get install build-essential fakeroot lzma gettext bison flex pkg-config libmpc-dev u-boot-tools libncurses5-dev:amd64<br />
libssl-dev:amd64 <br />
-----------------------------<br />
* Failed dependency check<br />
<br />
host$ '''sudo apt-get install build-essential fakeroot lzma gettext bison flex pkg-config libmpc-dev u-boot-tools libncurses5-dev:amd64 libssl-dev:amd64 libssl-dev:amd64'''<br />
<br />
Then run again.<br />
host$ '''./build_deb.sh'''<br />
+ Detected build host [Ubuntu 22.04.3 LTS]<br />
+ host: [x86_64]<br />
+ git HEAD commit: [1f23d7ca554505f54938ba393020c50b2ed9ced2]<br />
-----------------------------<br />
cpio: cpio (GNU cpio) 2.13<br />
lz4: *** LZ4 command line interface 64-bits v1.9.3, by Yann Collet ***<br />
'/home/yoder/ti-linux-kernel-dev/system.sh.sample' -> '/home/yoder/ti-linux-kernel-dev/system.sh'<br />
glibc: 2.35<br />
Installing Toolchain: gcc_10_arm<br />
<br />
At this point the scripts are downloading the cross compiler, the kernel sources and anything else you need to compile the kernel for the bone.<br />
<br />
=== Building the 5.x Kernel ===<br />
At some point you will see<br />
<br />
[[File:KernelConfig2.png]]<br />
<br />
Hit the right arrow to select '''Exit''' and then hit ENTER. <br />
<br />
The compilation will continue. It took some 23 minutes on my laptop.<br />
<br />
=== Installing the Kernel on Your Bone ===<br />
The following are three ways you can use to install a new kernel on your Bone. <br />
The first method works if you ran '''build_deb.sh'''.<br />
<br />
The other two methods are used if you ran '''build_kernel.sh'''<br />
<br />
You only need to use one method. If you ran '''build_kernel.sh''' <br />
I suggest you use the second one since you don't have to remove the SD card from the bone.<br />
<br />
==== Installing the kernel package - build_deb.sh ====<br />
The '''./build_deb.sh''' script creates a single '''.deb''' file that contains<br />
all the files needed for the new kernel. You find it here:<br />
host$ '''cd ti-linux-kernel-dev/deploy'''<br />
host$ '''ls -sh'''<br />
total 40M<br />
7.3M linux-headers-5.8.11-bone17_1xross_armhf.deb 8.0K linux-upstream_1xross_armhf.buildinfo<br />
31M linux-image-5.8.11-bone17_1xross_armhf.deb 4.0K linux-upstream_1xross_armhf.changes<br />
1.1M linux-libc-dev_1xross_armhf.deb<br />
<br />
The '''linux-image-''' file is the one we want. It contains nearly 3000 files.<br />
host$ '''dpkg -c linux-image-5.8.11-bone17_1xross_armhf.deb | wc<br />
2981 17886 342664<br />
The dpkg command lists all the files in the .deb file and the '''wc''' counts<br />
all the lines in the output. You can see those files with:<br />
bone$ '''dpkg -c linux-image-5.8.11-bone17_1xross_armhf.deb | less'''<br />
drwxr-xr-x root/root 0 2020-09-29 14:16 ./<br />
drwxr-xr-x root/root 0 2020-09-29 14:16 ./boot/<br />
-rw-r--r-- root/root 4285674 2020-09-29 14:16 ./boot/System.map-5.8.11-bone17<br />
-rw-r--r-- root/root 182474 2020-09-29 14:16 ./boot/config-5.8.11-bone17<br />
drwxr-xr-x root/root 0 2020-09-29 14:16 ./boot/dtbs/<br />
drwxr-xr-x root/root 0 2020-09-29 14:16 ./boot/dtbs/5.8.11-bone17/<br />
-rwxr-xr-x root/root 87267 2020-09-29 14:16 ./boot/dtbs/5.8.11-bone17/am335x-abbbi.dtb<br />
-rwxr-xr-x root/root 86826 2020-09-29 14:16 ./boot/dtbs/5.8.11-bone17/am335x-baltos-ir2110.dtb<br />
-rwxr-xr-x root/root 87544 2020-09-29 14:16 ./boot/dtbs/5.8.11-bone17/am335x-baltos-ir3220.dtb<br />
You can see it's putting things in the '''/boot''' directory.<br />
<br />
Note: You can also look into the other two .deb files and see what they install.<br />
<br />
Move the '''linux-image-''' file to your Bone.<br />
host$ '''scp linux-image-5.8.11-bone17_1xross_armhf.deb bone:.'''<br />
<br />
Hint: You might have to add '''-P<port>''' if you changed your port number.<br />
You might have to use debian@192.168.7.2 for bone if you haven't set everything up.<br />
<br />
Now ssh to the bone.<br />
host$ '''ssh bone'''<br />
bone$ '''ls -sh'''<br />
bin exercises linux-image-5.8.11-bone17_1xross_armhf.deb<br />
Now install it.<br />
bone$ '''sudo dpkg --install linux-image-5.8.11-bone17_1xross_armhf.deb'''<br />
Wait a while. Once done check /boot.<br />
bone$ '''ls -sh /boot'''<br />
total 40M<br />
160K config-4.19.94-ti-r50 4.0K SOC.sh 4.0K uEnv.txt.orig<br />
180K config-5.8.11-bone17 3.5M System.map-4.19.94-ti-r50 9.7M vmlinuz-4.19.94-ti-r50<br />
4.0K dtbs 4.1M System.map-5.8.11-bone17 8.6M vmlinuz-5.8.11-bone17<br />
6.4M initrd.img-4.19.94-ti-r50 4.0K uboot<br />
6.8M initrd.img-5.8.11-bone17 4.0K uEnv.txt<br />
You see the new kernel files. Check uEnv.txt.<br />
bone$ '''head /boot/uEnv.txt'''<br />
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0<br />
# uname_r=4.19.94-ti-r50<br />
uname_r=5.8.11-bone17<br />
I added the commented out '''uname_r''' line to make it easy to switch between<br />
versions of the kernel.<br />
<br />
Reboot and test out the new kernel.<br />
bone$ '''sudo reboot'''<br />
<br />
==== Copying to SD card on a running Bone - build_kernel.sh====<br />
You can stop here if you've just finished the build_deb.sh method of installing the kernel.<br />
<br />
The Bone can have multiple versions of the kernel installed on it. <br />
It's possible to update the kernel on the Bone while it's running. <br />
After compiling on the host you need to install sshfs (you only need to do this once).<br />
<br />
host$ '''sudo apt install sshfs '''<br />
<br />
Then copy '''may_install_kernel.sh''' to the bb-kernel directory.<br />
host$ '''cd ~/BeagleBoard/bb-kernel'''<br />
host$ '''cp ~/BeagleBoard/exercises/linux/kernel/may_install_kernel.sh tools'''<br />
Now you can install the files using the following. Note, you must run '''may_install_kernel.sh''' from the directory above as shown.<br />
host$ '''tools/may_install_kernel.sh'''<br />
Mounting sshfs<br />
-----------------------------<br />
sshfs mounted<br />
Installing 4.4.15-bone11 to sshfs<br />
‘/home/yoder/BeagleBoard/bb-kernel/deploy/4.4.15-bone11.zImage’ -> ‘/home/yoder/BeagleBoard/bb-kernel/deploy/disk/zImage’<br />
Installing 4.4.15-bone11-dtbs.tar.gz to sshfs<br />
Installing 4.4.15-bone11 to sshfs<br />
‘/home/yoder/BeagleBoard/bb-kernel/deploy/4.4.15-bone11.zImage’ -> ‘/home/yoder/BeagleBoard/bb-kernel/deploy/disk/boot/vmlinuz-4.4.15-bone11’<br />
Installing 4.4.15-bone11-dtbs.tar.gz to sshfs<br />
info: /boot/uEnv.txt: uname_r=4.4.15-bone11<br />
Installing 4.4.15-bone11-modules.tar.gz to sshfs<br />
tar: ./lib/modules/4.4.15-bone11/build: Cannot utime: No such file or directory<br />
tar: ./lib/modules/4.4.15-bone11/source: Cannot utime: No such file or directory<br />
tar: Exiting with failure status due to previous errors<br />
‘/home/yoder/BeagleBoard/bb-kernel/deploy/config-4.4.15-bone11’ -> ‘/home/yoder/BeagleBoard/bb-kernel/deploy/disk/boot/config-4.4.15-bone11’<br />
info: [4.4.15-bone11] now installed...<br />
You may see about couple of error messages about ''build'' and ''source'', but it seems to work anyway.<br />
If you look in /boot/uEvt.txt, you'll see it's ready to boot your new kernel.<br />
bone$ '''head -3 /boot/uEnv.txt'''<br />
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0<br />
<br />
uname_r=4.4.15-bone11<br />
If you change your mind about which kernel to boot, just edit the '''uname''' line.<br />
<br />
==== Copying to the SD Card on Host - build_kernel.sh====<br />
You can also install the kernel on an SD card that is mounted on your host computer. Plug it into your host and machine and run:<br />
host$ '''tools/install_kernel.sh'''<br />
<br />
This works like the '''may_install_kernel.sh''', but it copies it to local host. Once copied, eject the SD card and plug it into your Bone and boot.<br />
<br />
=== Updating to a new version of the kernel ===<br />
<br />
When you build your kernel the uImage file has some version information in the name. For example '''vmlinuz-4.4.21-ti-r47'''. The '''4.4.21''' is the version of the kernel and the '''-ti-r47''' is the version of the patches applied to the kernel for the BeagleBone. Over time new patches will be posted. These instructions show how to get the latest version.<br />
<br />
How do you know if you have the latest version? Run<br />
bone$ '''uname -a'''<br />
Linux yoder-debian-bone 4.4.21-ti-r47 #1 SMP Fri Sep 23 22:23:02 UTC 2016 armv7l GNU/Linux<br />
<br />
This [https://groups.google.com/forum/#!topic/beagleboard/D3wRnulVE1I post to the Google Group] lists the steps as "You need to recheckout master, delete your old branch and re-pull". Here's how you do it.<br />
<br />
host$ '''cd linux-dev'''<br />
host$ '''git checkout master'''<br />
error: Your local changes to the following files would be overwritten by checkout:<br />
patches/defconfig<br />
Please, commit your changes or stash them before you can switch branches.<br />
Aborting<br />
Hmm.... something has changed. See what it is.<br />
host$ '''git diff patches/defconfig'''<br />
diff --git a/patches/defconfig b/patches/defconfig<br />
index d903776..3268287 100644<br />
--- a/patches/defconfig<br />
+++ b/patches/defconfig<br />
@@ -2041,6 +2041,7 @@ CONFIG_JHD629_I2C=y<br />
# CONFIG_SERIAL_NONSTANDARD is not set<br />
# CONFIG_N_GSM is not set<br />
# CONFIG_TRACE_SINK is not set<br />
+CONFIG_LPD8806=m<br />
CONFIG_DEVKMEM=y<br />
<br />
#<br />
It looks like some configuration setting have changed. Since we are getting a new version of the kernel, let's revert back to the previous file and try again.<br />
<br />
host$ '''git checkout patches/defconfig'''<br />
host$ '''git checkout master'''<br />
Switched to branch 'master'<br />
Success, now step 2.<br />
host$ '''git branch -d am33x-v3.8'''<br />
warning: deleting branch 'am33x-v3.8' that has been merged to<br />
'refs/remotes/origin/am33x-v3.8', but not yet merged to HEAD.<br />
Deleted branch am33x-v3.8 (was 3fc8a73).<br />
Now repull<br />
host$ '''git pull'''<br />
Then start over again<br />
host$ '''git checkout origin/am33x-v3.8 -b am33x-v3.8'''<br />
Branch am33x-v3.8 set up to track remote branch am33x-v3.8 from origin.<br />
Switched to a new branch 'am33x-v3.8'<br />
Your '''system.sh''' file should be unchanged, so start building<br />
host$ '''./build_kernel.sh'''<br />
Mine took some 26 minutes on an 8 core machine.<br />
<br />
== Recovering ==<br />
If your Beagle fails to boot, follow the [[EBC_Exercise_22_Recovering]] instructions to recover.<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_08_Installing_Development_Tools_4.4&diff=580489EBC Exercise 08 Installing Development Tools 4.42023-12-19T15:46:44Z<p>Yoder: /* Getting the 5.x Kernel */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
Early in the class most of the exercises we will do will all run on the BeagleBoard. You'll be able to edit ([https://aws.amazon.com/cloud9/ cloud9]), compile ([http://gcc.gnu.org/ gcc]) and run all on the Beagle. Later, when we start compiling the [http://www.kernel.org/ kernel] or the boot loader, ([http://www.denx.de/wiki/U-Boot U-boot]) you will need to cross compile on a Linux machine and copy the results to the Beagle.<br />
<br />
The purpose of this exercise is to install all the tools needed for compiling on your host so they will be ready when you need them.<br />
<br />
'''Tip:''' Run this exercise using a wired connection if you can. The Ubuntu wireless driver can be finicky, and if it stops working you'll have to restart some of this.<br />
<br />
== The 5.x Kernel ==<br />
<br />
=== Getting the 5.x Kernel ===<br />
<br />
These notes taken from [http://www.youtube.com/watch?v=HJ9nUqYMjqs&t=4m10s Beaglebone: Adding USB Wi-Fi & Building a Linux Kernel] starting around 4 minutes and ending around 21 minutes. Uses kernel from [http://eewiki.net/display/linuxonarm/BeagleBone+Black Robert C. Nelson's BeagleBone Black] page.<br />
<br />
host$ '''git clone git@git.beagleboard.org:RobertCNelson/ti-linux-kernel-dev.git''' (65M)<br />
host$ '''cd ti-linux-kernel-dev'''<br />
<br />
host$ '''git tag | wc'''<br />
1857 1857 32406<br />
The last command lists all the versions of the kernel that are available and counts them. There are over 1700 versions!<br />
Let's narrow it a bit.<br />
host$ '''git tag | grep 5.10.168'''<br />
5.10.168-ti-arm64-r100<br />
5.10.168-ti-arm64-r101<br />
...<br />
5.10.168-ti-arm64-r112<br />
5.10.168-ti-arm64-r113<br />
5.10.168-ti-r60<br />
5.10.168-ti-r61<br />
...<br />
5.10.168-ti-r69<br />
5.10.168-ti-r70<br />
5.10.168-ti-r71<br />
5.10.168-ti-r72<br />
5.10.168-ti-r73<br />
5.10.168-ti-r74<br />
5.10.168-ti-rt-r60<br />
5.10.168-ti-rt-r61<br />
...<br />
5.10.168-ti-rt-r69<br />
5.10.168-ti-rt-r70<br />
5.10.168-ti-rt-r71<br />
5.10.168-ti-rt-r72<br />
5.10.168-ti-rt-r73<br />
5.10.168-ti-rt-r74 <br />
Pick one and check it out. I usually pick the one with the highest<br />
version number not equal to the version I'm running.<br />
host$ '''git checkout 5.10.168-ti-r74 -b 5.10.168-ti-r74'''<br />
Switched to a new branch '5.10.168-ti-r74'<br />
<br />
Now at this point you have a choice, you can run '''./build_kernel.sh'''<br />
and build the kernel, or run '''./build_deb.sh''' which will also build<br />
the kernel, but it will combine all the output files in<br />
one '''.deb''' install file. I suggest running '''./build_deb.sh''',<br />
<br />
host$ '''./build_deb.sh'''<br />
+ Detected build host [Ubuntu 22.04.3 LTS]<br />
+ host: [x86_64]<br />
+ git HEAD commit: [1f23d7ca554505f54938ba393020c50b2ed9ced2]<br />
-----------------------------<br />
cpio: cpio (GNU cpio) 2.13<br />
You're missing command lz4<br />
Please install missing commands<br />
-----------------------------<br />
<br />
You ''may'' need to install some additional files. Run the suggested commands.<br />
<br />
host$ '''sudo apt update'''<br />
host$ '''sudo apt install lzop'''<br />
host$ '''./build_deb.sh'''<br />
+ Detected build host [Ubuntu 20.04.1 LTS]<br />
+ host: [x86_64]<br />
+ git HEAD commit: [a7ff6610037f33b2a8c19d7f111cf9e43aa3c4ef]<br />
-----------------------------<br />
cpio: cpio (GNU cpio) 2.13<br />
lzop: lzop 1.04<br />
Debian/Ubuntu/Mint: missing dependencies, please install:<br />
-----------------------------<br />
sudo apt-get update<br />
sudo apt-get install build-essential fakeroot lzma gettext bison flex pkg-config libmpc-dev u-boot-tools libncurses5-dev:amd64<br />
libssl-dev:amd64 <br />
-----------------------------<br />
* Failed dependency check<br />
<br />
host$ '''sudo apt-get install build-essential fakeroot lzma gettext bison flex pkg-config libmpc-dev u-boot-tools libncurses5-dev:amd64 libssl-dev:amd64 libssl-dev:amd64'''<br />
<br />
Then run again.<br />
host$ '''./build_deb.sh'''<br />
+ Detected build host [Ubuntu 22.04.3 LTS]<br />
+ host: [x86_64]<br />
+ git HEAD commit: [1f23d7ca554505f54938ba393020c50b2ed9ced2]<br />
-----------------------------<br />
cpio: cpio (GNU cpio) 2.13<br />
lz4: *** LZ4 command line interface 64-bits v1.9.3, by Yann Collet ***<br />
'/home/yoder/ti-linux-kernel-dev/system.sh.sample' -> '/home/yoder/ti-linux-kernel-dev/system.sh'<br />
glibc: 2.35<br />
Installing Toolchain: gcc_10_arm<br />
<br />
At this point the scripts are downloading the cross compiler, the kernel sources and anything else you need to compile the kernel for the bone.<br />
<br />
=== Building the 5.x Kernel ===<br />
At some point you will see<br />
<br />
[[File:KernelConfig2.png]]<br />
<br />
Hit the right arrow to select '''Exit''' and then hit ENTER. The compilation will continue.<br />
<br />
=== Installing the Kernel on Your Bone ===<br />
The following are three ways you can use to install a new kernel on your Bone. <br />
The first method works if you ran '''build_deb.sh'''.<br />
<br />
The other two methods are used if you ran '''build_kernel.sh'''<br />
<br />
You only need to use one method. If you ran '''build_kernel.sh''' <br />
I suggest you use the second one since you don't have to remove the SD card from the bone.<br />
<br />
==== Installing the kernel package - build_deb.sh ====<br />
The '''./build_deb.sh''' script creates a single '''.deb''' file that contains<br />
all the files needed for the new kernel. You find it here:<br />
host$ '''cd ti-linux-kernel-dev/deploy'''<br />
host$ '''ls -sh'''<br />
total 40M<br />
7.3M linux-headers-5.8.11-bone17_1xross_armhf.deb 8.0K linux-upstream_1xross_armhf.buildinfo<br />
31M linux-image-5.8.11-bone17_1xross_armhf.deb 4.0K linux-upstream_1xross_armhf.changes<br />
1.1M linux-libc-dev_1xross_armhf.deb<br />
<br />
The '''linux-image-''' file is the one we want. It contains nearly 3000 files.<br />
host$ '''dpkg -c linux-image-5.8.11-bone17_1xross_armhf.deb | wc<br />
2981 17886 342664<br />
The dpkg command lists all the files in the .deb file and the '''wc''' counts<br />
all the lines in the output. You can see those files with:<br />
bone$ '''dpkg -c linux-image-5.8.11-bone17_1xross_armhf.deb | less'''<br />
drwxr-xr-x root/root 0 2020-09-29 14:16 ./<br />
drwxr-xr-x root/root 0 2020-09-29 14:16 ./boot/<br />
-rw-r--r-- root/root 4285674 2020-09-29 14:16 ./boot/System.map-5.8.11-bone17<br />
-rw-r--r-- root/root 182474 2020-09-29 14:16 ./boot/config-5.8.11-bone17<br />
drwxr-xr-x root/root 0 2020-09-29 14:16 ./boot/dtbs/<br />
drwxr-xr-x root/root 0 2020-09-29 14:16 ./boot/dtbs/5.8.11-bone17/<br />
-rwxr-xr-x root/root 87267 2020-09-29 14:16 ./boot/dtbs/5.8.11-bone17/am335x-abbbi.dtb<br />
-rwxr-xr-x root/root 86826 2020-09-29 14:16 ./boot/dtbs/5.8.11-bone17/am335x-baltos-ir2110.dtb<br />
-rwxr-xr-x root/root 87544 2020-09-29 14:16 ./boot/dtbs/5.8.11-bone17/am335x-baltos-ir3220.dtb<br />
You can see it's putting things in the '''/boot''' directory.<br />
<br />
Note: You can also look into the other two .deb files and see what they install.<br />
<br />
Move the '''linux-image-''' file to your Bone.<br />
host$ '''scp linux-image-5.8.11-bone17_1xross_armhf.deb bone:.'''<br />
<br />
Hint: You might have to add '''-P<port>''' if you changed your port number.<br />
You might have to use debian@192.168.7.2 for bone if you haven't set everything up.<br />
<br />
Now ssh to the bone.<br />
host$ '''ssh bone'''<br />
bone$ '''ls -sh'''<br />
bin exercises linux-image-5.8.11-bone17_1xross_armhf.deb<br />
Now install it.<br />
bone$ '''sudo dpkg --install linux-image-5.8.11-bone17_1xross_armhf.deb'''<br />
Wait a while. Once done check /boot.<br />
bone$ '''ls -sh /boot'''<br />
total 40M<br />
160K config-4.19.94-ti-r50 4.0K SOC.sh 4.0K uEnv.txt.orig<br />
180K config-5.8.11-bone17 3.5M System.map-4.19.94-ti-r50 9.7M vmlinuz-4.19.94-ti-r50<br />
4.0K dtbs 4.1M System.map-5.8.11-bone17 8.6M vmlinuz-5.8.11-bone17<br />
6.4M initrd.img-4.19.94-ti-r50 4.0K uboot<br />
6.8M initrd.img-5.8.11-bone17 4.0K uEnv.txt<br />
You see the new kernel files. Check uEnv.txt.<br />
bone$ '''head /boot/uEnv.txt'''<br />
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0<br />
# uname_r=4.19.94-ti-r50<br />
uname_r=5.8.11-bone17<br />
I added the commented out '''uname_r''' line to make it easy to switch between<br />
versions of the kernel.<br />
<br />
Reboot and test out the new kernel.<br />
bone$ '''sudo reboot'''<br />
<br />
==== Copying to SD card on a running Bone - build_kernel.sh====<br />
You can stop here if you've just finished the build_deb.sh method of installing the kernel.<br />
<br />
The Bone can have multiple versions of the kernel installed on it. <br />
It's possible to update the kernel on the Bone while it's running. <br />
After compiling on the host you need to install sshfs (you only need to do this once).<br />
<br />
host$ '''sudo apt install sshfs '''<br />
<br />
Then copy '''may_install_kernel.sh''' to the bb-kernel directory.<br />
host$ '''cd ~/BeagleBoard/bb-kernel'''<br />
host$ '''cp ~/BeagleBoard/exercises/linux/kernel/may_install_kernel.sh tools'''<br />
Now you can install the files using the following. Note, you must run '''may_install_kernel.sh''' from the directory above as shown.<br />
host$ '''tools/may_install_kernel.sh'''<br />
Mounting sshfs<br />
-----------------------------<br />
sshfs mounted<br />
Installing 4.4.15-bone11 to sshfs<br />
‘/home/yoder/BeagleBoard/bb-kernel/deploy/4.4.15-bone11.zImage’ -> ‘/home/yoder/BeagleBoard/bb-kernel/deploy/disk/zImage’<br />
Installing 4.4.15-bone11-dtbs.tar.gz to sshfs<br />
Installing 4.4.15-bone11 to sshfs<br />
‘/home/yoder/BeagleBoard/bb-kernel/deploy/4.4.15-bone11.zImage’ -> ‘/home/yoder/BeagleBoard/bb-kernel/deploy/disk/boot/vmlinuz-4.4.15-bone11’<br />
Installing 4.4.15-bone11-dtbs.tar.gz to sshfs<br />
info: /boot/uEnv.txt: uname_r=4.4.15-bone11<br />
Installing 4.4.15-bone11-modules.tar.gz to sshfs<br />
tar: ./lib/modules/4.4.15-bone11/build: Cannot utime: No such file or directory<br />
tar: ./lib/modules/4.4.15-bone11/source: Cannot utime: No such file or directory<br />
tar: Exiting with failure status due to previous errors<br />
‘/home/yoder/BeagleBoard/bb-kernel/deploy/config-4.4.15-bone11’ -> ‘/home/yoder/BeagleBoard/bb-kernel/deploy/disk/boot/config-4.4.15-bone11’<br />
info: [4.4.15-bone11] now installed...<br />
You may see about couple of error messages about ''build'' and ''source'', but it seems to work anyway.<br />
If you look in /boot/uEvt.txt, you'll see it's ready to boot your new kernel.<br />
bone$ '''head -3 /boot/uEnv.txt'''<br />
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0<br />
<br />
uname_r=4.4.15-bone11<br />
If you change your mind about which kernel to boot, just edit the '''uname''' line.<br />
<br />
==== Copying to the SD Card on Host - build_kernel.sh====<br />
You can also install the kernel on an SD card that is mounted on your host computer. Plug it into your host and machine and run:<br />
host$ '''tools/install_kernel.sh'''<br />
<br />
This works like the '''may_install_kernel.sh''', but it copies it to local host. Once copied, eject the SD card and plug it into your Bone and boot.<br />
<br />
=== Updating to a new version of the kernel ===<br />
<br />
When you build your kernel the uImage file has some version information in the name. For example '''vmlinuz-4.4.21-ti-r47'''. The '''4.4.21''' is the version of the kernel and the '''-ti-r47''' is the version of the patches applied to the kernel for the BeagleBone. Over time new patches will be posted. These instructions show how to get the latest version.<br />
<br />
How do you know if you have the latest version? Run<br />
bone$ '''uname -a'''<br />
Linux yoder-debian-bone 4.4.21-ti-r47 #1 SMP Fri Sep 23 22:23:02 UTC 2016 armv7l GNU/Linux<br />
<br />
This [https://groups.google.com/forum/#!topic/beagleboard/D3wRnulVE1I post to the Google Group] lists the steps as "You need to recheckout master, delete your old branch and re-pull". Here's how you do it.<br />
<br />
host$ '''cd linux-dev'''<br />
host$ '''git checkout master'''<br />
error: Your local changes to the following files would be overwritten by checkout:<br />
patches/defconfig<br />
Please, commit your changes or stash them before you can switch branches.<br />
Aborting<br />
Hmm.... something has changed. See what it is.<br />
host$ '''git diff patches/defconfig'''<br />
diff --git a/patches/defconfig b/patches/defconfig<br />
index d903776..3268287 100644<br />
--- a/patches/defconfig<br />
+++ b/patches/defconfig<br />
@@ -2041,6 +2041,7 @@ CONFIG_JHD629_I2C=y<br />
# CONFIG_SERIAL_NONSTANDARD is not set<br />
# CONFIG_N_GSM is not set<br />
# CONFIG_TRACE_SINK is not set<br />
+CONFIG_LPD8806=m<br />
CONFIG_DEVKMEM=y<br />
<br />
#<br />
It looks like some configuration setting have changed. Since we are getting a new version of the kernel, let's revert back to the previous file and try again.<br />
<br />
host$ '''git checkout patches/defconfig'''<br />
host$ '''git checkout master'''<br />
Switched to branch 'master'<br />
Success, now step 2.<br />
host$ '''git branch -d am33x-v3.8'''<br />
warning: deleting branch 'am33x-v3.8' that has been merged to<br />
'refs/remotes/origin/am33x-v3.8', but not yet merged to HEAD.<br />
Deleted branch am33x-v3.8 (was 3fc8a73).<br />
Now repull<br />
host$ '''git pull'''<br />
Then start over again<br />
host$ '''git checkout origin/am33x-v3.8 -b am33x-v3.8'''<br />
Branch am33x-v3.8 set up to track remote branch am33x-v3.8 from origin.<br />
Switched to a new branch 'am33x-v3.8'<br />
Your '''system.sh''' file should be unchanged, so start building<br />
host$ '''./build_kernel.sh'''<br />
Mine took some 26 minutes on an 8 core machine.<br />
<br />
== Recovering ==<br />
If your Beagle fails to boot, follow the [[EBC_Exercise_22_Recovering]] instructions to recover.<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_08_Installing_Development_Tools_4.4&diff=580486EBC Exercise 08 Installing Development Tools 4.42023-12-19T15:24:10Z<p>Yoder: /* Getting the 5.x Kernel */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
Early in the class most of the exercises we will do will all run on the BeagleBoard. You'll be able to edit ([https://aws.amazon.com/cloud9/ cloud9]), compile ([http://gcc.gnu.org/ gcc]) and run all on the Beagle. Later, when we start compiling the [http://www.kernel.org/ kernel] or the boot loader, ([http://www.denx.de/wiki/U-Boot U-boot]) you will need to cross compile on a Linux machine and copy the results to the Beagle.<br />
<br />
The purpose of this exercise is to install all the tools needed for compiling on your host so they will be ready when you need them.<br />
<br />
'''Tip:''' Run this exercise using a wired connection if you can. The Ubuntu wireless driver can be finicky, and if it stops working you'll have to restart some of this.<br />
<br />
== The 5.x Kernel ==<br />
<br />
=== Getting the 5.x Kernel ===<br />
<br />
These notes taken from [http://www.youtube.com/watch?v=HJ9nUqYMjqs&t=4m10s Beaglebone: Adding USB Wi-Fi & Building a Linux Kernel] starting around 4 minutes and ending around 21 minutes. Uses kernel from [http://eewiki.net/display/linuxonarm/BeagleBone+Black Robert C. Nelson's BeagleBone Black] page.<br />
<br />
host$ '''git clone git@git.beagleboard.org:RobertCNelson/ti-linux-kernel-dev.git''' (65M)<br />
host$ '''cd ti-linux-kernel-dev'''<br />
<br />
host$ '''git tag | wc'''<br />
1857 1857 32406<br />
The last command lists all the versions of the kernel that are available and counts them. There are over 1700 versions!<br />
Let's narrow it a bit.<br />
host$ '''git tag | grep 5.10.145'''<br />
5.10.168-ti-arm64-r100<br />
5.10.168-ti-arm64-r101<br />
...<br />
5.10.168-ti-arm64-r112<br />
5.10.168-ti-arm64-r113<br />
5.10.168-ti-r60<br />
5.10.168-ti-r61<br />
...<br />
5.10.168-ti-r69<br />
5.10.168-ti-r70<br />
5.10.168-ti-r71<br />
5.10.168-ti-r72<br />
5.10.168-ti-r73<br />
5.10.168-ti-r74<br />
5.10.168-ti-rt-r60<br />
5.10.168-ti-rt-r61<br />
...<br />
5.10.168-ti-rt-r69<br />
5.10.168-ti-rt-r70<br />
5.10.168-ti-rt-r71<br />
5.10.168-ti-rt-r72<br />
5.10.168-ti-rt-r73<br />
5.10.168-ti-rt-r74 <br />
Pick one and check it out. I usually pick the one with the highest<br />
version number not equal to the version I'm running.<br />
host$ '''git checkout 5.10.168-ti-r74 -b 5.10.168-ti-r74'''<br />
Switched to a new branch '5.10.168-ti-r74'<br />
<br />
Now at this point you have a choice, you can run '''./build_kernel.sh'''<br />
and build the kernel, or run '''./build_deb.sh''' which will also build<br />
the kernel, but it will combine all the output files in<br />
one '''.deb''' install file. I suggest running '''./build_deb.sh''',<br />
<br />
host$ '''./build_deb.sh'''<br />
+ Detected build host [Ubuntu 22.04.3 LTS]<br />
+ host: [x86_64]<br />
+ git HEAD commit: [1f23d7ca554505f54938ba393020c50b2ed9ced2]<br />
-----------------------------<br />
cpio: cpio (GNU cpio) 2.13<br />
You're missing command lz4<br />
Please install missing commands<br />
-----------------------------<br />
<br />
You ''may'' need to install some additional files. Run the suggested commands.<br />
<br />
host$ '''sudo apt update'''<br />
host$ '''sudo apt install lzop'''<br />
host$ '''./build_deb.sh'''<br />
+ Detected build host [Ubuntu 20.04.1 LTS]<br />
+ host: [x86_64]<br />
+ git HEAD commit: [a7ff6610037f33b2a8c19d7f111cf9e43aa3c4ef]<br />
-----------------------------<br />
cpio: cpio (GNU cpio) 2.13<br />
lzop: lzop 1.04<br />
Debian/Ubuntu/Mint: missing dependencies, please install:<br />
-----------------------------<br />
sudo apt-get update<br />
sudo apt-get install build-essential fakeroot lzma gettext bison flex pkg-config libmpc-dev u-boot-tools libncurses5-dev:amd64<br />
libssl-dev:amd64 <br />
-----------------------------<br />
* Failed dependency check<br />
<br />
host$ '''sudo apt-get install build-essential fakeroot lzma gettext bison flex pkg-config libmpc-dev u-boot-tools libncurses5-dev:amd64 libssl-dev:amd64 libssl-dev:amd64'''<br />
<br />
Then run again.<br />
host$ '''./build_deb.sh'''<br />
+ Detected build host [Ubuntu 22.04.3 LTS]<br />
+ host: [x86_64]<br />
+ git HEAD commit: [1f23d7ca554505f54938ba393020c50b2ed9ced2]<br />
-----------------------------<br />
cpio: cpio (GNU cpio) 2.13<br />
lz4: *** LZ4 command line interface 64-bits v1.9.3, by Yann Collet ***<br />
'/home/yoder/ti-linux-kernel-dev/system.sh.sample' -> '/home/yoder/ti-linux-kernel-dev/system.sh'<br />
glibc: 2.35<br />
Installing Toolchain: gcc_10_arm<br />
<br />
At this point the scripts are downloading the cross compiler, the kernel sources and anything else you need to compile the kernel for the bone.<br />
<br />
=== Building the 5.x Kernel ===<br />
At some point you will see<br />
<br />
[[File:KernelConfig2.png]]<br />
<br />
Hit the right arrow to select '''Exit''' and then hit ENTER. The compilation will continue.<br />
<br />
=== Installing the Kernel on Your Bone ===<br />
The following are three ways you can use to install a new kernel on your Bone. <br />
The first method works if you ran '''build_deb.sh'''.<br />
<br />
The other two methods are used if you ran '''build_kernel.sh'''<br />
<br />
You only need to use one method. If you ran '''build_kernel.sh''' <br />
I suggest you use the second one since you don't have to remove the SD card from the bone.<br />
<br />
==== Installing the kernel package - build_deb.sh ====<br />
The '''./build_deb.sh''' script creates a single '''.deb''' file that contains<br />
all the files needed for the new kernel. You find it here:<br />
host$ '''cd ti-linux-kernel-dev/deploy'''<br />
host$ '''ls -sh'''<br />
total 40M<br />
7.3M linux-headers-5.8.11-bone17_1xross_armhf.deb 8.0K linux-upstream_1xross_armhf.buildinfo<br />
31M linux-image-5.8.11-bone17_1xross_armhf.deb 4.0K linux-upstream_1xross_armhf.changes<br />
1.1M linux-libc-dev_1xross_armhf.deb<br />
<br />
The '''linux-image-''' file is the one we want. It contains nearly 3000 files.<br />
host$ '''dpkg -c linux-image-5.8.11-bone17_1xross_armhf.deb | wc<br />
2981 17886 342664<br />
The dpkg command lists all the files in the .deb file and the '''wc''' counts<br />
all the lines in the output. You can see those files with:<br />
bone$ '''dpkg -c linux-image-5.8.11-bone17_1xross_armhf.deb | less'''<br />
drwxr-xr-x root/root 0 2020-09-29 14:16 ./<br />
drwxr-xr-x root/root 0 2020-09-29 14:16 ./boot/<br />
-rw-r--r-- root/root 4285674 2020-09-29 14:16 ./boot/System.map-5.8.11-bone17<br />
-rw-r--r-- root/root 182474 2020-09-29 14:16 ./boot/config-5.8.11-bone17<br />
drwxr-xr-x root/root 0 2020-09-29 14:16 ./boot/dtbs/<br />
drwxr-xr-x root/root 0 2020-09-29 14:16 ./boot/dtbs/5.8.11-bone17/<br />
-rwxr-xr-x root/root 87267 2020-09-29 14:16 ./boot/dtbs/5.8.11-bone17/am335x-abbbi.dtb<br />
-rwxr-xr-x root/root 86826 2020-09-29 14:16 ./boot/dtbs/5.8.11-bone17/am335x-baltos-ir2110.dtb<br />
-rwxr-xr-x root/root 87544 2020-09-29 14:16 ./boot/dtbs/5.8.11-bone17/am335x-baltos-ir3220.dtb<br />
You can see it's putting things in the '''/boot''' directory.<br />
<br />
Note: You can also look into the other two .deb files and see what they install.<br />
<br />
Move the '''linux-image-''' file to your Bone.<br />
host$ '''scp linux-image-5.8.11-bone17_1xross_armhf.deb bone:.'''<br />
<br />
Hint: You might have to add '''-P<port>''' if you changed your port number.<br />
You might have to use debian@192.168.7.2 for bone if you haven't set everything up.<br />
<br />
Now ssh to the bone.<br />
host$ '''ssh bone'''<br />
bone$ '''ls -sh'''<br />
bin exercises linux-image-5.8.11-bone17_1xross_armhf.deb<br />
Now install it.<br />
bone$ '''sudo dpkg --install linux-image-5.8.11-bone17_1xross_armhf.deb'''<br />
Wait a while. Once done check /boot.<br />
bone$ '''ls -sh /boot'''<br />
total 40M<br />
160K config-4.19.94-ti-r50 4.0K SOC.sh 4.0K uEnv.txt.orig<br />
180K config-5.8.11-bone17 3.5M System.map-4.19.94-ti-r50 9.7M vmlinuz-4.19.94-ti-r50<br />
4.0K dtbs 4.1M System.map-5.8.11-bone17 8.6M vmlinuz-5.8.11-bone17<br />
6.4M initrd.img-4.19.94-ti-r50 4.0K uboot<br />
6.8M initrd.img-5.8.11-bone17 4.0K uEnv.txt<br />
You see the new kernel files. Check uEnv.txt.<br />
bone$ '''head /boot/uEnv.txt'''<br />
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0<br />
# uname_r=4.19.94-ti-r50<br />
uname_r=5.8.11-bone17<br />
I added the commented out '''uname_r''' line to make it easy to switch between<br />
versions of the kernel.<br />
<br />
Reboot and test out the new kernel.<br />
bone$ '''sudo reboot'''<br />
<br />
==== Copying to SD card on a running Bone - build_kernel.sh====<br />
You can stop here if you've just finished the build_deb.sh method of installing the kernel.<br />
<br />
The Bone can have multiple versions of the kernel installed on it. <br />
It's possible to update the kernel on the Bone while it's running. <br />
After compiling on the host you need to install sshfs (you only need to do this once).<br />
<br />
host$ '''sudo apt install sshfs '''<br />
<br />
Then copy '''may_install_kernel.sh''' to the bb-kernel directory.<br />
host$ '''cd ~/BeagleBoard/bb-kernel'''<br />
host$ '''cp ~/BeagleBoard/exercises/linux/kernel/may_install_kernel.sh tools'''<br />
Now you can install the files using the following. Note, you must run '''may_install_kernel.sh''' from the directory above as shown.<br />
host$ '''tools/may_install_kernel.sh'''<br />
Mounting sshfs<br />
-----------------------------<br />
sshfs mounted<br />
Installing 4.4.15-bone11 to sshfs<br />
‘/home/yoder/BeagleBoard/bb-kernel/deploy/4.4.15-bone11.zImage’ -> ‘/home/yoder/BeagleBoard/bb-kernel/deploy/disk/zImage’<br />
Installing 4.4.15-bone11-dtbs.tar.gz to sshfs<br />
Installing 4.4.15-bone11 to sshfs<br />
‘/home/yoder/BeagleBoard/bb-kernel/deploy/4.4.15-bone11.zImage’ -> ‘/home/yoder/BeagleBoard/bb-kernel/deploy/disk/boot/vmlinuz-4.4.15-bone11’<br />
Installing 4.4.15-bone11-dtbs.tar.gz to sshfs<br />
info: /boot/uEnv.txt: uname_r=4.4.15-bone11<br />
Installing 4.4.15-bone11-modules.tar.gz to sshfs<br />
tar: ./lib/modules/4.4.15-bone11/build: Cannot utime: No such file or directory<br />
tar: ./lib/modules/4.4.15-bone11/source: Cannot utime: No such file or directory<br />
tar: Exiting with failure status due to previous errors<br />
‘/home/yoder/BeagleBoard/bb-kernel/deploy/config-4.4.15-bone11’ -> ‘/home/yoder/BeagleBoard/bb-kernel/deploy/disk/boot/config-4.4.15-bone11’<br />
info: [4.4.15-bone11] now installed...<br />
You may see about couple of error messages about ''build'' and ''source'', but it seems to work anyway.<br />
If you look in /boot/uEvt.txt, you'll see it's ready to boot your new kernel.<br />
bone$ '''head -3 /boot/uEnv.txt'''<br />
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0<br />
<br />
uname_r=4.4.15-bone11<br />
If you change your mind about which kernel to boot, just edit the '''uname''' line.<br />
<br />
==== Copying to the SD Card on Host - build_kernel.sh====<br />
You can also install the kernel on an SD card that is mounted on your host computer. Plug it into your host and machine and run:<br />
host$ '''tools/install_kernel.sh'''<br />
<br />
This works like the '''may_install_kernel.sh''', but it copies it to local host. Once copied, eject the SD card and plug it into your Bone and boot.<br />
<br />
=== Updating to a new version of the kernel ===<br />
<br />
When you build your kernel the uImage file has some version information in the name. For example '''vmlinuz-4.4.21-ti-r47'''. The '''4.4.21''' is the version of the kernel and the '''-ti-r47''' is the version of the patches applied to the kernel for the BeagleBone. Over time new patches will be posted. These instructions show how to get the latest version.<br />
<br />
How do you know if you have the latest version? Run<br />
bone$ '''uname -a'''<br />
Linux yoder-debian-bone 4.4.21-ti-r47 #1 SMP Fri Sep 23 22:23:02 UTC 2016 armv7l GNU/Linux<br />
<br />
This [https://groups.google.com/forum/#!topic/beagleboard/D3wRnulVE1I post to the Google Group] lists the steps as "You need to recheckout master, delete your old branch and re-pull". Here's how you do it.<br />
<br />
host$ '''cd linux-dev'''<br />
host$ '''git checkout master'''<br />
error: Your local changes to the following files would be overwritten by checkout:<br />
patches/defconfig<br />
Please, commit your changes or stash them before you can switch branches.<br />
Aborting<br />
Hmm.... something has changed. See what it is.<br />
host$ '''git diff patches/defconfig'''<br />
diff --git a/patches/defconfig b/patches/defconfig<br />
index d903776..3268287 100644<br />
--- a/patches/defconfig<br />
+++ b/patches/defconfig<br />
@@ -2041,6 +2041,7 @@ CONFIG_JHD629_I2C=y<br />
# CONFIG_SERIAL_NONSTANDARD is not set<br />
# CONFIG_N_GSM is not set<br />
# CONFIG_TRACE_SINK is not set<br />
+CONFIG_LPD8806=m<br />
CONFIG_DEVKMEM=y<br />
<br />
#<br />
It looks like some configuration setting have changed. Since we are getting a new version of the kernel, let's revert back to the previous file and try again.<br />
<br />
host$ '''git checkout patches/defconfig'''<br />
host$ '''git checkout master'''<br />
Switched to branch 'master'<br />
Success, now step 2.<br />
host$ '''git branch -d am33x-v3.8'''<br />
warning: deleting branch 'am33x-v3.8' that has been merged to<br />
'refs/remotes/origin/am33x-v3.8', but not yet merged to HEAD.<br />
Deleted branch am33x-v3.8 (was 3fc8a73).<br />
Now repull<br />
host$ '''git pull'''<br />
Then start over again<br />
host$ '''git checkout origin/am33x-v3.8 -b am33x-v3.8'''<br />
Branch am33x-v3.8 set up to track remote branch am33x-v3.8 from origin.<br />
Switched to a new branch 'am33x-v3.8'<br />
Your '''system.sh''' file should be unchanged, so start building<br />
host$ '''./build_kernel.sh'''<br />
Mine took some 26 minutes on an 8 core machine.<br />
<br />
== Recovering ==<br />
If your Beagle fails to boot, follow the [[EBC_Exercise_22_Recovering]] instructions to recover.<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_08_Installing_Development_Tools_4.4&diff=580483EBC Exercise 08 Installing Development Tools 4.42023-12-19T15:07:00Z<p>Yoder: /* Getting the 5.x Kernel */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
Early in the class most of the exercises we will do will all run on the BeagleBoard. You'll be able to edit ([https://aws.amazon.com/cloud9/ cloud9]), compile ([http://gcc.gnu.org/ gcc]) and run all on the Beagle. Later, when we start compiling the [http://www.kernel.org/ kernel] or the boot loader, ([http://www.denx.de/wiki/U-Boot U-boot]) you will need to cross compile on a Linux machine and copy the results to the Beagle.<br />
<br />
The purpose of this exercise is to install all the tools needed for compiling on your host so they will be ready when you need them.<br />
<br />
'''Tip:''' Run this exercise using a wired connection if you can. The Ubuntu wireless driver can be finicky, and if it stops working you'll have to restart some of this.<br />
<br />
== The 5.x Kernel ==<br />
<br />
=== Getting the 5.x Kernel ===<br />
<br />
These notes taken from [http://www.youtube.com/watch?v=HJ9nUqYMjqs&t=4m10s Beaglebone: Adding USB Wi-Fi & Building a Linux Kernel] starting around 4 minutes and ending around 21 minutes. Uses kernel from [http://eewiki.net/display/linuxonarm/BeagleBone+Black Robert C. Nelson's BeagleBone Black] page.<br />
<br />
host$ '''git clone git@git.beagleboard.org:RobertCNelson/ti-linux-kernel-dev.git''' (42M)<br />
host$ '''cd ti-linux-kernel-dev'''<br />
<br />
host$ '''git tag | wc'''<br />
1731 1731 30033<br />
The last command lists all the versions of the kernel that are available and counts them. There are over 1700 versions!<br />
Let's narrow it a bit.<br />
host$ '''git tag | grep 5.10.145'''<br />
5.10.145-ti-arm64-r71 <br />
5.10.145-ti-arm64-r72 <br />
5.10.145-ti-arm64-r73 <br />
5.10.145-ti-arm64-r74 <br />
5.10.145-ti-arm64-r75 <br />
5.10.145-ti-arm64-r76 <br />
5.10.145-ti-arm64-r77 <br />
5.10.145-ti-arm64-r78 <br />
5.10.145-ti-r53 <br />
5.10.145-ti-r54 <br />
5.10.145-ti-r55 <br />
5.10.145-ti-rt-r53 <br />
5.10.145-ti-rt-r54 <br />
5.10.145-ti-rt-r55 <br />
Pick one and check it out. I usually pick the one with the highest<br />
version number not equal to the version I'm running.<br />
host$ '''git checkout 5.10.145-ti-r55 -b 5.10.145-ti-r55'''<br />
Switched to a new branch '5.10.145-ti-r55'<br />
<br />
Now at this point you have a choice, you can run '''./build_kernel.sh'''<br />
and build the kernel, or run '''./build_deb.sh''' which will also build<br />
the kernel, but it will combine all the output files in<br />
one '''.deb''' install file. I suggest running '''./build_deb.sh''',<br />
<br />
host$ '''./build_deb.sh'''<br />
+ Detected build host [Ubuntu 22.04.1 LTS]<br />
+ host: [x86_64]<br />
+ git HEAD commit: [238026ea90fe508acc39a3e8a2be938cb6e66e88]<br />
-----------------------------<br />
cpio: cpio (GNU cpio) 2.13<br />
You're missing command lzop<br />
Please install missing commands<br />
-----------------------------<br />
<br />
You ''may'' need to install some additional files. Run the suggested commands.<br />
<br />
host$ '''sudo apt-get update'''<br />
host$ '''sudo apt install lzop'''<br />
host$ '''./build_deb.sh'''<br />
+ Detected build host [Ubuntu 20.04.1 LTS]<br />
+ host: [x86_64]<br />
+ git HEAD commit: [a7ff6610037f33b2a8c19d7f111cf9e43aa3c4ef]<br />
-----------------------------<br />
cpio: cpio (GNU cpio) 2.13<br />
lzop: lzop 1.04<br />
Debian/Ubuntu/Mint: missing dependencies, please install:<br />
-----------------------------<br />
sudo apt-get update<br />
sudo apt-get install build-essential fakeroot lzma gettext bison flex pkg-config libmpc-dev u-boot-tools libncurses5-dev:amd64<br />
libssl-dev:amd64 <br />
-----------------------------<br />
* Failed dependency check<br />
<br />
host$ '''sudo apt-get install build-essential fakeroot lzma gettext bison flex pkg-config libmpc-dev u-boot-tools libncurses5-dev:amd64 libssl-dev:amd64 libssl-dev:amd64'''<br />
<br />
Then run again.<br />
host$ '''./build_deb.sh'''<br />
+ Detected build host [Ubuntu 20.04.1 LTS]<br />
+ host: [x86_64]<br />
+ git HEAD commit: [a7ff6610037f33b2a8c19d7f111cf9e43aa3c4ef]<br />
-----------------------------<br />
cpio: cpio (GNU cpio) 2.13<br />
lzop: lzop 1.04<br />
'/home/mark_a_yoder/BeagleBoard/bb-kernel/system.sh.sample' -> '/home/mark_a_yoder/BeagleBoard/bb-kernel/system.sh'<br />
Installing Toolchain: gcc_arm_gnueabihf_9<br />
-----------------------------<br />
<br />
At this point the scripts are downloading the cross compiler, the kernel sources and anything else you need to compile the kernel for the bone.<br />
<br />
=== Building the 5.x Kernel ===<br />
At some point you will see<br />
<br />
[[File:KernelConfig2.png]]<br />
<br />
Hit the right arrow to select '''Exit''' and then hit ENTER. The compilation will continue.<br />
<br />
=== Installing the Kernel on Your Bone ===<br />
The following are three ways you can use to install a new kernel on your Bone. <br />
The first method works if you ran '''build_deb.sh'''.<br />
<br />
The other two methods are used if you ran '''build_kernel.sh'''<br />
<br />
You only need to use one method. If you ran '''build_kernel.sh''' <br />
I suggest you use the second one since you don't have to remove the SD card from the bone.<br />
<br />
==== Installing the kernel package - build_deb.sh ====<br />
The '''./build_deb.sh''' script creates a single '''.deb''' file that contains<br />
all the files needed for the new kernel. You find it here:<br />
host$ '''cd ti-linux-kernel-dev/deploy'''<br />
host$ '''ls -sh'''<br />
total 40M<br />
7.3M linux-headers-5.8.11-bone17_1xross_armhf.deb 8.0K linux-upstream_1xross_armhf.buildinfo<br />
31M linux-image-5.8.11-bone17_1xross_armhf.deb 4.0K linux-upstream_1xross_armhf.changes<br />
1.1M linux-libc-dev_1xross_armhf.deb<br />
<br />
The '''linux-image-''' file is the one we want. It contains nearly 3000 files.<br />
host$ '''dpkg -c linux-image-5.8.11-bone17_1xross_armhf.deb | wc<br />
2981 17886 342664<br />
The dpkg command lists all the files in the .deb file and the '''wc''' counts<br />
all the lines in the output. You can see those files with:<br />
bone$ '''dpkg -c linux-image-5.8.11-bone17_1xross_armhf.deb | less'''<br />
drwxr-xr-x root/root 0 2020-09-29 14:16 ./<br />
drwxr-xr-x root/root 0 2020-09-29 14:16 ./boot/<br />
-rw-r--r-- root/root 4285674 2020-09-29 14:16 ./boot/System.map-5.8.11-bone17<br />
-rw-r--r-- root/root 182474 2020-09-29 14:16 ./boot/config-5.8.11-bone17<br />
drwxr-xr-x root/root 0 2020-09-29 14:16 ./boot/dtbs/<br />
drwxr-xr-x root/root 0 2020-09-29 14:16 ./boot/dtbs/5.8.11-bone17/<br />
-rwxr-xr-x root/root 87267 2020-09-29 14:16 ./boot/dtbs/5.8.11-bone17/am335x-abbbi.dtb<br />
-rwxr-xr-x root/root 86826 2020-09-29 14:16 ./boot/dtbs/5.8.11-bone17/am335x-baltos-ir2110.dtb<br />
-rwxr-xr-x root/root 87544 2020-09-29 14:16 ./boot/dtbs/5.8.11-bone17/am335x-baltos-ir3220.dtb<br />
You can see it's putting things in the '''/boot''' directory.<br />
<br />
Note: You can also look into the other two .deb files and see what they install.<br />
<br />
Move the '''linux-image-''' file to your Bone.<br />
host$ '''scp linux-image-5.8.11-bone17_1xross_armhf.deb bone:.'''<br />
<br />
Hint: You might have to add '''-P<port>''' if you changed your port number.<br />
You might have to use debian@192.168.7.2 for bone if you haven't set everything up.<br />
<br />
Now ssh to the bone.<br />
host$ '''ssh bone'''<br />
bone$ '''ls -sh'''<br />
bin exercises linux-image-5.8.11-bone17_1xross_armhf.deb<br />
Now install it.<br />
bone$ '''sudo dpkg --install linux-image-5.8.11-bone17_1xross_armhf.deb'''<br />
Wait a while. Once done check /boot.<br />
bone$ '''ls -sh /boot'''<br />
total 40M<br />
160K config-4.19.94-ti-r50 4.0K SOC.sh 4.0K uEnv.txt.orig<br />
180K config-5.8.11-bone17 3.5M System.map-4.19.94-ti-r50 9.7M vmlinuz-4.19.94-ti-r50<br />
4.0K dtbs 4.1M System.map-5.8.11-bone17 8.6M vmlinuz-5.8.11-bone17<br />
6.4M initrd.img-4.19.94-ti-r50 4.0K uboot<br />
6.8M initrd.img-5.8.11-bone17 4.0K uEnv.txt<br />
You see the new kernel files. Check uEnv.txt.<br />
bone$ '''head /boot/uEnv.txt'''<br />
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0<br />
# uname_r=4.19.94-ti-r50<br />
uname_r=5.8.11-bone17<br />
I added the commented out '''uname_r''' line to make it easy to switch between<br />
versions of the kernel.<br />
<br />
Reboot and test out the new kernel.<br />
bone$ '''sudo reboot'''<br />
<br />
==== Copying to SD card on a running Bone - build_kernel.sh====<br />
You can stop here if you've just finished the build_deb.sh method of installing the kernel.<br />
<br />
The Bone can have multiple versions of the kernel installed on it. <br />
It's possible to update the kernel on the Bone while it's running. <br />
After compiling on the host you need to install sshfs (you only need to do this once).<br />
<br />
host$ '''sudo apt install sshfs '''<br />
<br />
Then copy '''may_install_kernel.sh''' to the bb-kernel directory.<br />
host$ '''cd ~/BeagleBoard/bb-kernel'''<br />
host$ '''cp ~/BeagleBoard/exercises/linux/kernel/may_install_kernel.sh tools'''<br />
Now you can install the files using the following. Note, you must run '''may_install_kernel.sh''' from the directory above as shown.<br />
host$ '''tools/may_install_kernel.sh'''<br />
Mounting sshfs<br />
-----------------------------<br />
sshfs mounted<br />
Installing 4.4.15-bone11 to sshfs<br />
‘/home/yoder/BeagleBoard/bb-kernel/deploy/4.4.15-bone11.zImage’ -> ‘/home/yoder/BeagleBoard/bb-kernel/deploy/disk/zImage’<br />
Installing 4.4.15-bone11-dtbs.tar.gz to sshfs<br />
Installing 4.4.15-bone11 to sshfs<br />
‘/home/yoder/BeagleBoard/bb-kernel/deploy/4.4.15-bone11.zImage’ -> ‘/home/yoder/BeagleBoard/bb-kernel/deploy/disk/boot/vmlinuz-4.4.15-bone11’<br />
Installing 4.4.15-bone11-dtbs.tar.gz to sshfs<br />
info: /boot/uEnv.txt: uname_r=4.4.15-bone11<br />
Installing 4.4.15-bone11-modules.tar.gz to sshfs<br />
tar: ./lib/modules/4.4.15-bone11/build: Cannot utime: No such file or directory<br />
tar: ./lib/modules/4.4.15-bone11/source: Cannot utime: No such file or directory<br />
tar: Exiting with failure status due to previous errors<br />
‘/home/yoder/BeagleBoard/bb-kernel/deploy/config-4.4.15-bone11’ -> ‘/home/yoder/BeagleBoard/bb-kernel/deploy/disk/boot/config-4.4.15-bone11’<br />
info: [4.4.15-bone11] now installed...<br />
You may see about couple of error messages about ''build'' and ''source'', but it seems to work anyway.<br />
If you look in /boot/uEvt.txt, you'll see it's ready to boot your new kernel.<br />
bone$ '''head -3 /boot/uEnv.txt'''<br />
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0<br />
<br />
uname_r=4.4.15-bone11<br />
If you change your mind about which kernel to boot, just edit the '''uname''' line.<br />
<br />
==== Copying to the SD Card on Host - build_kernel.sh====<br />
You can also install the kernel on an SD card that is mounted on your host computer. Plug it into your host and machine and run:<br />
host$ '''tools/install_kernel.sh'''<br />
<br />
This works like the '''may_install_kernel.sh''', but it copies it to local host. Once copied, eject the SD card and plug it into your Bone and boot.<br />
<br />
=== Updating to a new version of the kernel ===<br />
<br />
When you build your kernel the uImage file has some version information in the name. For example '''vmlinuz-4.4.21-ti-r47'''. The '''4.4.21''' is the version of the kernel and the '''-ti-r47''' is the version of the patches applied to the kernel for the BeagleBone. Over time new patches will be posted. These instructions show how to get the latest version.<br />
<br />
How do you know if you have the latest version? Run<br />
bone$ '''uname -a'''<br />
Linux yoder-debian-bone 4.4.21-ti-r47 #1 SMP Fri Sep 23 22:23:02 UTC 2016 armv7l GNU/Linux<br />
<br />
This [https://groups.google.com/forum/#!topic/beagleboard/D3wRnulVE1I post to the Google Group] lists the steps as "You need to recheckout master, delete your old branch and re-pull". Here's how you do it.<br />
<br />
host$ '''cd linux-dev'''<br />
host$ '''git checkout master'''<br />
error: Your local changes to the following files would be overwritten by checkout:<br />
patches/defconfig<br />
Please, commit your changes or stash them before you can switch branches.<br />
Aborting<br />
Hmm.... something has changed. See what it is.<br />
host$ '''git diff patches/defconfig'''<br />
diff --git a/patches/defconfig b/patches/defconfig<br />
index d903776..3268287 100644<br />
--- a/patches/defconfig<br />
+++ b/patches/defconfig<br />
@@ -2041,6 +2041,7 @@ CONFIG_JHD629_I2C=y<br />
# CONFIG_SERIAL_NONSTANDARD is not set<br />
# CONFIG_N_GSM is not set<br />
# CONFIG_TRACE_SINK is not set<br />
+CONFIG_LPD8806=m<br />
CONFIG_DEVKMEM=y<br />
<br />
#<br />
It looks like some configuration setting have changed. Since we are getting a new version of the kernel, let's revert back to the previous file and try again.<br />
<br />
host$ '''git checkout patches/defconfig'''<br />
host$ '''git checkout master'''<br />
Switched to branch 'master'<br />
Success, now step 2.<br />
host$ '''git branch -d am33x-v3.8'''<br />
warning: deleting branch 'am33x-v3.8' that has been merged to<br />
'refs/remotes/origin/am33x-v3.8', but not yet merged to HEAD.<br />
Deleted branch am33x-v3.8 (was 3fc8a73).<br />
Now repull<br />
host$ '''git pull'''<br />
Then start over again<br />
host$ '''git checkout origin/am33x-v3.8 -b am33x-v3.8'''<br />
Branch am33x-v3.8 set up to track remote branch am33x-v3.8 from origin.<br />
Switched to a new branch 'am33x-v3.8'<br />
Your '''system.sh''' file should be unchanged, so start building<br />
host$ '''./build_kernel.sh'''<br />
Mine took some 26 minutes on an 8 core machine.<br />
<br />
== Recovering ==<br />
If your Beagle fails to boot, follow the [[EBC_Exercise_22_Recovering]] instructions to recover.<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Reading_a_Rotary_Encoder_via_eQEP&diff=580477EBC Reading a Rotary Encoder via eQEP2023-12-14T20:53:48Z<p>Yoder: /* Wiring the Encoder */</p>
<hr />
<div>[[Category:EmbeddedBeagleClass]]<br />
[[Category:ECE497 |exer35]]<br />
{{YoderHeadDeb}}<br />
<br />
A common way to read a rotational input is with a quadrature encoder such as these rotary encoders from [https://www.sparkfun.com/products/9117 SparkFun] and [http://www.adafruit.com/products/377 Adafruit]. BeagleBone Black has an Enhanced Quadrature Encoder Pulse (eQEP) Module (See section 15.4 of the TRM) that makes reading encoders easy.<br />
<br />
This is updated to use the Linux counter subsystem which was introduced with the 5.2 version of the kernel.<br />
<br />
See https://adafruit-beaglebone-io-python.readthedocs.io/en/latest/Encoder.html for a code example based on Adafruit_BBIO.<br />
<br />
== Wiring the Encoder ==<br />
The encoders we are using have a common lead and two inputs, '''A''' and '''B'''. Wire the common to ground. We'll start using the Bone's eQEP2 since it doesn't conflict with the HDMI. [[EBC_Getting_Exercise_Support_Materials | Derek Molloy's P8/P9 Header chart]] shows eQEP2B_in is on pin P8_11 and eQEP2A_in is on P8_12.<br />
<br />
[[File:RotaryEncoder.jpg]] [[File:RotaryEncoder2.jpg]]<br />
<br />
// Black OR Pocket<br />
// eQEP0: P9.27 and P9.42 OR P1_33 and P2_34<br />
// eQEP1: P8.33 and P8.35<br />
// eQEP2: P8.11 and P8.12 OR P2_24 and P2_33<br />
<br />
// AI<br />
// eQEP1: P8.33 and P8.35<br />
// eQEP2: P8.11 and P8.12 or P9.19 and P9.41<br />
// eQEP3: P8.24 and P8.25 or P9.27 and P9.42<br />
<br />
Let's use eQEP2. First set the pin muxes:<br />
bone$ '''config-pin P8_11 eqep''' <br />
bone$ '''config-pin P8_12 eqep'''<br />
<br />
Then change to the counter directory: (Note, that count2 is because we are using eEQP2.)<br />
bone$ '''cd /sys/bus/counter/devices/counter2/count0'''<br />
bone$ '''ls'''<br />
ceiling enable function_available signal0_action signal1_action<br />
count function name signal0_action_available signal1_action_available<br />
<br />
Set the max range and turn on:<br />
bone$ '''sudo chmod o+w *''' (Only do once. It may not be needed at all.)<br />
bone$ '''echo 1000000 > ceiling'''<br />
bone$ '''echo 1 > enable'''<br />
<br />
Then read count. Try reading then turning the encoder.<br />
bone$ '''cat count'''<br />
2<br />
bone$ '''cat count'''<br />
999998<br />
<br />
== Ignore the rest of this for now==<br />
<br />
== On the Blue ==<br />
<br />
bone$ '''cd /opt/source/rcpy'''<br />
bone$ '''sudo python3 setup.py install'''<br />
<br />
You should then be able to run the python example.<br />
<br />
== Configuring the Encoder (skip) ==<br />
If you are running a current version of Debian on your Bone (3-Mar-2015 or newer), the file for configuring the eQEP are already on your Bone.<br />
<br />
bone$ '''# ls /lib/firmware/ | grep -i qep'''<br />
PyBBIO-eqep0-00A0.dtbo<br />
PyBBIO-eqep1-00A0.dtbo<br />
PyBBIO-eqep2-00A0.dtbo<br />
PyBBIO-eqep2b-00A0.dtbo<br />
<br />
The different '''dtbo''' files configure for different pins.<br />
Get Derek Molloy's P8 and P9 header tables to see what pins are available.<br />
wget https://github.com/derekmolloy/boneDeviceTree/raw/master/docs/BeagleboneBlackP8HeaderTable.pdf<br />
wget https://github.com/derekmolloy/boneDeviceTree/raw/master/docs/BeagleboneBlackP9HeaderTable.pdf<br />
<br />
Open the pdf files and search for '''eqp'''.<br />
'''eQEP2''' looks like a good one, but it appears in two place. Try the first one<br />
bone$ '''export SLOTS=/sys/devices/bone_capemgr.*/slots'''<br />
bone$ '''echo PyBBIO-eqep2 > $SLOTS'''<br />
-bash: echo: write error: File exists<br />
There's a problem. Use '''dmesg''' to see what went wrong.<br />
bone$ '''dmesg | tail'''<br />
# [321550.694044] bone-capemgr bone_capemgr.9: slot #26: Failed verification<br />
# [325272.156839] bone-capemgr bone_capemgr.9: part_number 'PyBBIO-eqep2', version 'N/A'<br />
# [325272.157175] bone-capemgr bone_capemgr.9: slot #27: generic override<br />
# [325272.157484] bone-capemgr bone_capemgr.9: bone: Using override eeprom data at slot 27<br />
# [325272.157539] bone-capemgr bone_capemgr.9: slot #27: 'Override Board Name,00A0,Override Manuf,PyBBIO-eqep2'<br />
# [325272.162296] bone-capemgr bone_capemgr.9: slot #27: Requesting part number/version based 'PyBBIO-eqep2-00A0.dtbo<br />
# [325272.162358] bone-capemgr bone_capemgr.9: slot #27: Requesting firmware 'PyBBIO-eqep2-00A0.dtbo' for board-name 'Override Board Name', version '00A0'<br />
# [325272.185291] bone-capemgr bone_capemgr.9: slot #27: dtbo 'PyBBIO-eqep2-00A0.dtbo' loaded; converting to live tree<br />
# [325272.185847] bone-capemgr bone_capemgr.9: slot #27: PyBBIO-eqep2 conflict P8.41 (#5:BB-BONELT-HDMI)<br />
# [325272.196171] bone-capemgr bone_capemgr.9: slot #27: Failed verification<br />
There's a conflict with the HDMI pins. Try the other one<br />
bone$ '''echo PyBBIO-eqep2b > $SLOTS'''<br />
That works! Wire encoder to '''P8_11''' and '''P8_12''' and then:<br />
bone '''cd /sys/devices/ocp.3/48304000.epwmss/48304180.eqep/'''<br />
bone$ '''ls'''<br />
driver enabled modalias mode period position power subsystem uevent<br />
bone$ '''cat position'''<br />
0<br />
Turn the encoder and '''cat''' again.<br />
bone$ '''cat position'''<br />
12<br />
Try turning the other way.<br />
<br />
== Reading the Encoder ==<br />
In '''exercises/sensors/eQEP''' you'll find file called '''rotaryEncoder.js'''.<br />
<br />
#!/usr/bin/env node<br />
// This uses the eQEP hardware to read a rotary encoder<br />
// export SLOTS=/sys/devices/bone_capemgr.*/slots<br />
// echo PyBBIO-eqep2b > > $SLOTS<br />
// Wire encoder to P8_11 and P8_12 when using eQEP2.<br />
<br />
var b = require('bonescript'),<br />
fs = require('fs');<br />
var eQEP0 = "/sys/devices/ocp.3/48300000.epwmss/48300180.eqep/",<br />
eQEP1 = "/sys/devices/ocp.3/48302000.epwmss/48302180.eqep/",<br />
eQEP2 = "/sys/devices/ocp.3/48304000.epwmss/48304180.eqep/",<br />
eQEP = eQEP2;<br />
var oldData, // pervious data read<br />
period = 100; // in ms<br />
// Set the eEQP period, convert to ns.<br />
fs.writeFile(eQEP+'period', period*1000000, function(err) {<br />
if (err) throw err;<br />
console.log('Period updated to ' + period*1000000);<br />
})<br />
// Enable<br />
fs.writeFile(eQEP+'enabled', 1, function(err) {<br />
if (err) throw err;<br />
console.log('Enabled');<br />
})<br />
setInterval(readEncoder, period); // Check state every 250 ms<br />
function readEncoder(x) {<br />
fs.readFile(eQEP + 'position', {encoding: 'utf8'}, printValue);<br />
}<br />
function printValue(err, data) {<br />
if (err) throw err;<br />
if (oldData !== data) {<br />
console.log('position: '+data+' speed: '+(oldData-data));<br />
oldData = data;<br />
}<br />
}<br />
<br />
Run it with:<br />
<br />
bone$ '''./rotaryEncoder.js'''<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_03_Installing_a_Beagle_OS&diff=580459EBC Exercise 03 Installing a Beagle OS2023-12-13T14:02:40Z<p>Yoder: /* Downloads */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
In this class we run [https://www.debian.org/ The Debian Distribution] on the BeagleBoard. Here's how to load the Debian image we'll be using on an SD card. First get a microSD card that holds at least 8G.<br />
== Downloads ==<br />
There are two items you need to download, the image to copy to your SD card and the software to copy it. <br />
<br />
Use '''balenaEtcher''' to copy to your SD card. Download it from here: https://etcher.balena.io/. It runs on Linux, Mac or Windows, so pick your favorite OS and install it.<br />
Or <br />
host$ '''sudo apt install balena-etcher-electron'''<br />
host$ '''cd /usr/bin'''<br />
host$ '''rm balena-etcher-electron'''<br />
host$ '''sudo ln -s /opt/balenaEtcher/balena-etcher-electron .'''<br />
host$ '''balena-etcher-electron --no-sandbox --disable-gpu-sandbox --disable-seccomp-filter-sandbox'''<br />
<br />
From https://cloudsmith.io/~balena/repos/etcher/setup/#formats-deb and https://github.com/balena-io/etcher/issues/3761<br />
<br />
There are many versions of Debian we could use. Browse to https://forum.beagleboard.org/t/debian-11-x-bullseye-monthly-snapshot-2023-10-07/31280 and download [https://rcn-ee.com/rootfs/release/2023-10-07/bullseye-iot-armhf/am335x-debian-11.8-iot-armhf-2023-10-07-4gb.img.xz '''am335x-debian-11.8-iot-armhf-2023-10-07-4gb.img.xz''']<br />
<br />
<br />
If you want to be on the leading (bleeding?) edge (not recomended), <br />
browse to https://forum.beagleboard.org/t/debian-12-x-bookworm-monthly-snapshot-2023-10-07/36175 and download [https://rcn-ee.com/rootfs/release/2023-10-07/bookworm-iot-armhf/am335x-debian-12.2-iot-armhf-2023-10-07-4gb.img.xz '''am335x-debian-12.2-iot-armhf-2023-10-07-4gb.img.xz''']<br />
<br />
== Copying to your SD card ==<br />
# Start up balenaEtcher. <br />
# Select the image you downloaded (no need to uncompress it). <br />
# Put your SD card in the reader and select it. <br />
# Click '''Flash!''' and wait for it to finish.<br />
<br />
Once the SD card is flashed, put it in your Bone and boot it up.<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_04_Mounting_OneDrive&diff=580417EBC Exercise 04 Mounting OneDrive2023-12-12T16:33:41Z<p>Yoder: /* Configuring rclone */</p>
<hr />
<div>[[Category:ECE497]]<br />
[[Category:EmbeddedBeagleClass]]<br />
{{YoderHead}}<br />
<br />
Here are instructions on how to mount your Rose OneDrive files on your Beagle via '''rclone'''.<br />
<br />
[https://rclone.org/ rclone] is a command line program to sync files and directories to and from many different services, one of which is OneDrive.<br />
<br />
== Installing rclone ==<br />
Install rclone on both your host and your Bone (https://rclone.org/downloads/):<br />
bone$ '''sudo apt update'''<br />
bone$ '''sudo apt install fuse'''<br />
bone$ '''wget https://downloads.rclone.org/v1.53.3/rclone-v1.53.3-linux-arm.deb'''<br />
bone$ '''sudo dpkg -i rclone-v1.53.3-linux-arm.deb'''<br />
<br />
host$ '''sudo apt update'''<br />
host$ '''sudo apt install rclone fuse'''<br />
<br />
Note: This method loads version 1.53<br />
<br />
== Configuring rclone ==<br />
Next configure on the machine you want to run it on. I'll show doing it on the Bone since it's a bit more involved.<br />
<br />
bone$ '''rclone config'''<br />
No remotes found - make a new one<br />
n) New remote<br />
s) Set configuration password<br />
q) Quit config<br />
n/s/q> '''n'''<br />
We're starting a new remote, so enter '''n'''<br />
<br />
name> '''onedrive'''<br />
Call it whatever you want, I'm using '''onedrive'''.<br />
Type of storage to configure.<br />
Enter a string value. Press Enter for the default ("").<br />
Choose a number from below, or type in your own value<br />
1 / 1Fichier<br />
\ "fichier"<br />
...<br />
12 / Google Drive<br />
\ "drive"<br />
13 / Google Photos<br />
\ "google photos"<br />
...<br />
22 / Microsoft OneDrive<br />
\ "onedrive"<br />
...<br />
Storage> '''22'''<br />
There are many choices, we want '''onedrive'''. Here's it's numbered 22, it may be different on yours.<br />
Microsoft App Client Id<br />
Leave blank normally.<br />
Enter a string value. Press Enter for the default ("").<br />
client_id> <br />
Leave this blank<br />
Microsoft App Client Secret<br />
Leave blank normally.<br />
Enter a string value. Press Enter for the default ("").<br />
client_secret> <br />
This blank too<br />
Option region.<br />
Choose national cloud region for OneDrive.<br />
Choose a number from below, or type in your own string value.<br />
Press Enter for the default (global).<br />
1 / Microsoft Cloud Global<br />
\ (global)<br />
2 / Microsoft Cloud for US Government<br />
\ (us)<br />
3 / Microsoft Cloud Germany<br />
\ (de)<br />
4 / Azure and Office 365 operated by Vnet Group in China<br />
\ (cn)<br />
region><br />
Also blank.<br />
<br />
Edit advanced config? (y/n)<br />
y) Yes<br />
n) No<br />
y/n> '''y'''<br />
We want '''y''' here<br />
<br />
Leave the next few blank until you get to '''drive_type'''<br />
token><br />
auth_url><br />
token_url><br />
chunk_size><br />
drive_id><br />
<br />
The type of the drive ( personal | business | documentLibrary )<br />
Enter a string value. Press Enter for the default ("").<br />
drive_type> '''business'''<br />
Enter '''business''' to get to your Rose OneDrive.<br />
<br />
There are several more that are blank.<br />
<br />
root_folder_id><br />
access_scopes><br />
expose_onenote_files><br />
server_side_across_configs><br />
list_chunk><br />
no_versions><br />
link_scope><br />
link_type><br />
link_password><br />
encoding><br />
<br />
Edit advanced config?<br />
y) Yes<br />
n) No (default)<br />
y/n> '''n'''<br />
<br />
Remote config<br />
Use auto config?<br />
* Say Y if not sure<br />
* Say N if you are working on a remote or headless machine<br />
y) Yes<br />
n) No<br />
y/n> '''n'''<br />
Here is where the host vs bone install differs. If you are on your host enter '''y'''.<br />
The Bone is headless, so enter '''n'''. Let's follow the Bone path since it's requires a bit more work.<br />
<br />
For this to work, you will need rclone available on a machine that has a web browser available.<br />
Execute the following on your machine (same rclone version recommended) :<br />
rclone authorize "onedrive"<br />
Then paste the result below:<br />
result> <br />
So, when installing on the Bone you need to run '''rclone authorize "onedrive"''' on your host.<br />
Note: there was a forth argument that I deleted to make it work.<br />
<br />
So without quitting the rclone install, run the command on your host. You will see<br />
host$ '''rclone authorize "onedrive"'''<br />
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=de0c54f8aa6e4694505435d0025af353<br />
Log in and authorize rclone for access<br />
Waiting for code...<br />
Got code<br />
Paste the following into your remote machine ---><br />
{"access_token":"eyJ0eXAiOiJKV1QiLCJub25jZSI6IktlaC1iX3lxWlZNUFh0aXpYczl0bHJMQ3dwMno3TFdWVXA0NHA4MGkxOHciLCJhbGciOiJSUzI1NiIsIng1dCI6ImFQY3R3X29kdlJPb0VOZzNWb09sSWgydGlFcyIsImtpZCI6ImFQY3R3X29kdlJPb0VOZzNWb09sSWg ...<br />
CiXlbeWkTuJIyHzz9ViTscTUTKL9mhTjagMRrFzH1y-AKc0KwKUOImMF1zObuJGUEVcjmrB7BYDwy6u0z2lz8PU092HTbh-S5GrmmVXiRDPWr2aSUUf31QLfjIAA","expiry":"2019-10-10T12:15:33.556943127-04:00"}<br />
<---End paste<br />
Follow the directions and login to your Rose OneDrive account. <br />
The copy the '''access_token''' from your host window and paste it into the rclone config window. You will see<br />
Choose a number from below, or type in an existing value<br />
1 / OneDrive Personal or Business<br />
\ "onedrive"<br />
2 / Root Sharepoint site<br />
\ "sharepoint"<br />
3 / Type in driveID<br />
\ "driveid"<br />
4 / Type in SiteID<br />
\ "siteid"<br />
5 / Search a Sharepoint site<br />
\ "search"<br />
Your choice> '''1'''<br />
Enter '''1''' for OneDrive. After a bit you will see<br />
Found 1 drives, please select the one you want to use:<br />
0: OneDrive (business) id=b!T2RYBL90GUuk6Tj5AyfQmSswgAAexZNCm9PUX6-Q-MBzqSd8jB3aSZVF5mbW4mJw<br />
Chose drive to use:> '''0'''<br />
There is only one choice, so take it. After a bit more<br />
Found drive 'root' of type 'business', URL: https://rosehulman-my.sharepoint.com/personal/yoder_rose-hulman_edu/Documents<br />
Is that okay?<br />
y) Yes<br />
n) No<br />
y/n> '''y'''<br />
Your's should have your Rose email. Enter '''y''' and you'll see<br />
--------------------<br />
[onedrive]<br />
type = onedrive<br />
drive_type = business<br />
token = <br />
{"access_token":"eyJ0eXAiOiJKV1QiLCJub25jZSI6I...lupXcXioJ1VlCIAA","expiry":"2019-10-10T13:47:11.125261755-04:00"}<br />
drive_id = b!T2RYBL90GUuk6Tj5AyfQmSswgAAexZNCm9PUX6-Q-MBzqSd8jB3aSZVF5mbW4mJw<br />
--------------------<br />
y) Yes this is OK<br />
e) Edit this remote<br />
d) Delete this remote<br />
y/e/d> '''y'''<br />
Looks good. Enter '''y'''<br />
Current remotes:<br />
<br />
Name Type<br />
==== ====<br />
onedrive onedrive <br />
<br />
e) Edit existing remote<br />
n) New remote<br />
d) Delete remote<br />
r) Rename remote<br />
c) Copy remote<br />
s) Set configuration password<br />
q) Quit config<br />
e/n/d/r/c/s/q> '''q'''<br />
Go ahead and quit. You are now configured.<br />
<br />
== Mounting the remote files ==<br />
Once configured, it's easy to mount your files when you need them.<br />
bone$ '''mkdir onedrive'''<br />
bone$ '''rclone mount onedrive: onedrive --daemon'''<br />
bone$ '''cd onedrive'''<br />
bone$ '''ls'''<br />
Attachments Desktop Documents 'Shared with Everyone'<br />
Those should be the top-level files in your Rose account.<br />
<br />
When you are done with it.<br />
bone$ '''sudo umount onedrive'''<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_04_Mounting_OneDrive&diff=580414EBC Exercise 04 Mounting OneDrive2023-12-12T16:31:59Z<p>Yoder: /* Installing rclone */</p>
<hr />
<div>[[Category:ECE497]]<br />
[[Category:EmbeddedBeagleClass]]<br />
{{YoderHead}}<br />
<br />
Here are instructions on how to mount your Rose OneDrive files on your Beagle via '''rclone'''.<br />
<br />
[https://rclone.org/ rclone] is a command line program to sync files and directories to and from many different services, one of which is OneDrive.<br />
<br />
== Installing rclone ==<br />
Install rclone on both your host and your Bone (https://rclone.org/downloads/):<br />
bone$ '''sudo apt update'''<br />
bone$ '''sudo apt install fuse'''<br />
bone$ '''wget https://downloads.rclone.org/v1.53.3/rclone-v1.53.3-linux-arm.deb'''<br />
bone$ '''sudo dpkg -i rclone-v1.53.3-linux-arm.deb'''<br />
<br />
host$ '''sudo apt update'''<br />
host$ '''sudo apt install rclone fuse'''<br />
<br />
Note: This method loads version 1.53<br />
<br />
== Configuring rclone ==<br />
Next configure on the machine you want to run it on. I'll show doing it on the Bone since it's a bit more involved.<br />
<br />
bone$ '''rclone config'''<br />
No remotes found - make a new one<br />
n) New remote<br />
s) Set configuration password<br />
q) Quit config<br />
n/s/q> '''n'''<br />
We're starting a new remote, so enter '''n'''<br />
<br />
name> '''onedrive'''<br />
Call it whatever you want, I'm using '''onedrive'''.<br />
Type of storage to configure.<br />
Enter a string value. Press Enter for the default ("").<br />
Choose a number from below, or type in your own value<br />
1 / 1Fichier<br />
\ "fichier"<br />
...<br />
12 / Google Drive<br />
\ "drive"<br />
13 / Google Photos<br />
\ "google photos"<br />
...<br />
22 / Microsoft OneDrive<br />
\ "onedrive"<br />
...<br />
Storage> '''22'''<br />
There are many choices, we want '''onedrive'''. Here's it's numbered 22, it may be different on yours.<br />
Microsoft App Client Id<br />
Leave blank normally.<br />
Enter a string value. Press Enter for the default ("").<br />
client_id> <br />
Leave this blank<br />
Microsoft App Client Secret<br />
Leave blank normally.<br />
Enter a string value. Press Enter for the default ("").<br />
client_secret> <br />
This blank too<br />
Option region.<br />
Choose national cloud region for OneDrive.<br />
Choose a number from below, or type in your own string value.<br />
Press Enter for the default (global).<br />
1 / Microsoft Cloud Global<br />
\ (global)<br />
2 / Microsoft Cloud for US Government<br />
\ (us)<br />
3 / Microsoft Cloud Germany<br />
\ (de)<br />
4 / Azure and Office 365 operated by Vnet Group in China<br />
\ (cn)<br />
region><br />
Also blank.<br />
<br />
Edit advanced config? (y/n)<br />
y) Yes<br />
n) No<br />
y/n> '''y'''<br />
We want '''y''' here<br />
<br />
Leave the next few blank until you get to '''drive_type'''<br />
token><br />
auth_url><br />
token_url><br />
chunk_size><br />
drive_id><br />
The type of the drive ( personal | business | documentLibrary )<br />
Enter a string value. Press Enter for the default ("").<br />
drive_type> '''business'''<br />
Enter '''business''' to get to your Rose OneDrive.<br />
<br />
There are several more that are blank.<br />
<br />
root_folder_id><br />
access_scopes><br />
expose_onenote_files><br />
server_side_across_configs><br />
list_chunk><br />
no_versions><br />
link_scope><br />
link_type><br />
link_password><br />
encoding><br />
Edit advanced config?<br />
y) Yes<br />
n) No (default)<br />
y/n> '''n'''<br />
<br />
Remote config<br />
Use auto config?<br />
* Say Y if not sure<br />
* Say N if you are working on a remote or headless machine<br />
y) Yes<br />
n) No<br />
y/n> '''n'''<br />
Here is where the host vs bone install differs. If you are on your host enter '''y'''.<br />
The Bone is headless, so enter '''n'''. Let's follow the Bone path since it's requires a bit more work.<br />
<br />
For this to work, you will need rclone available on a machine that has a web browser available.<br />
Execute the following on your machine (same rclone version recommended) :<br />
rclone authorize "onedrive"<br />
Then paste the result below:<br />
result> <br />
So, when installing on the Bone you need to run '''rclone authorize "onedrive"''' on your host.<br />
Note: there was a forth argument that I deleted to make it work.<br />
<br />
So without quitting the rclone install, run the command on your host. You will see<br />
host$ '''rclone authorize "onedrive"'''<br />
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=de0c54f8aa6e4694505435d0025af353<br />
Log in and authorize rclone for access<br />
Waiting for code...<br />
Got code<br />
Paste the following into your remote machine ---><br />
{"access_token":"eyJ0eXAiOiJKV1QiLCJub25jZSI6IktlaC1iX3lxWlZNUFh0aXpYczl0bHJMQ3dwMno3TFdWVXA0NHA4MGkxOHciLCJhbGciOiJSUzI1NiIsIng1dCI6ImFQY3R3X29kdlJPb0VOZzNWb09sSWgydGlFcyIsImtpZCI6ImFQY3R3X29kdlJPb0VOZzNWb09sSWg ...<br />
CiXlbeWkTuJIyHzz9ViTscTUTKL9mhTjagMRrFzH1y-AKc0KwKUOImMF1zObuJGUEVcjmrB7BYDwy6u0z2lz8PU092HTbh-S5GrmmVXiRDPWr2aSUUf31QLfjIAA","expiry":"2019-10-10T12:15:33.556943127-04:00"}<br />
<---End paste<br />
Follow the directions and login to your Rose OneDrive account. <br />
The copy the '''access_token''' from your host window and paste it into the rclone config window. You will see<br />
Choose a number from below, or type in an existing value<br />
1 / OneDrive Personal or Business<br />
\ "onedrive"<br />
2 / Root Sharepoint site<br />
\ "sharepoint"<br />
3 / Type in driveID<br />
\ "driveid"<br />
4 / Type in SiteID<br />
\ "siteid"<br />
5 / Search a Sharepoint site<br />
\ "search"<br />
Your choice> '''1'''<br />
Enter '''1''' for OneDrive. After a bit you will see<br />
Found 1 drives, please select the one you want to use:<br />
0: OneDrive (business) id=b!T2RYBL90GUuk6Tj5AyfQmSswgAAexZNCm9PUX6-Q-MBzqSd8jB3aSZVF5mbW4mJw<br />
Chose drive to use:> '''0'''<br />
There is only one choice, so take it. After a bit more<br />
Found drive 'root' of type 'business', URL: https://rosehulman-my.sharepoint.com/personal/yoder_rose-hulman_edu/Documents<br />
Is that okay?<br />
y) Yes<br />
n) No<br />
y/n> '''y'''<br />
Your's should have your Rose email. Enter '''y''' and you'll see<br />
--------------------<br />
[onedrive]<br />
type = onedrive<br />
drive_type = business<br />
token = <br />
{"access_token":"eyJ0eXAiOiJKV1QiLCJub25jZSI6I...lupXcXioJ1VlCIAA","expiry":"2019-10-10T13:47:11.125261755-04:00"}<br />
drive_id = b!T2RYBL90GUuk6Tj5AyfQmSswgAAexZNCm9PUX6-Q-MBzqSd8jB3aSZVF5mbW4mJw<br />
--------------------<br />
y) Yes this is OK<br />
e) Edit this remote<br />
d) Delete this remote<br />
y/e/d> '''y'''<br />
Looks good. Enter '''y'''<br />
Current remotes:<br />
<br />
Name Type<br />
==== ====<br />
onedrive onedrive <br />
<br />
e) Edit existing remote<br />
n) New remote<br />
d) Delete remote<br />
r) Rename remote<br />
c) Copy remote<br />
s) Set configuration password<br />
q) Quit config<br />
e/n/d/r/c/s/q> '''q'''<br />
Go ahead and quit. You are now configured.<br />
<br />
== Mounting the remote files ==<br />
Once configured, it's easy to mount your files when you need them.<br />
bone$ '''mkdir onedrive'''<br />
bone$ '''rclone mount onedrive: onedrive --daemon'''<br />
bone$ '''cd onedrive'''<br />
bone$ '''ls'''<br />
Attachments Desktop Documents 'Shared with Everyone'<br />
Those should be the top-level files in your Rose account.<br />
<br />
When you are done with it.<br />
bone$ '''sudo umount onedrive'''<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_04_Mounting_OneDrive&diff=580411EBC Exercise 04 Mounting OneDrive2023-12-11T21:50:06Z<p>Yoder: /* Installing rclone */</p>
<hr />
<div>[[Category:ECE497]]<br />
[[Category:EmbeddedBeagleClass]]<br />
{{YoderHead}}<br />
<br />
Here are instructions on how to mount your Rose OneDrive files on your Beagle via '''rclone'''.<br />
<br />
[https://rclone.org/ rclone] is a command line program to sync files and directories to and from many different services, one of which is OneDrive.<br />
<br />
== Installing rclone ==<br />
Install rclone on both your host and your Bone (https://rclone.org/downloads/):<br />
bone$ '''sudo apt update'''<br />
bone$ '''sudo apt install fuse'''<br />
bone$ ```wget https://downloads.rclone.org/v1.53.3/rclone-v1.53.3-linux-arm.deb```<br />
bone$ ```sudo dpkg -i rclone-v1.53.3-linux-arm.deb```<br />
<br />
host$ '''sudo apt update'''<br />
host$ '''sudo apt install rclone fuse'''<br />
<br />
Note: This method loads version 1.53<br />
<br />
== Configuring rclone ==<br />
Next configure on the machine you want to run it on. I'll show doing it on the Bone since it's a bit more involved.<br />
<br />
bone$ '''rclone config'''<br />
No remotes found - make a new one<br />
n) New remote<br />
s) Set configuration password<br />
q) Quit config<br />
n/s/q> '''n'''<br />
We're starting a new remote, so enter '''n'''<br />
<br />
name> '''onedrive'''<br />
Call it whatever you want, I'm using '''onedrive'''.<br />
Type of storage to configure.<br />
Enter a string value. Press Enter for the default ("").<br />
Choose a number from below, or type in your own value<br />
1 / 1Fichier<br />
\ "fichier"<br />
...<br />
12 / Google Drive<br />
\ "drive"<br />
13 / Google Photos<br />
\ "google photos"<br />
...<br />
22 / Microsoft OneDrive<br />
\ "onedrive"<br />
...<br />
Storage> '''22'''<br />
There are many choices, we want '''onedrive'''. Here's it's numbered 22, it may be different on yours.<br />
Microsoft App Client Id<br />
Leave blank normally.<br />
Enter a string value. Press Enter for the default ("").<br />
client_id> <br />
Leave this blank<br />
Microsoft App Client Secret<br />
Leave blank normally.<br />
Enter a string value. Press Enter for the default ("").<br />
client_secret> <br />
This blank too<br />
Option region.<br />
Choose national cloud region for OneDrive.<br />
Choose a number from below, or type in your own string value.<br />
Press Enter for the default (global).<br />
1 / Microsoft Cloud Global<br />
\ (global)<br />
2 / Microsoft Cloud for US Government<br />
\ (us)<br />
3 / Microsoft Cloud Germany<br />
\ (de)<br />
4 / Azure and Office 365 operated by Vnet Group in China<br />
\ (cn)<br />
region><br />
Also blank.<br />
<br />
Edit advanced config? (y/n)<br />
y) Yes<br />
n) No<br />
y/n> '''y'''<br />
We want '''y''' here<br />
<br />
Leave the next few blank until you get to '''drive_type'''<br />
token><br />
auth_url><br />
token_url><br />
chunk_size><br />
drive_id><br />
The type of the drive ( personal | business | documentLibrary )<br />
Enter a string value. Press Enter for the default ("").<br />
drive_type> '''business'''<br />
Enter '''business''' to get to your Rose OneDrive.<br />
<br />
There are several more that are blank.<br />
<br />
root_folder_id><br />
access_scopes><br />
expose_onenote_files><br />
server_side_across_configs><br />
list_chunk><br />
no_versions><br />
link_scope><br />
link_type><br />
link_password><br />
encoding><br />
Edit advanced config?<br />
y) Yes<br />
n) No (default)<br />
y/n> '''n'''<br />
<br />
Remote config<br />
Use auto config?<br />
* Say Y if not sure<br />
* Say N if you are working on a remote or headless machine<br />
y) Yes<br />
n) No<br />
y/n> '''n'''<br />
Here is where the host vs bone install differs. If you are on your host enter '''y'''.<br />
The Bone is headless, so enter '''n'''. Let's follow the Bone path since it's requires a bit more work.<br />
<br />
For this to work, you will need rclone available on a machine that has a web browser available.<br />
Execute the following on your machine (same rclone version recommended) :<br />
rclone authorize "onedrive"<br />
Then paste the result below:<br />
result> <br />
So, when installing on the Bone you need to run '''rclone authorize "onedrive"''' on your host.<br />
Note: there was a forth argument that I deleted to make it work.<br />
<br />
So without quitting the rclone install, run the command on your host. You will see<br />
host$ '''rclone authorize "onedrive"'''<br />
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=de0c54f8aa6e4694505435d0025af353<br />
Log in and authorize rclone for access<br />
Waiting for code...<br />
Got code<br />
Paste the following into your remote machine ---><br />
{"access_token":"eyJ0eXAiOiJKV1QiLCJub25jZSI6IktlaC1iX3lxWlZNUFh0aXpYczl0bHJMQ3dwMno3TFdWVXA0NHA4MGkxOHciLCJhbGciOiJSUzI1NiIsIng1dCI6ImFQY3R3X29kdlJPb0VOZzNWb09sSWgydGlFcyIsImtpZCI6ImFQY3R3X29kdlJPb0VOZzNWb09sSWg ...<br />
CiXlbeWkTuJIyHzz9ViTscTUTKL9mhTjagMRrFzH1y-AKc0KwKUOImMF1zObuJGUEVcjmrB7BYDwy6u0z2lz8PU092HTbh-S5GrmmVXiRDPWr2aSUUf31QLfjIAA","expiry":"2019-10-10T12:15:33.556943127-04:00"}<br />
<---End paste<br />
Follow the directions and login to your Rose OneDrive account. <br />
The copy the '''access_token''' from your host window and paste it into the rclone config window. You will see<br />
Choose a number from below, or type in an existing value<br />
1 / OneDrive Personal or Business<br />
\ "onedrive"<br />
2 / Root Sharepoint site<br />
\ "sharepoint"<br />
3 / Type in driveID<br />
\ "driveid"<br />
4 / Type in SiteID<br />
\ "siteid"<br />
5 / Search a Sharepoint site<br />
\ "search"<br />
Your choice> '''1'''<br />
Enter '''1''' for OneDrive. After a bit you will see<br />
Found 1 drives, please select the one you want to use:<br />
0: OneDrive (business) id=b!T2RYBL90GUuk6Tj5AyfQmSswgAAexZNCm9PUX6-Q-MBzqSd8jB3aSZVF5mbW4mJw<br />
Chose drive to use:> '''0'''<br />
There is only one choice, so take it. After a bit more<br />
Found drive 'root' of type 'business', URL: https://rosehulman-my.sharepoint.com/personal/yoder_rose-hulman_edu/Documents<br />
Is that okay?<br />
y) Yes<br />
n) No<br />
y/n> '''y'''<br />
Your's should have your Rose email. Enter '''y''' and you'll see<br />
--------------------<br />
[onedrive]<br />
type = onedrive<br />
drive_type = business<br />
token = <br />
{"access_token":"eyJ0eXAiOiJKV1QiLCJub25jZSI6I...lupXcXioJ1VlCIAA","expiry":"2019-10-10T13:47:11.125261755-04:00"}<br />
drive_id = b!T2RYBL90GUuk6Tj5AyfQmSswgAAexZNCm9PUX6-Q-MBzqSd8jB3aSZVF5mbW4mJw<br />
--------------------<br />
y) Yes this is OK<br />
e) Edit this remote<br />
d) Delete this remote<br />
y/e/d> '''y'''<br />
Looks good. Enter '''y'''<br />
Current remotes:<br />
<br />
Name Type<br />
==== ====<br />
onedrive onedrive <br />
<br />
e) Edit existing remote<br />
n) New remote<br />
d) Delete remote<br />
r) Rename remote<br />
c) Copy remote<br />
s) Set configuration password<br />
q) Quit config<br />
e/n/d/r/c/s/q> '''q'''<br />
Go ahead and quit. You are now configured.<br />
<br />
== Mounting the remote files ==<br />
Once configured, it's easy to mount your files when you need them.<br />
bone$ '''mkdir onedrive'''<br />
bone$ '''rclone mount onedrive: onedrive --daemon'''<br />
bone$ '''cd onedrive'''<br />
bone$ '''ls'''<br />
Attachments Desktop Documents 'Shared with Everyone'<br />
Those should be the top-level files in your Rose account.<br />
<br />
When you are done with it.<br />
bone$ '''sudo umount onedrive'''<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_04_Mounting_OneDrive&diff=580408EBC Exercise 04 Mounting OneDrive2023-12-11T21:47:40Z<p>Yoder: /* Installing rclone */</p>
<hr />
<div>[[Category:ECE497]]<br />
[[Category:EmbeddedBeagleClass]]<br />
{{YoderHead}}<br />
<br />
Here are instructions on how to mount your Rose OneDrive files on your Beagle via '''rclone'''.<br />
<br />
[https://rclone.org/ rclone] is a command line program to sync files and directories to and from many different services, one of which is OneDrive.<br />
<br />
== Installing rclone ==<br />
Install rclone on both your host and your Bone (https://rclone.org/downloads/):<br />
bone$ '''sudo apt update'''<br />
bone$ '''sudo apt install rclone fuse'''<br />
<br />
host$ '''sudo apt update'''<br />
host$ '''sudo apt install rclone fuse'''<br />
<br />
Note: This method loads version 1.53<br />
<br />
== Configuring rclone ==<br />
Next configure on the machine you want to run it on. I'll show doing it on the Bone since it's a bit more involved.<br />
<br />
bone$ '''rclone config'''<br />
No remotes found - make a new one<br />
n) New remote<br />
s) Set configuration password<br />
q) Quit config<br />
n/s/q> '''n'''<br />
We're starting a new remote, so enter '''n'''<br />
<br />
name> '''onedrive'''<br />
Call it whatever you want, I'm using '''onedrive'''.<br />
Type of storage to configure.<br />
Enter a string value. Press Enter for the default ("").<br />
Choose a number from below, or type in your own value<br />
1 / 1Fichier<br />
\ "fichier"<br />
...<br />
12 / Google Drive<br />
\ "drive"<br />
13 / Google Photos<br />
\ "google photos"<br />
...<br />
22 / Microsoft OneDrive<br />
\ "onedrive"<br />
...<br />
Storage> '''22'''<br />
There are many choices, we want '''onedrive'''. Here's it's numbered 22, it may be different on yours.<br />
Microsoft App Client Id<br />
Leave blank normally.<br />
Enter a string value. Press Enter for the default ("").<br />
client_id> <br />
Leave this blank<br />
Microsoft App Client Secret<br />
Leave blank normally.<br />
Enter a string value. Press Enter for the default ("").<br />
client_secret> <br />
This blank too<br />
Option region.<br />
Choose national cloud region for OneDrive.<br />
Choose a number from below, or type in your own string value.<br />
Press Enter for the default (global).<br />
1 / Microsoft Cloud Global<br />
\ (global)<br />
2 / Microsoft Cloud for US Government<br />
\ (us)<br />
3 / Microsoft Cloud Germany<br />
\ (de)<br />
4 / Azure and Office 365 operated by Vnet Group in China<br />
\ (cn)<br />
region><br />
Also blank.<br />
<br />
Edit advanced config? (y/n)<br />
y) Yes<br />
n) No<br />
y/n> '''y'''<br />
We want '''y''' here<br />
<br />
Leave the next few blank until you get to '''drive_type'''<br />
token><br />
auth_url><br />
token_url><br />
chunk_size><br />
drive_id><br />
The type of the drive ( personal | business | documentLibrary )<br />
Enter a string value. Press Enter for the default ("").<br />
drive_type> '''business'''<br />
Enter '''business''' to get to your Rose OneDrive.<br />
<br />
There are several more that are blank.<br />
<br />
root_folder_id><br />
access_scopes><br />
expose_onenote_files><br />
server_side_across_configs><br />
list_chunk><br />
no_versions><br />
link_scope><br />
link_type><br />
link_password><br />
encoding><br />
Edit advanced config?<br />
y) Yes<br />
n) No (default)<br />
y/n> '''n'''<br />
<br />
Remote config<br />
Use auto config?<br />
* Say Y if not sure<br />
* Say N if you are working on a remote or headless machine<br />
y) Yes<br />
n) No<br />
y/n> '''n'''<br />
Here is where the host vs bone install differs. If you are on your host enter '''y'''.<br />
The Bone is headless, so enter '''n'''. Let's follow the Bone path since it's requires a bit more work.<br />
<br />
For this to work, you will need rclone available on a machine that has a web browser available.<br />
Execute the following on your machine (same rclone version recommended) :<br />
rclone authorize "onedrive"<br />
Then paste the result below:<br />
result> <br />
So, when installing on the Bone you need to run '''rclone authorize "onedrive"''' on your host.<br />
Note: there was a forth argument that I deleted to make it work.<br />
<br />
So without quitting the rclone install, run the command on your host. You will see<br />
host$ '''rclone authorize "onedrive"'''<br />
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=de0c54f8aa6e4694505435d0025af353<br />
Log in and authorize rclone for access<br />
Waiting for code...<br />
Got code<br />
Paste the following into your remote machine ---><br />
{"access_token":"eyJ0eXAiOiJKV1QiLCJub25jZSI6IktlaC1iX3lxWlZNUFh0aXpYczl0bHJMQ3dwMno3TFdWVXA0NHA4MGkxOHciLCJhbGciOiJSUzI1NiIsIng1dCI6ImFQY3R3X29kdlJPb0VOZzNWb09sSWgydGlFcyIsImtpZCI6ImFQY3R3X29kdlJPb0VOZzNWb09sSWg ...<br />
CiXlbeWkTuJIyHzz9ViTscTUTKL9mhTjagMRrFzH1y-AKc0KwKUOImMF1zObuJGUEVcjmrB7BYDwy6u0z2lz8PU092HTbh-S5GrmmVXiRDPWr2aSUUf31QLfjIAA","expiry":"2019-10-10T12:15:33.556943127-04:00"}<br />
<---End paste<br />
Follow the directions and login to your Rose OneDrive account. <br />
The copy the '''access_token''' from your host window and paste it into the rclone config window. You will see<br />
Choose a number from below, or type in an existing value<br />
1 / OneDrive Personal or Business<br />
\ "onedrive"<br />
2 / Root Sharepoint site<br />
\ "sharepoint"<br />
3 / Type in driveID<br />
\ "driveid"<br />
4 / Type in SiteID<br />
\ "siteid"<br />
5 / Search a Sharepoint site<br />
\ "search"<br />
Your choice> '''1'''<br />
Enter '''1''' for OneDrive. After a bit you will see<br />
Found 1 drives, please select the one you want to use:<br />
0: OneDrive (business) id=b!T2RYBL90GUuk6Tj5AyfQmSswgAAexZNCm9PUX6-Q-MBzqSd8jB3aSZVF5mbW4mJw<br />
Chose drive to use:> '''0'''<br />
There is only one choice, so take it. After a bit more<br />
Found drive 'root' of type 'business', URL: https://rosehulman-my.sharepoint.com/personal/yoder_rose-hulman_edu/Documents<br />
Is that okay?<br />
y) Yes<br />
n) No<br />
y/n> '''y'''<br />
Your's should have your Rose email. Enter '''y''' and you'll see<br />
--------------------<br />
[onedrive]<br />
type = onedrive<br />
drive_type = business<br />
token = <br />
{"access_token":"eyJ0eXAiOiJKV1QiLCJub25jZSI6I...lupXcXioJ1VlCIAA","expiry":"2019-10-10T13:47:11.125261755-04:00"}<br />
drive_id = b!T2RYBL90GUuk6Tj5AyfQmSswgAAexZNCm9PUX6-Q-MBzqSd8jB3aSZVF5mbW4mJw<br />
--------------------<br />
y) Yes this is OK<br />
e) Edit this remote<br />
d) Delete this remote<br />
y/e/d> '''y'''<br />
Looks good. Enter '''y'''<br />
Current remotes:<br />
<br />
Name Type<br />
==== ====<br />
onedrive onedrive <br />
<br />
e) Edit existing remote<br />
n) New remote<br />
d) Delete remote<br />
r) Rename remote<br />
c) Copy remote<br />
s) Set configuration password<br />
q) Quit config<br />
e/n/d/r/c/s/q> '''q'''<br />
Go ahead and quit. You are now configured.<br />
<br />
== Mounting the remote files ==<br />
Once configured, it's easy to mount your files when you need them.<br />
bone$ '''mkdir onedrive'''<br />
bone$ '''rclone mount onedrive: onedrive --daemon'''<br />
bone$ '''cd onedrive'''<br />
bone$ '''ls'''<br />
Attachments Desktop Documents 'Shared with Everyone'<br />
Those should be the top-level files in your Rose account.<br />
<br />
When you are done with it.<br />
bone$ '''sudo umount onedrive'''<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_04_Mounting_OneDrive&diff=580405EBC Exercise 04 Mounting OneDrive2023-12-11T20:38:50Z<p>Yoder: /* Configuring rclone */</p>
<hr />
<div>[[Category:ECE497]]<br />
[[Category:EmbeddedBeagleClass]]<br />
{{YoderHead}}<br />
<br />
Here are instructions on how to mount your Rose OneDrive files on your Beagle via '''rclone'''.<br />
<br />
[https://rclone.org/ rclone] is a command line program to sync files and directories to and from many different services, one of which is OneDrive.<br />
<br />
== Installing rclone ==<br />
Install rclone on both your host and your Bone (https://rclone.org/downloads/):<br />
bone$ '''sudo apt update'''<br />
bone$ '''sudo apt install rclone'''<br />
<br />
host$ '''sudo apt update'''<br />
host$ '''sudo apt install rclone'''<br />
<br />
Note: This method loads version 1.53<br />
<br />
== Configuring rclone ==<br />
Next configure on the machine you want to run it on. I'll show doing it on the Bone since it's a bit more involved.<br />
<br />
bone$ '''rclone config'''<br />
No remotes found - make a new one<br />
n) New remote<br />
s) Set configuration password<br />
q) Quit config<br />
n/s/q> '''n'''<br />
We're starting a new remote, so enter '''n'''<br />
<br />
name> '''onedrive'''<br />
Call it whatever you want, I'm using '''onedrive'''.<br />
Type of storage to configure.<br />
Enter a string value. Press Enter for the default ("").<br />
Choose a number from below, or type in your own value<br />
1 / 1Fichier<br />
\ "fichier"<br />
...<br />
12 / Google Drive<br />
\ "drive"<br />
13 / Google Photos<br />
\ "google photos"<br />
...<br />
22 / Microsoft OneDrive<br />
\ "onedrive"<br />
...<br />
Storage> '''22'''<br />
There are many choices, we want '''onedrive'''. Here's it's numbered 22, it may be different on yours.<br />
Microsoft App Client Id<br />
Leave blank normally.<br />
Enter a string value. Press Enter for the default ("").<br />
client_id> <br />
Leave this blank<br />
Microsoft App Client Secret<br />
Leave blank normally.<br />
Enter a string value. Press Enter for the default ("").<br />
client_secret> <br />
This blank too<br />
Option region.<br />
Choose national cloud region for OneDrive.<br />
Choose a number from below, or type in your own string value.<br />
Press Enter for the default (global).<br />
1 / Microsoft Cloud Global<br />
\ (global)<br />
2 / Microsoft Cloud for US Government<br />
\ (us)<br />
3 / Microsoft Cloud Germany<br />
\ (de)<br />
4 / Azure and Office 365 operated by Vnet Group in China<br />
\ (cn)<br />
region><br />
Also blank.<br />
<br />
Edit advanced config? (y/n)<br />
y) Yes<br />
n) No<br />
y/n> '''y'''<br />
We want '''y''' here<br />
<br />
Leave the next few blank until you get to '''drive_type'''<br />
token><br />
auth_url><br />
token_url><br />
chunk_size><br />
drive_id><br />
The type of the drive ( personal | business | documentLibrary )<br />
Enter a string value. Press Enter for the default ("").<br />
drive_type> '''business'''<br />
Enter '''business''' to get to your Rose OneDrive.<br />
<br />
There are several more that are blank.<br />
<br />
root_folder_id><br />
access_scopes><br />
expose_onenote_files><br />
server_side_across_configs><br />
list_chunk><br />
no_versions><br />
link_scope><br />
link_type><br />
link_password><br />
encoding><br />
Edit advanced config?<br />
y) Yes<br />
n) No (default)<br />
y/n> '''n'''<br />
<br />
Remote config<br />
Use auto config?<br />
* Say Y if not sure<br />
* Say N if you are working on a remote or headless machine<br />
y) Yes<br />
n) No<br />
y/n> '''n'''<br />
Here is where the host vs bone install differs. If you are on your host enter '''y'''.<br />
The Bone is headless, so enter '''n'''. Let's follow the Bone path since it's requires a bit more work.<br />
<br />
For this to work, you will need rclone available on a machine that has a web browser available.<br />
Execute the following on your machine (same rclone version recommended) :<br />
rclone authorize "onedrive"<br />
Then paste the result below:<br />
result> <br />
So, when installing on the Bone you need to run '''rclone authorize "onedrive"''' on your host.<br />
Note: there was a forth argument that I deleted to make it work.<br />
<br />
So without quitting the rclone install, run the command on your host. You will see<br />
host$ '''rclone authorize "onedrive"'''<br />
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=de0c54f8aa6e4694505435d0025af353<br />
Log in and authorize rclone for access<br />
Waiting for code...<br />
Got code<br />
Paste the following into your remote machine ---><br />
{"access_token":"eyJ0eXAiOiJKV1QiLCJub25jZSI6IktlaC1iX3lxWlZNUFh0aXpYczl0bHJMQ3dwMno3TFdWVXA0NHA4MGkxOHciLCJhbGciOiJSUzI1NiIsIng1dCI6ImFQY3R3X29kdlJPb0VOZzNWb09sSWgydGlFcyIsImtpZCI6ImFQY3R3X29kdlJPb0VOZzNWb09sSWg ...<br />
CiXlbeWkTuJIyHzz9ViTscTUTKL9mhTjagMRrFzH1y-AKc0KwKUOImMF1zObuJGUEVcjmrB7BYDwy6u0z2lz8PU092HTbh-S5GrmmVXiRDPWr2aSUUf31QLfjIAA","expiry":"2019-10-10T12:15:33.556943127-04:00"}<br />
<---End paste<br />
Follow the directions and login to your Rose OneDrive account. <br />
The copy the '''access_token''' from your host window and paste it into the rclone config window. You will see<br />
Choose a number from below, or type in an existing value<br />
1 / OneDrive Personal or Business<br />
\ "onedrive"<br />
2 / Root Sharepoint site<br />
\ "sharepoint"<br />
3 / Type in driveID<br />
\ "driveid"<br />
4 / Type in SiteID<br />
\ "siteid"<br />
5 / Search a Sharepoint site<br />
\ "search"<br />
Your choice> '''1'''<br />
Enter '''1''' for OneDrive. After a bit you will see<br />
Found 1 drives, please select the one you want to use:<br />
0: OneDrive (business) id=b!T2RYBL90GUuk6Tj5AyfQmSswgAAexZNCm9PUX6-Q-MBzqSd8jB3aSZVF5mbW4mJw<br />
Chose drive to use:> '''0'''<br />
There is only one choice, so take it. After a bit more<br />
Found drive 'root' of type 'business', URL: https://rosehulman-my.sharepoint.com/personal/yoder_rose-hulman_edu/Documents<br />
Is that okay?<br />
y) Yes<br />
n) No<br />
y/n> '''y'''<br />
Your's should have your Rose email. Enter '''y''' and you'll see<br />
--------------------<br />
[onedrive]<br />
type = onedrive<br />
drive_type = business<br />
token = <br />
{"access_token":"eyJ0eXAiOiJKV1QiLCJub25jZSI6I...lupXcXioJ1VlCIAA","expiry":"2019-10-10T13:47:11.125261755-04:00"}<br />
drive_id = b!T2RYBL90GUuk6Tj5AyfQmSswgAAexZNCm9PUX6-Q-MBzqSd8jB3aSZVF5mbW4mJw<br />
--------------------<br />
y) Yes this is OK<br />
e) Edit this remote<br />
d) Delete this remote<br />
y/e/d> '''y'''<br />
Looks good. Enter '''y'''<br />
Current remotes:<br />
<br />
Name Type<br />
==== ====<br />
onedrive onedrive <br />
<br />
e) Edit existing remote<br />
n) New remote<br />
d) Delete remote<br />
r) Rename remote<br />
c) Copy remote<br />
s) Set configuration password<br />
q) Quit config<br />
e/n/d/r/c/s/q> '''q'''<br />
Go ahead and quit. You are now configured.<br />
<br />
== Mounting the remote files ==<br />
Once configured, it's easy to mount your files when you need them.<br />
bone$ '''mkdir onedrive'''<br />
bone$ '''rclone mount onedrive: onedrive --daemon'''<br />
bone$ '''cd onedrive'''<br />
bone$ '''ls'''<br />
Attachments Desktop Documents 'Shared with Everyone'<br />
Those should be the top-level files in your Rose account.<br />
<br />
When you are done with it.<br />
bone$ '''sudo umount onedrive'''<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_04_Mounting_OneDrive&diff=580402EBC Exercise 04 Mounting OneDrive2023-12-11T20:23:21Z<p>Yoder: /* Configuring rclone */</p>
<hr />
<div>[[Category:ECE497]]<br />
[[Category:EmbeddedBeagleClass]]<br />
{{YoderHead}}<br />
<br />
Here are instructions on how to mount your Rose OneDrive files on your Beagle via '''rclone'''.<br />
<br />
[https://rclone.org/ rclone] is a command line program to sync files and directories to and from many different services, one of which is OneDrive.<br />
<br />
== Installing rclone ==<br />
Install rclone on both your host and your Bone (https://rclone.org/downloads/):<br />
bone$ '''sudo apt update'''<br />
bone$ '''sudo apt install rclone'''<br />
<br />
host$ '''sudo apt update'''<br />
host$ '''sudo apt install rclone'''<br />
<br />
Note: This method loads version 1.53<br />
<br />
== Configuring rclone ==<br />
Next configure on the machine you want to run it on. I'll show doing it on the Bone since it's a bit more involved.<br />
<br />
bone$ '''rclone config'''<br />
No remotes found - make a new one<br />
n) New remote<br />
s) Set configuration password<br />
q) Quit config<br />
n/s/q> '''n'''<br />
We're starting a new remote, so enter '''n'''<br />
<br />
name> '''onedrive'''<br />
Call it whatever you want, I'm using '''onedrive'''.<br />
Type of storage to configure.<br />
Enter a string value. Press Enter for the default ("").<br />
Choose a number from below, or type in your own value<br />
1 / 1Fichier<br />
\ "fichier"<br />
...<br />
12 / Google Drive<br />
\ "drive"<br />
13 / Google Photos<br />
\ "google photos"<br />
...<br />
22 / Microsoft OneDrive<br />
\ "onedrive"<br />
...<br />
Storage> '''22'''<br />
There are many choices, we want '''onedrive'''. Here's it's numbered 22, it may be different on yours.<br />
Microsoft App Client Id<br />
Leave blank normally.<br />
Enter a string value. Press Enter for the default ("").<br />
client_id> <br />
Leave this blank<br />
Microsoft App Client Secret<br />
Leave blank normally.<br />
Enter a string value. Press Enter for the default ("").<br />
client_secret> <br />
This blank too<br />
Option region.<br />
Choose national cloud region for OneDrive.<br />
Choose a number from below, or type in your own string value.<br />
Press Enter for the default (global).<br />
1 / Microsoft Cloud Global<br />
\ (global)<br />
2 / Microsoft Cloud for US Government<br />
\ (us)<br />
3 / Microsoft Cloud Germany<br />
\ (de)<br />
4 / Azure and Office 365 operated by Vnet Group in China<br />
\ (cn)<br />
region><br />
Also blank.<br />
<br />
Edit advanced config? (y/n)<br />
y) Yes<br />
n) No<br />
y/n> '''y'''<br />
We want '''y''' here<br />
<br />
Leave the next few blank until you get to '''drive_type'''<br />
token><br />
auth_url><br />
token_url><br />
chunk_size><br />
drive_id><br />
The type of the drive ( personal | business | documentLibrary )<br />
Enter a string value. Press Enter for the default ("").<br />
drive_type> '''business'''<br />
Enter '''business''' to get to your Rose OneDrive.<br />
<br />
There are several more that are blank.<br />
<br />
root_folder_id><br />
access_scopes><br />
expose_onenote_files><br />
server_side_across_configs><br />
list_chunk><br />
no_versions><br />
link_scope><br />
link_type><br />
link_password><br />
encoding><br />
<br />
Remote config<br />
Use auto config?<br />
* Say Y if not sure<br />
* Say N if you are working on a remote or headless machine<br />
y) Yes<br />
n) No<br />
y/n> '''n'''<br />
Here is where the host vs bone install differs. If you are on your host enter '''y'''.<br />
The Bone is headless, so enter '''n'''. Let's follow the Bone path since it's requires a bit more work.<br />
<br />
For this to work, you will need rclone available on a machine that has a web browser available.<br />
Execute the following on your machine (same rclone version recommended) :<br />
rclone authorize "onedrive"<br />
Then paste the result below:<br />
result> <br />
So, when installing on the Bone you need to run '''rclone authorize "onedrive"''' on your host.<br />
Note: there was a forth argument that I deleted to make it work.<br />
<br />
So without quitting the rclone install, run the command on your host. You will see<br />
host$ '''rclone authorize "onedrive"'''<br />
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=de0c54f8aa6e4694505435d0025af353<br />
Log in and authorize rclone for access<br />
Waiting for code...<br />
Got code<br />
Paste the following into your remote machine ---><br />
{"access_token":"eyJ0eXAiOiJKV1QiLCJub25jZSI6IktlaC1iX3lxWlZNUFh0aXpYczl0bHJMQ3dwMno3TFdWVXA0NHA4MGkxOHciLCJhbGciOiJSUzI1NiIsIng1dCI6ImFQY3R3X29kdlJPb0VOZzNWb09sSWgydGlFcyIsImtpZCI6ImFQY3R3X29kdlJPb0VOZzNWb09sSWg ...<br />
CiXlbeWkTuJIyHzz9ViTscTUTKL9mhTjagMRrFzH1y-AKc0KwKUOImMF1zObuJGUEVcjmrB7BYDwy6u0z2lz8PU092HTbh-S5GrmmVXiRDPWr2aSUUf31QLfjIAA","expiry":"2019-10-10T12:15:33.556943127-04:00"}<br />
<---End paste<br />
Follow the directions and login to your Rose OneDrive account. <br />
The copy the '''access_token''' from your host window and paste it into the rclone config window. You will see<br />
Choose a number from below, or type in an existing value<br />
1 / OneDrive Personal or Business<br />
\ "onedrive"<br />
2 / Root Sharepoint site<br />
\ "sharepoint"<br />
3 / Type in driveID<br />
\ "driveid"<br />
4 / Type in SiteID<br />
\ "siteid"<br />
5 / Search a Sharepoint site<br />
\ "search"<br />
Your choice> '''1'''<br />
Enter '''1''' for OneDrive. After a bit you will see<br />
Found 1 drives, please select the one you want to use:<br />
0: OneDrive (business) id=b!T2RYBL90GUuk6Tj5AyfQmSswgAAexZNCm9PUX6-Q-MBzqSd8jB3aSZVF5mbW4mJw<br />
Chose drive to use:> '''0'''<br />
There is only one choice, so take it. After a bit more<br />
Found drive 'root' of type 'business', URL: https://rosehulman-my.sharepoint.com/personal/yoder_rose-hulman_edu/Documents<br />
Is that okay?<br />
y) Yes<br />
n) No<br />
y/n> '''y'''<br />
Your's should have your Rose email. Enter '''y''' and you'll see<br />
--------------------<br />
[onedrive]<br />
type = onedrive<br />
drive_type = business<br />
token = <br />
{"access_token":"eyJ0eXAiOiJKV1QiLCJub25jZSI6I...lupXcXioJ1VlCIAA","expiry":"2019-10-10T13:47:11.125261755-04:00"}<br />
drive_id = b!T2RYBL90GUuk6Tj5AyfQmSswgAAexZNCm9PUX6-Q-MBzqSd8jB3aSZVF5mbW4mJw<br />
--------------------<br />
y) Yes this is OK<br />
e) Edit this remote<br />
d) Delete this remote<br />
y/e/d> '''y'''<br />
Looks good. Enter '''y'''<br />
Current remotes:<br />
<br />
Name Type<br />
==== ====<br />
onedrive onedrive <br />
<br />
e) Edit existing remote<br />
n) New remote<br />
d) Delete remote<br />
r) Rename remote<br />
c) Copy remote<br />
s) Set configuration password<br />
q) Quit config<br />
e/n/d/r/c/s/q> '''q'''<br />
Go ahead and quit. You are now configured.<br />
<br />
== Mounting the remote files ==<br />
Once configured, it's easy to mount your files when you need them.<br />
bone$ '''mkdir onedrive'''<br />
bone$ '''rclone mount onedrive: onedrive --daemon'''<br />
bone$ '''cd onedrive'''<br />
bone$ '''ls'''<br />
Attachments Desktop Documents 'Shared with Everyone'<br />
Those should be the top-level files in your Rose account.<br />
<br />
When you are done with it.<br />
bone$ '''sudo umount onedrive'''<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_04_Mounting_OneDrive&diff=580384EBC Exercise 04 Mounting OneDrive2023-12-09T16:51:15Z<p>Yoder: /* Configuring rclone */</p>
<hr />
<div>[[Category:ECE497]]<br />
[[Category:EmbeddedBeagleClass]]<br />
{{YoderHead}}<br />
<br />
Here are instructions on how to mount your Rose OneDrive files on your Beagle via '''rclone'''.<br />
<br />
[https://rclone.org/ rclone] is a command line program to sync files and directories to and from many different services, one of which is OneDrive.<br />
<br />
== Installing rclone ==<br />
Install rclone on both your host and your Bone (https://rclone.org/downloads/):<br />
bone$ '''sudo apt update'''<br />
bone$ '''sudo apt install rclone'''<br />
<br />
host$ '''sudo apt update'''<br />
host$ '''sudo apt install rclone'''<br />
<br />
Note: This method loads version 1.53<br />
<br />
== Configuring rclone ==<br />
Next configure on the machine you want to run it on. I'll show doing it on the Bone since it's a bit more involved.<br />
<br />
bone$ '''rclone config'''<br />
No remotes found - make a new one<br />
n) New remote<br />
s) Set configuration password<br />
q) Quit config<br />
n/s/q> '''n'''<br />
We're starting a new remote, so enter '''n'''<br />
<br />
name> '''onedrive'''<br />
Call it whatever you want, I'm using '''onedrive'''.<br />
Type of storage to configure.<br />
Enter a string value. Press Enter for the default ("").<br />
Choose a number from below, or type in your own value<br />
1 / 1Fichier<br />
\ "fichier"<br />
...<br />
12 / Google Drive<br />
\ "drive"<br />
13 / Google Photos<br />
\ "google photos"<br />
...<br />
22 / Microsoft OneDrive<br />
\ "onedrive"<br />
...<br />
Storage> '''22'''<br />
There are many choices, we want '''onedrive'''. Here's it's numbered 22, it may be different on yours.<br />
Microsoft App Client Id<br />
Leave blank normally.<br />
Enter a string value. Press Enter for the default ("").<br />
client_id> <br />
Leave this blank<br />
Microsoft App Client Secret<br />
Leave blank normally.<br />
Enter a string value. Press Enter for the default ("").<br />
client_secret> <br />
This blank too<br />
Edit advanced config? (y/n)<br />
y) Yes<br />
n) No<br />
y/n> '''y'''<br />
We want '''y''' here<br />
Chunk size to upload files with - must be multiple of 320k.<br />
<br />
Above this size files will be chunked - must be multiple of 320k. Note<br />
that the chunks will be buffered into memory.<br />
Enter a size with suffix k,M,G,T. Press Enter for the default ("10M").<br />
chunk_size><br />
Leave blank<br />
The ID of the drive to use<br />
Enter a string value. Press Enter for the default ("").<br />
drive_id> <br />
Leave blank<br />
The type of the drive ( personal | business | documentLibrary )<br />
Enter a string value. Press Enter for the default ("").<br />
drive_type> '''business'''<br />
Enter '''business''' to get to your Rose OneDrive<br />
Set to make OneNote files show up in directory listings.<br />
<br />
By default rclone will hide OneNote files in directory listings because<br />
operations like "Open" and "Update" won't work on them. But this<br />
behaviour may also prevent you from deleting them. If you want to<br />
delete OneNote files or otherwise want them to show up in directory<br />
listing, set this option.<br />
Enter a boolean value (true or false). Press Enter for the default ("false").<br />
expose_onenote_files> <br />
Hit Enter for the default<br />
<br />
Remote config<br />
Use auto config?<br />
* Say Y if not sure<br />
* Say N if you are working on a remote or headless machine<br />
y) Yes<br />
n) No<br />
y/n> '''n'''<br />
Here is where the host vs bone install differs. If you are on your host enter '''y'''.<br />
The Bone is headless, so enter '''n'''. Let's follow the Bone path since it's requires a bit more work.<br />
<br />
For this to work, you will need rclone available on a machine that has a web browser available.<br />
Execute the following on your machine (same rclone version recommended) :<br />
rclone authorize "onedrive"<br />
Then paste the result below:<br />
result> <br />
So, when installing on the Bone you need to run '''rclone authorize "onedrive"''' on your host.<br />
So without quitting the rclone install, run the command on your host. You will see<br />
host$ '''rclone authorize "onedrive"'''<br />
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=de0c54f8aa6e4694505435d0025af353<br />
Log in and authorize rclone for access<br />
Waiting for code...<br />
Got code<br />
Paste the following into your remote machine ---><br />
{"access_token":"eyJ0eXAiOiJKV1QiLCJub25jZSI6IktlaC1iX3lxWlZNUFh0aXpYczl0bHJMQ3dwMno3TFdWVXA0NHA4MGkxOHciLCJhbGciOiJSUzI1NiIsIng1dCI6ImFQY3R3X29kdlJPb0VOZzNWb09sSWgydGlFcyIsImtpZCI6ImFQY3R3X29kdlJPb0VOZzNWb09sSWg ...<br />
CiXlbeWkTuJIyHzz9ViTscTUTKL9mhTjagMRrFzH1y-AKc0KwKUOImMF1zObuJGUEVcjmrB7BYDwy6u0z2lz8PU092HTbh-S5GrmmVXiRDPWr2aSUUf31QLfjIAA","expiry":"2019-10-10T12:15:33.556943127-04:00"}<br />
<---End paste<br />
Follow the directions and login to your Rose OneDrive account. <br />
The copy the '''access_token''' from your host window and paste it into the rclone config window. You will see<br />
Choose a number from below, or type in an existing value<br />
1 / OneDrive Personal or Business<br />
\ "onedrive"<br />
2 / Root Sharepoint site<br />
\ "sharepoint"<br />
3 / Type in driveID<br />
\ "driveid"<br />
4 / Type in SiteID<br />
\ "siteid"<br />
5 / Search a Sharepoint site<br />
\ "search"<br />
Your choice> '''1'''<br />
Enter '''1''' for OneDrive. After a bit you will see<br />
Found 1 drives, please select the one you want to use:<br />
0: OneDrive (business) id=b!T2RYBL90GUuk6Tj5AyfQmSswgAAexZNCm9PUX6-Q-MBzqSd8jB3aSZVF5mbW4mJw<br />
Chose drive to use:> '''0'''<br />
There is only one choice, so take it. After a bit more<br />
Found drive 'root' of type 'business', URL: https://rosehulman-my.sharepoint.com/personal/yoder_rose-hulman_edu/Documents<br />
Is that okay?<br />
y) Yes<br />
n) No<br />
y/n> '''y'''<br />
Your's should have your Rose email. Enter '''y''' and you'll see<br />
--------------------<br />
[onedrive]<br />
type = onedrive<br />
drive_type = business<br />
token = <br />
{"access_token":"eyJ0eXAiOiJKV1QiLCJub25jZSI6I...lupXcXioJ1VlCIAA","expiry":"2019-10-10T13:47:11.125261755-04:00"}<br />
drive_id = b!T2RYBL90GUuk6Tj5AyfQmSswgAAexZNCm9PUX6-Q-MBzqSd8jB3aSZVF5mbW4mJw<br />
--------------------<br />
y) Yes this is OK<br />
e) Edit this remote<br />
d) Delete this remote<br />
y/e/d> '''y'''<br />
Looks good. Enter '''y'''<br />
Current remotes:<br />
<br />
Name Type<br />
==== ====<br />
onedrive onedrive <br />
<br />
e) Edit existing remote<br />
n) New remote<br />
d) Delete remote<br />
r) Rename remote<br />
c) Copy remote<br />
s) Set configuration password<br />
q) Quit config<br />
e/n/d/r/c/s/q> '''q'''<br />
Go ahead and quit. You are now configured.<br />
<br />
== Mounting the remote files ==<br />
Once configured, it's easy to mount your files when you need them.<br />
bone$ '''mkdir onedrive'''<br />
bone$ '''rclone mount onedrive: onedrive --daemon'''<br />
bone$ '''cd onedrive'''<br />
bone$ '''ls'''<br />
Attachments Desktop Documents 'Shared with Everyone'<br />
Those should be the top-level files in your Rose account.<br />
<br />
When you are done with it.<br />
bone$ '''sudo umount onedrive'''<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_04_Mounting_OneDrive&diff=580381EBC Exercise 04 Mounting OneDrive2023-12-09T16:50:13Z<p>Yoder: /* Installing rclone */</p>
<hr />
<div>[[Category:ECE497]]<br />
[[Category:EmbeddedBeagleClass]]<br />
{{YoderHead}}<br />
<br />
Here are instructions on how to mount your Rose OneDrive files on your Beagle via '''rclone'''.<br />
<br />
[https://rclone.org/ rclone] is a command line program to sync files and directories to and from many different services, one of which is OneDrive.<br />
<br />
== Installing rclone ==<br />
Install rclone on both your host and your Bone (https://rclone.org/downloads/):<br />
bone$ '''sudo apt update'''<br />
bone$ '''sudo apt install rclone'''<br />
<br />
host$ '''sudo apt update'''<br />
host$ '''sudo apt install rclone'''<br />
<br />
Note: This method loads version 1.53<br />
<br />
== Configuring rclone ==<br />
Next configure on the machine you want to run it on. I'll show doing it on the Bone since it's a bit more involved.<br />
<br />
bone$ '''rclone config'''<br />
No remotes found - make a new one<br />
n) New remote<br />
s) Set configuration password<br />
q) Quit config<br />
n/s/q> '''n'''<br />
We're starting a new remote, so enter '''n'''<br />
<br />
name> '''onedrive'''<br />
Call it whatever you want, I'm using '''onedrive'''.<br />
Type of storage to configure.<br />
Enter a string value. Press Enter for the default ("").<br />
Choose a number from below, or type in your own value<br />
1 / 1Fichier<br />
\ "fichier"<br />
...<br />
12 / Google Drive<br />
\ "drive"<br />
13 / Google Photos<br />
\ "google photos"<br />
...<br />
20 / Microsoft OneDrive<br />
\ "onedrive"<br />
...<br />
Storage> '''20'''<br />
There are many choices, we want '''onedrive'''. Here's it's numbered 20, it may be different on yours.<br />
Microsoft App Client Id<br />
Leave blank normally.<br />
Enter a string value. Press Enter for the default ("").<br />
client_id> <br />
Leave this blank<br />
Microsoft App Client Secret<br />
Leave blank normally.<br />
Enter a string value. Press Enter for the default ("").<br />
client_secret> <br />
This blank too<br />
Edit advanced config? (y/n)<br />
y) Yes<br />
n) No<br />
y/n> '''y'''<br />
We want '''y''' here<br />
Chunk size to upload files with - must be multiple of 320k.<br />
<br />
Above this size files will be chunked - must be multiple of 320k. Note<br />
that the chunks will be buffered into memory.<br />
Enter a size with suffix k,M,G,T. Press Enter for the default ("10M").<br />
chunk_size><br />
Leave blank<br />
The ID of the drive to use<br />
Enter a string value. Press Enter for the default ("").<br />
drive_id> <br />
Leave blank<br />
The type of the drive ( personal | business | documentLibrary )<br />
Enter a string value. Press Enter for the default ("").<br />
drive_type> '''business'''<br />
Enter '''business''' to get to your Rose OneDrive<br />
Set to make OneNote files show up in directory listings.<br />
<br />
By default rclone will hide OneNote files in directory listings because<br />
operations like "Open" and "Update" won't work on them. But this<br />
behaviour may also prevent you from deleting them. If you want to<br />
delete OneNote files or otherwise want them to show up in directory<br />
listing, set this option.<br />
Enter a boolean value (true or false). Press Enter for the default ("false").<br />
expose_onenote_files> <br />
Hit Enter for the default<br />
<br />
Remote config<br />
Use auto config?<br />
* Say Y if not sure<br />
* Say N if you are working on a remote or headless machine<br />
y) Yes<br />
n) No<br />
y/n> '''n'''<br />
Here is where the host vs bone install differs. If you are on your host enter '''y'''.<br />
The Bone is headless, so enter '''n'''. Let's follow the Bone path since it's requires a bit more work.<br />
<br />
For this to work, you will need rclone available on a machine that has a web browser available.<br />
Execute the following on your machine (same rclone version recommended) :<br />
rclone authorize "onedrive"<br />
Then paste the result below:<br />
result> <br />
So, when installing on the Bone you need to run '''rclone authorize "onedrive"''' on your host.<br />
So without quitting the rclone install, run the command on your host. You will see<br />
host$ '''rclone authorize "onedrive"'''<br />
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=de0c54f8aa6e4694505435d0025af353<br />
Log in and authorize rclone for access<br />
Waiting for code...<br />
Got code<br />
Paste the following into your remote machine ---><br />
{"access_token":"eyJ0eXAiOiJKV1QiLCJub25jZSI6IktlaC1iX3lxWlZNUFh0aXpYczl0bHJMQ3dwMno3TFdWVXA0NHA4MGkxOHciLCJhbGciOiJSUzI1NiIsIng1dCI6ImFQY3R3X29kdlJPb0VOZzNWb09sSWgydGlFcyIsImtpZCI6ImFQY3R3X29kdlJPb0VOZzNWb09sSWg ...<br />
CiXlbeWkTuJIyHzz9ViTscTUTKL9mhTjagMRrFzH1y-AKc0KwKUOImMF1zObuJGUEVcjmrB7BYDwy6u0z2lz8PU092HTbh-S5GrmmVXiRDPWr2aSUUf31QLfjIAA","expiry":"2019-10-10T12:15:33.556943127-04:00"}<br />
<---End paste<br />
Follow the directions and login to your Rose OneDrive account. <br />
The copy the '''access_token''' from your host window and paste it into the rclone config window. You will see<br />
Choose a number from below, or type in an existing value<br />
1 / OneDrive Personal or Business<br />
\ "onedrive"<br />
2 / Root Sharepoint site<br />
\ "sharepoint"<br />
3 / Type in driveID<br />
\ "driveid"<br />
4 / Type in SiteID<br />
\ "siteid"<br />
5 / Search a Sharepoint site<br />
\ "search"<br />
Your choice> '''1'''<br />
Enter '''1''' for OneDrive. After a bit you will see<br />
Found 1 drives, please select the one you want to use:<br />
0: OneDrive (business) id=b!T2RYBL90GUuk6Tj5AyfQmSswgAAexZNCm9PUX6-Q-MBzqSd8jB3aSZVF5mbW4mJw<br />
Chose drive to use:> '''0'''<br />
There is only one choice, so take it. After a bit more<br />
Found drive 'root' of type 'business', URL: https://rosehulman-my.sharepoint.com/personal/yoder_rose-hulman_edu/Documents<br />
Is that okay?<br />
y) Yes<br />
n) No<br />
y/n> '''y'''<br />
Your's should have your Rose email. Enter '''y''' and you'll see<br />
--------------------<br />
[onedrive]<br />
type = onedrive<br />
drive_type = business<br />
token = <br />
{"access_token":"eyJ0eXAiOiJKV1QiLCJub25jZSI6I...lupXcXioJ1VlCIAA","expiry":"2019-10-10T13:47:11.125261755-04:00"}<br />
drive_id = b!T2RYBL90GUuk6Tj5AyfQmSswgAAexZNCm9PUX6-Q-MBzqSd8jB3aSZVF5mbW4mJw<br />
--------------------<br />
y) Yes this is OK<br />
e) Edit this remote<br />
d) Delete this remote<br />
y/e/d> '''y'''<br />
Looks good. Enter '''y'''<br />
Current remotes:<br />
<br />
Name Type<br />
==== ====<br />
onedrive onedrive <br />
<br />
e) Edit existing remote<br />
n) New remote<br />
d) Delete remote<br />
r) Rename remote<br />
c) Copy remote<br />
s) Set configuration password<br />
q) Quit config<br />
e/n/d/r/c/s/q> '''q'''<br />
Go ahead and quit. You are now configured.<br />
<br />
== Mounting the remote files ==<br />
Once configured, it's easy to mount your files when you need them.<br />
bone$ '''mkdir onedrive'''<br />
bone$ '''rclone mount onedrive: onedrive --daemon'''<br />
bone$ '''cd onedrive'''<br />
bone$ '''ls'''<br />
Attachments Desktop Documents 'Shared with Everyone'<br />
Those should be the top-level files in your Rose account.<br />
<br />
When you are done with it.<br />
bone$ '''sudo umount onedrive'''<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_08_Mounting_a_Remote_Directory_via_sshfs&diff=580351EBC Exercise 08 Mounting a Remote Directory via sshfs2023-12-04T20:26:38Z<p>Yoder: /* Mounting */</p>
<hr />
<div>[[Category:ECE497]]<br />
<br />
{{YoderHead}}<br />
<br />
sshfs is a handy tool that lets you access a remote directory via ssh. Therefor you can have files on your Bone computer appear on your host computer.<br />
<br />
== Installing ==<br />
To make the Bone's files appear on your host.<br />
<br />
host$ '''sudo apt update'''<br />
host$ '''sudo apt install sshfs'''<br />
<br />
== Mounting ==<br />
Then make a directory where you want them to appear.<br />
<br />
host$ '''mkdir bone.files'''<br />
<br />
Then mount them. The '''192.168.7.2''' is the address of the bone.<br />
'''debian''' is the login name and the ''':.''' says to use debians home directory.<br />
(If you've set up the shortcuts you could just use '''ssh bone:. bone.files'''.)<br />
<br />
host$ '''sshfs debian@192.168.7.2:. bone.files'''<br />
host$ '''ls bone.files'''<br />
You should see the files in debian's home directory on the bone.<br />
<br />
== Unmounting ==<br />
When you are done run:<br />
host$ '''sudo umount bone.files'''<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_02_Setting_Up_Windows_Subsystem_for_Linux&diff=580348EBC Exercise 02 Setting Up Windows Subsystem for Linux2023-12-04T18:09:57Z<p>Yoder: /* Sharing the network */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
The Beagle can run standalone with a monitor and keyboard and mouse, but we use it in an ''iot'' mode where it's accessed <br />
through the network. When used this way an Linux host is used that is either a native install on a laptop (or desktop)<br />
or a virtual machine running under Windows.<br />
<br />
The purpose of this wiki is to introduce a third option, running in the Windows Subsystem of Linux (wsl).<br />
<br />
== The Windows Subsystem of Linux ==<br />
<br />
[https://docs.microsoft.com/en-us/windows/wsl/ wsl] lets developers run a GNU/Linux environment directly on Windows, unmodified, without the overhead of a traditional virtual machine or dualboot setup. Details about wsl can be found here: https://docs.microsoft.com/en-us/windows/wsl/about, or just googling for it. Here I'll highlight how to install and use is for the class.<br />
<br />
== Installing WSL ==<br />
Simply got to https://docs.microsoft.com/en-us/windows/wsl/install and follow the directions.<br />
In order to use certain features when working with the BeagleBone, you will need wsl 2. To check which version you have run the command below.<br />
host$ '''wsl.exe –l –v'''<br />
NAME STATE VERSION<br />
* Ubuntu Running 2<br />
<br />
The NAME is your distribution name and VERSION is the version of wsl you are running (1 or 2). If you have version 2 then you are good to go, otherwise, to switch to wsl 2 run:<br />
<br />
host$ '''wsl.exe --set-version <distribution name> 2'''<br />
host$ '''wsl.exe --set-default-version 2'''<br />
<br />
Run 'host$ wsl -l -v' again and you should see that wsl is now version 2.<br />
<br />
== Sharing the network ==<br />
We used ip masquerading to have the host computer share the network with the Beagle. Here you need to set up Windows to do the sharing.<br />
<br />
Once the Beagle is connected to your host computer running Windows 10, there should be an "ethernet connection" created over usb. <br />
<br />
To share your internet from Windows:<br />
[[File:NetworkConnections.jpg|frame]]<br />
* Right click the wifi or ethernet icon in your taskbar, and select the '''Open Network & Internet Settings''' option. <br />
* Once the window is opened, scroll to the bottom and press '''Change adapter options''' under '''Advanced network settings'''. <br />
* To share your internet, right click on the adapter that your host is using to access the internet, and select Properties. <br />
* Go to the sharing tab at the top, and check the '''Allow other network users to connect through this computer's Internet connection''' option. If you have multiple internet adapters, you might need to select the Bone using the drop down menu. It should be the adapter with the description '''Remote NDIS Compatible Device''' in the Network Connection window. <br />
* Press OK at the bottom, then <br />
* right click the adapter for the Bone (the one labled '''Remote NDIS Compatible Device'''), and press Properties. <br />
* Double click on the '''Internet Protocol Version 4''' option on the main tab, and <br />
* set both the IP address and DNS server addresses to be set automatically. <br />
* Press OK to go back to the Properties window and <br />
* press OK again.<br />
<br />
In WSL enter<br />
<br />
host$ '''sudo iptables -t nat -A POSTROUTING -s 192.168.7.2 -o eth0 -j MASQUERADE'''<br />
host$ '''sudo sysctl net.ipv4.ip_forward=1'''<br />
<br />
After that, ssh into the bone, and run the command <br />
host$ '''ssh bone'''<br />
bone$ '''sudo route add default gw 192.168.7.1'''<br />
(This command needs to be run every time you boot the Bone.)<br />
The Bone should now have access to the internet. If you disconnect the Bone from your host, you may have to stop sharing your internet and reshare it, then set the IP and DNS Addresses to be automatic again for it to work. <br />
<br />
You should be on the Internet now.<br />
<br />
bone$ '''ping -c2 google.com'''<br />
PING google.com (142.250.191.142) 56(84) bytes of data.<br />
64 bytes from ord38s29-in-f14.1e100.net (142.250.191.142): icmp_seq=1 ttl=112 time=8.35 ms<br />
64 bytes from ord38s29-in-f14.1e100.net (142.250.191.142): icmp_seq=2 ttl=112 time=8.43 ms<br />
<br />
--- google.com ping statistics ---<br />
2 packets transmitted, 2 received, 0% packet loss, time 1002ms<br />
rtt min/avg/max/mdev = 8.354/8.393/8.433/0.039 ms<br />
<br />
If pinging doesn't work, try editting '''/etc/resolv.conf''' on the bone and add the following line<br />
to the end of the file.<br />
<br />
nameserver 8.8.8.8<br />
nameserver 8.8.4.4<br />
<br />
{{YoderHead}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_02_Setting_Up_Windows_Subsystem_for_Linux&diff=580345EBC Exercise 02 Setting Up Windows Subsystem for Linux2023-12-04T17:47:57Z<p>Yoder: /* Sharing the network */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
The Beagle can run standalone with a monitor and keyboard and mouse, but we use it in an ''iot'' mode where it's accessed <br />
through the network. When used this way an Linux host is used that is either a native install on a laptop (or desktop)<br />
or a virtual machine running under Windows.<br />
<br />
The purpose of this wiki is to introduce a third option, running in the Windows Subsystem of Linux (wsl).<br />
<br />
== The Windows Subsystem of Linux ==<br />
<br />
[https://docs.microsoft.com/en-us/windows/wsl/ wsl] lets developers run a GNU/Linux environment directly on Windows, unmodified, without the overhead of a traditional virtual machine or dualboot setup. Details about wsl can be found here: https://docs.microsoft.com/en-us/windows/wsl/about, or just googling for it. Here I'll highlight how to install and use is for the class.<br />
<br />
== Installing WSL ==<br />
Simply got to https://docs.microsoft.com/en-us/windows/wsl/install and follow the directions.<br />
In order to use certain features when working with the BeagleBone, you will need wsl 2. To check which version you have run the command below.<br />
host$ '''wsl.exe –l –v'''<br />
NAME STATE VERSION<br />
* Ubuntu Running 2<br />
<br />
The NAME is your distribution name and VERSION is the version of wsl you are running (1 or 2). If you have version 2 then you are good to go, otherwise, to switch to wsl 2 run:<br />
<br />
host$ '''wsl.exe --set-version <distribution name> 2'''<br />
host$ '''wsl.exe --set-default-version 2'''<br />
<br />
Run 'host$ wsl -l -v' again and you should see that wsl is now version 2.<br />
<br />
== Sharing the network ==<br />
We used ip masquerading to have the host computer share the network with the Beagle. Here you need to set up Windows to do the sharing.<br />
<br />
Once the Beagle is connected to your host computer running Windows 10, there should be an "ethernet connection" created over usb. <br />
<br />
To share your internet from Windows:<br />
[[File:NetworkConnections.jpg|frame]]<br />
* Right click the wifi or ethernet icon in your taskbar, and select the '''Open Network & Internet Settings''' option. <br />
* Once the window is opened, scroll to the bottom and press '''Change adapter options''' under '''Advanced network settings'''. <br />
* To share your internet, right click on the adapter that your host is using to access the internet, and select Properties. <br />
* Go to the sharing tab at the top, and check the '''Allow other network users to connect through this computer's Internet connection''' option. If you have multiple internet adapters, you might need to select the Bone using the drop down menu. It should be the adapter with the description '''Remote NDIS Compatible Device''' in the Network Connection window. <br />
* Press OK at the bottom, then <br />
* right click the adapter for the Bone (the one labled '''Remote NDIS Compatible Device'''), and press Properties. <br />
* Double click on the '''Internet Protocol Version 4''' option on the main tab, and <br />
* set both the IP address and DNS server addresses to be set automatically. <br />
* Press OK to go back to the Properties window and <br />
* press OK again.<br />
After that, ssh into the bone, and run the command <br />
bone$ '''sudo route add default gw 192.168.7.1'''<br />
(This command needs to be run every time you boot the Bone.)<br />
The Bone should now have access to the internet. If you disconnect the Bone from your host, you may have to stop sharing your internet and reshare it, then set the IP and DNS Addresses to be automatic again for it to work. <br />
<br />
You should be on the Internet now.<br />
<br />
bone$ '''ping -c2 google.com'''<br />
PING google.com (142.250.191.142) 56(84) bytes of data.<br />
64 bytes from ord38s29-in-f14.1e100.net (142.250.191.142): icmp_seq=1 ttl=112 time=8.35 ms<br />
64 bytes from ord38s29-in-f14.1e100.net (142.250.191.142): icmp_seq=2 ttl=112 time=8.43 ms<br />
<br />
--- google.com ping statistics ---<br />
2 packets transmitted, 2 received, 0% packet loss, time 1002ms<br />
rtt min/avg/max/mdev = 8.354/8.393/8.433/0.039 ms<br />
<br />
If pinging doesn't work, try editting '''/etc/resolv.conf''' on the bone and add the following line<br />
to the end of the file.<br />
<br />
nameserver 8.8.8.8<br />
nameserver 8.8.4.4<br />
<br />
{{YoderHead}}</div>Yoderhttps://elinux.org/index.php?title=User:Sappon&diff=580252User:Sappon2023-11-29T17:52:33Z<p>Yoder: </p>
<hr />
<div>Student at Rose-Hulman Institute of Technology</div>Yoderhttps://elinux.org/index.php?title=User:Ethanswallow&diff=580249User:Ethanswallow2023-11-29T17:52:18Z<p>Yoder: Blanked the page</p>
<hr />
<div></div>Yoderhttps://elinux.org/index.php?title=User:Krakorlr&diff=580246User:Krakorlr2023-11-29T17:51:49Z<p>Yoder: Blanked the page</p>
<hr />
<div></div>Yoderhttps://elinux.org/index.php?title=User:Bejlovba&diff=580243User:Bejlovba2023-11-29T17:51:19Z<p>Yoder: </p>
<hr />
<div>Computer engineering major at Rose-Hulman, 2024</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_06_Connecting_without_ssh&diff=580240EBC Exercise 06 Connecting without ssh2023-11-29T17:46:21Z<p>Yoder: /* Connect with a virtual serial port */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
What do you do if your Bone is booting up, but you can't connect with ssh? Here are two things to try.<br />
<br />
== Connect with a virtual serial port ==<br />
<br />
Many things must happen for the network to boot up and accept an ssh connection. <br />
Long before the network is ready, the Bone opens a virtual serial port that you can connect to.<br />
<br />
Connect your bone to the host via the USB cable and wait for it to boot. If you can't ssh from the host,<br />
run the following on the host:<br />
host$ '''ls /dev/tty*'''<br />
/dev/tty /dev/tty2 /dev/tty31 /dev/tty43 /dev/tty55 '''/dev/ttyACM0''' /dev/ttyS19 /dev/ttyS30<br />
/dev/tty0 /dev/tty20 /dev/tty32 /dev/tty44 /dev/tty56 /dev/ttyprintk /dev/ttyS2 /dev/ttyS31<br />
/dev/tty1 /dev/tty21 /dev/tty33 /dev/tty45 /dev/tty57 /dev/ttyS0 /dev/ttyS20 /dev/ttyS4<br />
/dev/tty10 /dev/tty22 /dev/tty34 /dev/tty46 /dev/tty58 /dev/ttyS1 /dev/ttyS21 /dev/ttyS5<br />
/dev/tty11 /dev/tty23 /dev/tty35 /dev/tty47 /dev/tty59 /dev/ttyS10 /dev/ttyS22 /dev/ttyS6<br />
/dev/tty12 /dev/tty24 /dev/tty36 /dev/tty48 /dev/tty6 /dev/ttyS11 /dev/ttyS23 /dev/ttyS7<br />
/dev/tty13 /dev/tty25 /dev/tty37 /dev/tty49 /dev/tty60 /dev/ttyS12 /dev/ttyS24 /dev/ttyS8<br />
/dev/tty14 /dev/tty26 /dev/tty38 /dev/tty5 /dev/tty61 /dev/ttyS13 /dev/ttyS25 /dev/ttyS9<br />
/dev/tty15 /dev/tty27 /dev/tty39 /dev/tty50 /dev/tty62 /dev/ttyS14 /dev/ttyS26<br />
/dev/tty16 /dev/tty28 /dev/tty4 /dev/tty51 /dev/tty63 /dev/ttyS15 /dev/ttyS27<br />
/dev/tty17 /dev/tty29 /dev/tty40 /dev/tty52 /dev/tty7 /dev/ttyS16 /dev/ttyS28<br />
/dev/tty18 /dev/tty3 /dev/tty41 /dev/tty53 /dev/tty8 /dev/ttyS17 /dev/ttyS29<br />
/dev/tty19 /dev/tty30 /dev/tty42 /dev/tty54 /dev/tty9 /dev/ttyS18 /dev/ttyS3<br />
<br />
There are a number of tty's out there, but the one we want is <code>/dev/ttyACM0</code> (highlighted above).<br />
You can connect to it via the '''screen''' command.<br />
host$ '''sudo apt update'''<br />
host$ '''sudo apt install screen'''<br />
host$ '''ls -ls /dev/ttyACM0'''<br />
0 crw-rw---- 1 root dialout 166, 0 Dec 26 15:37 /dev/ttyACM0<br />
host$ '''sudo adduser $USER dialout'''<br />
host$ '''screen /dev/ttyUSB0 115200'''<br />
bone login: '''debian'''<br />
You have to be in the group ''dialout'' to access <code>/dev/ttyACM0</code><br />
<br />
You may have to hit ''Enter'' a couple of times to get the login prompt.<br />
<br />
You can now access your Bone, but it's a slower connection (115200 bits per second)<br />
When you are done you can exit <code>screen</code> by entering Ctrl-A followed by \. When prompted, hit <code>y</code>.<br />
<br />
== No Virtual Port ==<br />
What if you don't see <code>/dev/ttyACM0</code>? See https://elinux.org/EBC_Exercise_21a_Boot_Sequence to learn how to connect a FTDI cable. <br />
The FTDI serial port allows you to see what the U-boot boot loader is doing, even before the kernel starts.</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_02_Out-of-the-Box,_Bone&diff=580237EBC Exercise 02 Out-of-the-Box, Bone2023-11-29T12:54:58Z<p>Yoder: /* ssh and changing the password */ Added RNDIS link</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
{{EBC3.8}}'''These instructions are for the 3.8 and newer kernels.''' [[EBC Exercise 02 Out-of-the-Box, Bone 3.2 Kernel]] has instructions for the 3.2 kernel.<br />
<br />
== Internet Connection to the Outside World ==<br />
Once the Bone can connect to the host, the host can be used for forward requests from the Bone to the Internet. Follow the instructions below to set up your host and Bone so the bone can access the internet through your host.<br />
<br />
=== Linux ===<br />
==== Setting up VirtualBox ====<br />
If you are running a virtual machine make sure the guest OS (Ubuntu) has captured the USB from the host OS (Windows).<br />
[[EBC_Exercise_01_Start_Here#The_Linux_host_computer]] shows how to install Guest Additions on VirtualBox. Once installed<br />
be sure to capture the USB by going to <code>Devices:USB</code> and select the Beagle. Then go to <code>Devices:USB settings...</code><br />
Click on the ''Add'' icon on the right and check the Beagle. This will make it permanent.<br />
<br />
==== See your networks with ip a ====<br />
Run:<br />
<br />
host$ '''ip a'''<br />
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000<br />
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br />
inet 127.0.0.1/8 scope host lo<br />
valid_lft forever preferred_lft forever<br />
inet6 ::1/128 scope host <br />
valid_lft forever preferred_lft forever<br />
2: '''enp0s25''': <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000<br />
link/ether 54:ee:75:19:8d:53 brd ff:ff:ff:ff:ff:ff<br />
inet 10.0.4.102/24 brd 10.0.4.255 scope global dynamic noprefixroute enp0s25<br />
valid_lft 84299sec preferred_lft 84299sec<br />
inet6 fe80::e6d0:8d85:4488:6b5f/64 scope link noprefixroute <br />
valid_lft forever preferred_lft forever<br />
5: wlp3s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000<br />
link/ether 28:b2:bd:03:68:d0 brd ff:ff:ff:ff:ff:ff<br />
6: gpd0: <POINTOPOINT,MULTICAST,NOARP> mtu 1400 qdisc fq_codel state DOWN group default qlen 500<br />
link/none <br />
inet 137.112.193.14/32 scope global gpd0<br />
valid_lft forever preferred_lft forever<br />
28: enx1cba8ca2ed6d: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000<br />
link/ether 1c:ba:8c:a2:ed:6d brd ff:ff:ff:ff:ff:ff<br />
inet 192.168.6.1/24 brd 192.168.6.255 scope global dynamic noprefixroute enx1cba8ca2ed6d<br />
valid_lft 932sec preferred_lft 932sec<br />
inet6 fe80::3ad0:6711:a2ec:50f0/64 scope link noprefixroute <br />
valid_lft forever preferred_lft forever<br />
29: enx1cba8ca2ed6b: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000<br />
link/ether 1c:ba:8c:a2:ed:6b brd ff:ff:ff:ff:ff:ff<br />
inet 192.168.7.1/24 brd 192.168.7.255 scope global dynamic noprefixroute enx1cba8ca2ed6b<br />
valid_lft 1125sec preferred_lft 1125sec<br />
inet6 fe80::cd04:f44f:cf68:f98a/64 scope link noprefixroute <br />
valid_lft forever preferred_lft forever<br />
<br />
Note the name associated with the local connection between you Linux host and the Internet. In my case it's '''enp0s25'''. We'll use it later.<br />
<br />
==== ssh and changing the password ====<br />
You'll see two new networks have appeared, '''enx1cba8ca2ed6d''' and '''enx1cba8ca2ed6b''' in my case. The IP address of your host is '''192.168.7.1'''. There's a good chance the Bone is at '''192.168.7.''2'''''. Try connecting to it. The default password is '''temppwd'''.<br />
host$ '''ssh debian@192.168.7.2'''<br />
bone$ <br />
You are now logged into the Bone through the network. This is much faster than the serial port (.115M vs. 100M) and supports many interesting network operations. <br />
<br />
Note: If the '''ssh''' fails and you are running WSL, try following the instructions<br />
here https://forum.beagleboard.org/t/debian-12-x-major-changes-ncm-only-iwd-for-wifi/36176 to enable RNDIS.<br />
<br />
Take a look around. What do you find?<br />
<br />
Since everyone knows the default password, change it to something else.<br />
<br />
bone$ '''passwd'''<br />
Changing password for debian.<br />
(current) UNIX password:<br />
Enter new UNIX password: <br />
Retype new UNIX password: <br />
passwd: password updated successfully<br />
<br />
The only problem is, the Beagle doesn't know how to access the Internet through the host. Get back to the host computer:<br />
<br />
bone$ '''exit'''<br />
<br />
==== Setting up shortcuts to make life easier ====<br />
We'll be ssh'ing from the host to the bone often, here are some shortcuts I use so instead of typing '''ssh debian@192.168.7.2''' and a password every time.<br />
I can enter '''ssh bone''' and no password.<br />
<br />
First edit '''/etc/hosts''' and add a couple of lines.<br />
<br />
host$ '''sudo nano /etc/hosts'''<br />
<br />
You may use whatever editor you want. I suggest '''nano''' since it's easy to figure out. Add the following to the end of /etc/hosts and quit the editor.<br />
<br />
192.168.7.2 bone<br />
192.168.8.1 bone2<br />
<br />
If you are running wsl you need to edit '''/etc/wsl.conf''' or else these changes will be overwritten.<br />
<br />
host$ '''sudo nano /etc/wsl.conf'''<br />
<br />
To stop the overwrite process, simply add the following then save and exit.<br />
<br />
[network]<br />
generateHosts = false<br />
<br />
Now you can connect with<br />
host$ '''ssh debian@bone'''<br />
<br />
Let's make it so you don't have to enter '''debian'''. On your host computer, put the following in '''~/.ssh/config''' (Note: ~ is a shortcut for your home directory.)<br />
<br />
Host bone<br />
User debian<br />
UserKnownHostsFile /dev/null<br />
StrictHostKeyChecking no<br />
<br />
Host bone2<br />
User debian<br />
UserKnownHostsFile /dev/null<br />
StrictHostKeyChecking no<br />
<br />
These say that whenever you login to bone or bone2, login as '''debian'''.<br />
Now you can enter.<br />
<br />
host$ '''ssh bone'''<br />
<br />
One last thing, let's make it so you don't have to add a password.<br />
Back to your host.<br />
<br />
host$ '''ssh-keygen'''<br />
Accept all the defaults and then<br />
host$ '''ssh-copy-id bone'''<br />
Now all you have to enter is<br />
host$ '''ssh bone'''<br />
and no password is required.<br />
If you, especially virtual machine users, get an error says "sign_and_send_pubkey: signing failed: agent refused operation", you can solve this by entering<br />
host$ '''ssh-add'''<br />
which adds the private key identities to the authentication agent. Then you should be able to<br />
host$ '''ssh bone'''<br />
without problems.<br />
<br />
==== Setting up a root login ====<br />
By default the image we are running doesn't allow a root login. You can always '''sudo''' from debian, but sometimes it's nice to login as root. Here's how to setup root so you can login from your host without a password.<br />
<br />
host$ '''ssh bone'''<br />
bone$ '''sudo bash'''<br />
root@bone# '''nano /etc/ssh/sshd_config'''<br />
<br />
Search for the line<br />
#PermitRootLogin prohibit-password<br />
and change it to<br />
PermitRootLogin yes<br />
<br />
(The # symbol indicates a comment and must be removed in order for the setting to take effect.) <br />
<br />
Save the file and quit the editor. Restart ssh so it will reread the file.<br />
root@bone# '''systemctl restart sshd'''<br />
<br />
And assign a password to root.<br />
root@bone# '''passwd'''<br />
<br />
Now open another window on your host computer and enter:<br />
host$ '''ssh-copy-id root@bone'''<br />
and enter the root password. Test it with:<br />
host$ '''ssh root@bone'''<br />
You should be connected without a password. Now go back to the Bone and turn off the root password access.<br />
<br />
root@bone# '''nano /etc/ssh/sshd_config'''<br />
Restore the line:<br />
#PermitRootLogin prohibit-password<br />
and restart sshd.<br />
root@bone# '''systemctl restart sshd'''<br />
root@bone# '''exit'''<br />
bone$ '''exit'''<br />
<br />
You should now be able to got back to your host computer and login as root on the bone without a password.<br />
host$ '''ssh root@bone'''<br />
<br />
You have access to your bone without passwords only from you host computer. Try it from another computer and see what happens.<br />
<br />
==== Set Up Git ====<br />
<br />
We need to run some files that are in the class '''git''' repository. We'll learn more about using git later. Here I'll just show you how to get the files. Here we are installing these files on your host computer, later we'll install them on your Beagle.<br />
<br />
On my host computer I had to run<br />
<br />
host$ '''sudo apt update'''<br />
host$ '''sudo apt install git'''<br />
<br />
==== Make Room for Files ====<br />
(Note: the following should be done automatically the first time you reboot your bone.<br />
Try it, reboot and if you see your whole SD card you can skip to the next section.)<br />
<br />
Check out bb-growpart and bb-resizefs on Bullseye.<br />
<br />
<br />
Connect to your Beagle and see how much free disk space you have:<br />
<br />
host$ '''ssh bone'''<br />
bone$ '''df -h'''<br />
Filesystem Size Used Avail Use% Mounted on<br />
udev 215M 0 215M 0% /dev<br />
tmpfs 49M 1.6M 47M 4% /run<br />
/dev/mmcblk0p1 7.4G 3.7G 3.4G 53% /<br />
tmpfs 243M 0 243M 0% /dev/shm<br />
tmpfs 5.0M 0 5.0M 0% /run/lock<br />
tmpfs 243M 0 243M 0% /sys/fs/cgroup<br />
tmpfs 49M 0 49M 0% /run/user/1000<br />
<br />
'''/dev/mmcblk0p1''' has some 7.4G and 3.4G is still available. You probably have just shy of 4G and not much available.<br />
What's going on here? You should have a least an 8G card, but 8G isn't showing up? <br />
It turns out the image you downloaded was for a 4G card, so it isn't set up to use you whole memory card. <br />
The solution is one command away.<br />
bone$ '''/opt/scripts/tools/grow_partition.sh'''<br />
This will grow your partition to fill your whole card. A reboot is necessary:<br />
bone$ '''reboot'''<br />
Once rebooted,<br />
host$ '''ssh bone'''<br />
bone$ '''df -h'''<br />
and you should see plenty of disk space.<br />
<br />
==== Get the Files ====<br />
<br />
It only takes one command to pull down all the files.<br />
<br />
host$ '''git clone https://github.com/MarkAYoder/BeagleBoard-exercises.git exercises --depth=1'''<br />
(The whole repo is some 1013M. Using '''--depth=1''' you only get the recent history and it only takes 200M.)<br />
<br />
This will take a while since it's getting all the course files, including pdf files of the course PowerPoint.<br />
<br />
==== Running ipMasquerade.sh ====<br />
Now that the files are installed, run:<br />
host$ '''cd exercises/setup'''<br />
host$ '''./ipMasquerade.sh ''enp0s25'''''<br />
Plug in for ''enp0s25'' whatever is returned when you run '''ip a''' earlier.<br />
This will give you instructions on how to set up your host.<br />
Note: If you are using a wireless connection you should use<br />
<br />
host$ '''./ipMasquerade.sh ''wlp16s0'''''<br />
where ''wlp16s0'' is what is returned by '''ip a''' for your wireless connection on your host.<br />
<br />
Once ./ipMasquerade.sh has been run you can:<br />
host$ '''./firstssh.sh'''<br />
Now you should have network access on the Bone.<br />
bone$ '''ping -c2 google.com'''<br />
<br />
You should see Google responding.<br />
<br />
Congratulations! Your Beagle is now on the network through your host computer.<br />
<br />
You will have to run '''ipMasquerade.sh''' only after rebooting your host computer and run '''firstssh.sh''' after rebooting your bone. Once '''firstssh''' has be run you should ssh from your host with the standard ssh command.<br />
<br />
====Troubleshooting====<br />
<br />
=====Unknown Host=====<br />
<br />
If you get an unknown host response when attempting to ping google.com, and you are off campus, try pinging the Google DNS by IP address. Run:<br />
<br />
bone$ '''ping 8.8.8.8'''<br />
<br />
If you are on campus, run:<br />
<br />
bone$ '''ping 137.112.5.28'''<br />
<br />
If you now see responses by pinging a specific IP, it is possible that a firewall on your host computer is blocking the Beagle's access to the DNS when attempting to ping by domain name. On Ubuntu/Mint, run:<br />
<br />
host$ '''sudo ufw disable'''<br />
Firewall stopped and disabled on system startup<br />
<br />
You should get a response, such as above, that the firewall will be disabled upon next startup. After saving anything important, restart your host through the start menu or run:<br />
<br />
host$ '''reboot'''<br />
<br />
Repeat this exercise and attempt to ping Google by domain name again. If you now receive responses, then the firewall was indeed the issue. Otherwise, the internet is your friend. Use your host computer to try and find a solution. Feel free to add solutions here when you find them<br />
<br />
=====NetworkManager Issues=====<br />
<br />
If you continue to have problems with '''firstssh.sh''' and receive errors regarding the network manager command line tool (nmcli) such as:<br />
mv: cannot stat '/etc/resolv.conf'<br />
or<br />
nmcli failed, trying older 'list' instead of 'show'<br />
nmncli failed again, giving up. . .<br />
then you may have success with the following solution.<br />
<br />
Access your bone with '''ssh bone''' and check to see which network interface is tethered to your host. It should be usb0, already assigned the ip address of '''192.168.7.2.''' If so, simply enter the following in the command line:<br />
bone$ '''route add default gw 192.168.7.1'''<br />
<br />
Now return to your host machine and check what your internet facing interface is. It should be some '''eno''' interface for a wired connection or '''wlp''' interface for wireless. Your Bone should be on one of the usb ports, starting with '''enx''' and showing an ip address for your host machine of '''192.168.7.1.''' The example commands below will use '''wlp''' in place of the internet facing interface and '''enx''' in place of the Bone interface.<br />
host$ '''iptables --table nat --append POSTROUTING --out-interface wlp -j MASQUERADE'''<br />
host$ '''iptables --append FORWARD --in-interface enx -j ACCEPT'''<br />
host$ '''echo 1 > /proc/sys/net/ipv4/ip_forward'''<br />
<br />
You should now ssh into your Bone and see if the routing change has worked. These commands are essentially what the '''ipMasquerade.sh''' and '''firstssh.sh''' scripts already do, but I started to encounter problems with them and had more success performing the operations manually.<br />
<br />
=== OS X ===<br />
I haven't checked these instructions this year. Please report your results and update if needed.<br />
<br />
# go to '''System Preferences''' and select '''Network'''<br />
# You should see '''RNDIS/...Gadget'''. This is the network connection to the Beagle. Select it<br />
# Wait for the IP address '''192.168.7.1''' to appear<br />
# Click '''Show All''' and select '''Sharing'''<br />
# Select '''Internet Sharing'''<br />
# Select '''RNDIS/Ethernet Gadget'''<br />
<br />
In a terminal window connect to the serial port<br />
<br />
host$ '''screen /dev/ttyusb*B 115200'''<br />
bone$ '''udhcpc -i usb0'''<br />
bone$ '''ping google.com'''<br />
<br />
This is all nicely shown [http://www.youtube.com/watch?v=Cf9hnscbSK8&feature=youtu.be here] in this silent YouTube movie.<br />
<br />
Congratulations, you now have a connection from your BeagleBone to the Internet.<br />
<br />
=== Windows 7 ===<br />
I haven't checked these either. Please report results and update if needed.<br />
<br />
There are several ways of running ssh on Windows 7. Below are a couple of tools that you can use.<br />
<br />
==== Environment Setup ====<br />
<br />
You can either run ssh from a bash terminal (i.e. '''C:\Program Files\Git\Git Bash''' or '''C:\cygwin\Cygwin.bat'''), or you can add the bin directories to your path and run from the Windows command prompt (i.e. add '''C:\Program Files\Git\bin''' or '''C:\cygwin\bin''' to your path).<br />
<br />
Note: Be careful adding multiple bin directories to your path<br />
<br />
First time setup<br />
# Run '''regedit'''<br />
# Navigate to '''Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters'''<br />
# Change '''IPEnableRouter''' from 0 to 1<br />
# Close '''regedit'''<br />
# Run '''services'''<br />
# Make sure the following are set to '''Automatic''' and are started<br />
## Routing and Remote Access<br />
## Internet Connection Sharing (ICS)<br />
<br />
==== Connecting to the Internet ====<br />
<br />
After ejecting<br />
# Navigate to '''Control Panel\Network and Internet\Network and Sharing Center\Change adapter settings'''<br />
# Right click your wired/wireless internet connection and go to '''Properties'''<br />
# Go to the '''Sharing''' tab<br />
# Check the box to '''Allow other network users to connect through this computer's Internet connection'''<br />
# Select your bone's local area connection for the '''Home networking connection''' (if you cannot choose the local area connection, turn your internet connection sharing off and then back on)<br />
# Return to '''Change adapter settings'''<br />
# Right click your Bone's internet connection and go to '''Properties'''<br />
# Select '''Internet Protocol Version 4 (TCP/IPv4)''' and choose '''Properties'''<br />
# Choose '''Obtain an IP address automatically''' and '''Obtain DNS server address automatically'''<br />
<br />
Open a command prompt or bash terminal and run the following:<br />
<br />
host$ '''ping 192.168.7.2'''<br />
<br />
If this ping times out then disable and re-enable your bone's local area connection and try again. Once it works run the following:<br />
<br />
host$ '''ssh root@192.168.7.2'''<br />
<br />
Login as root and run the following:<br />
<br />
bone$ '''echo "nameserver 8.8.8.8" > /etc/resolv.conf'''<br />
bone$ '''echo "nameserver 8.8.8.4" >> /etc/resolv.conf'''<br />
bone$ '''/sbin/route add default gw 192.168.7.1'''<br />
bone$ '''ping google.com'''<br />
<br />
If 'ping:unknown host google.com' occurs, run this instead:<br />
<br />
bone$ '''echo "nameserver 137.112.4.196" > /etc/resolv.conf'''<br />
bone$ '''/sbin/route add default gw 192.168.7.1'''<br />
bone$ '''ping google.com'''<br />
<br />
Congratulations, you now have a connection from your BeagleBone through your Linux host to the Internet.<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=ECE434_Project_-_Vehicle_Telemetry&diff=580192ECE434 Project - Vehicle Telemetry2023-11-27T21:20:49Z<p>Yoder: </p>
<hr />
<div>[[Category:ECE434Fall2022 |PVehicle Telemetry]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Sqz|Jason Su]] [[user:harris|Harris Wu]]<br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
Add Extras<br />
<br />
09 Executive Summary<br />
09 Packaging<br />
09 Installation Instructions <br />
09 User Instructions<br />
09 Highlights<br />
09 Theory of Operation<br />
09 Work Breakdown<br />
09 Future Work/Conclusions<br />
09 Hackster.io<br />
09 Demo/Poster<br />
00 Not Late<br />
<br />
Score: 90/100<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project uses a beaglebone with a cape to build a data logger for vehicles. It uses an extended Kalman filter to integrate GPS and IMU data to achieve a decimeter level accuracy for the position and velocity of a vehicle, and combine with data logged from the CAN bus to build a server. The server is able to real time visualize the data on a webpage. It can be used as a platform for implementing some apps, such as lap time, accel/brake time for analysis purpose.<br />
<br />
== Packaging ==<br />
A beaglebone cape with IMU, GPS and CAN transceiver. <br />
<br />
GPS breakout board: https://www.adafruit.com/product/746 <br />
<br />
IMU breakout board: https://www.amazon.com/HiLetgo-MPU-6050-Accelerometer-Gyroscope-Converter/dp/B078SS8NQV <br />
<br />
CAN transceiver: https://www.ti.com/product/SN65HVD230 <br />
<br />
<br />
== Installation Instructions ==<br />
'''Hardware'''<br />
<br />
1. Connect GPS to UART <br />
<br />
2. Connect IMU to I2C2<br />
<br />
3. Connect CAN to CAN1<br />
<br />
'''Software'''<br />
<br />
1. Put BB-I2C2-MPU6050 into uEnv.txt and reboot.<br />
<br />
2. Get the project:<br />
$ git clone git@github.com:Sqzlnsy/ece434Project.git<br />
<br />
3. Run ece434Project/install.sh and you can go to step 7 <br />
<br />
4. Set up MPU6050 on I2C2 at 0x68:<br />
$ cd /sys/class/i2c-adapter/i2c-2<br />
$ echo mpu6050 0x68 > new_device<br />
<br />
5. Install gpsd: <br />
$ sudo apt-get install gpsd<br />
<br />
6. Install python-can: <br />
$ pip install python-can<br />
<br />
7. Config gpsd:<br />
$ nano /etc/default/gpsd<br />
You will see the config file and change DEVICES="/dev/ttyS0" to the port you use. (ttyS0 is uart1)<br />
<br />
8. Run setup.sh<br />
<br />
git site: https://github.com/Sqzlnsy/ece434Project<br />
<br />
== User Instructions ==<br />
1. Go to the project directory<br />
$ cd ece434Project<br />
1. Run make to compile if needed<br />
$ make <br />
3. Check the status gpsd: <br />
cgps //It may take a couple of minutes for the GPS to capture enough satellites depending on the weather and area. <br />
<br />
4. Connect to the OBDII port on your car.<br />
<br />
5. Check the connection of CAN bus:<br />
candump can1<br />
<br />
6. If you can see gps information using cpgs, and can messages using candump, you are ready to start the program.<br />
<br />
7. Run run_background.sh (Terminate the program by run process_terminate.sh)<br />
<br />
8. Go to http://192.168.7.2:8081/ to see the real-time visualized data<br />
<br />
<br />
== Highlights ==<br />
We are almost able to get all the data that OBD2 Interface provides. How OBD2 works is that it listens for request and if you send it a request it will return you a data.<br />
<br />
We have both front end task (server.py) and backend task (futionT), front end uses canvas to plot the data which came from back end, it drags multiple lines from the datalog file (see data folder) and plot them all at a specific frequency (see server.sh and js file in the templates)<br />
<br />
The back end is the one that consumes the CPU Usage the most. Since this device is used to record the data in the vehicle, we want to ensure that it keeps updating at a certain frequency. The maximum frequency that IMU can sample is 160 Hz, but we noticed that it takes too much CPU usage (>=92%), we lowered this frequency to 100Hz. Another reason why we lowered the frequency is that for our non real time kernels, it is difficult to make the sampling rate exactly as expected. <br />
<br />
Include a [http://www.youtube.com/ YouTube] demo the audio description.<br />
<br />
== Theory of Operation ==<br />
<br />
For gps, we used gpsd module to get the data from the peripheral. To be specific, we used gpsstream() to read the data from the device.<br />
For IMU, we used I2c to communicate with the device. What we did was simply adding the device tree to the kernel and constantly read the raw data from the device tree and process the data in our program. Save the processed raw data and send it to the Kalman filter.<br />
For CAN, we used python and a can transceiver to communicate with the vehicle. It is able to get the data after sending a request to the vehicle. See CAN_LOG.py<br />
Front End Task: We used canvas to plot the data in the localhost, the port is at 8082 so the website that you need to go to is http://192.168.7.2:8082/ after the server.py and fusionT both starts. In the website, multiple plots can be added to the page upon click on the options e.g. AccelerationX, Acceleration Y, RPM etc.<br />
<br />
== Work Breakdown ==<br />
<br />
{| class="wikitable"<br />
|-<br />
! Tasks !! Person<br />
|-<br />
| Data log || Harris<br />
|-<br />
| Back End webserver || Harris <br />
|-<br />
| Extended Kalman filter || Jason <br />
|-<br />
| Web frontend || Jason<br />
|-<br />
| OBDII || Jason<br />
|}<br />
<br />
== Future Work ==<br />
<br />
The extended Kalman filter still needs more work to provide higher accuracy. It would be better to have the beaglebone connect to the car wirelessly through a wireless adaptor. Some applications can be developed based on this platform, such as lap time, 0-60mph, a quarter mile and so on.<br />
<br />
== Conclusions ==<br />
<br />
In this project, we used many modules including but not limited to : GPSD, CANBUS, I2C, Device tree, flask,canvas, server, uart and kalman filter.<br />
<br />
The code part can still be improved since the CPU usage can be decreased by code optimization. Also, the sampling can be more accurate by using real time kernel.<br />
<br />
We didn't expect the 1GHz processor not able to handling 160 Hz IMU well, so if possible, we'd like to try to optimize our program or have it run on a more power processor. <br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=ECE434_Project_-_Arcade_Stacker&diff=580189ECE434 Project - Arcade Stacker2023-11-27T21:20:25Z<p>Yoder: </p>
<hr />
<div>[[Category:ECE434Fall2022 |PT]]<br />
{{YoderHead}}<br />
<br />
Team members: Luke Wendel and Josh Mitterling<br />
<br />
== Executive Summary ==<br />
[[File:Cover_pic.jpeg|400px]]<br />
<br />
This project is a recreation of a common arcade game known as Stacker, in which rows of blocks bounce horizontally across the screen. The goal of the game is to stack the moving blocks row by row to the top of the screen, without dropping all of the blocks. We implemented the game using an LED matrix, a BeagleBone Black, and a pushbutton for user input.<br />
<br />
What works:<br />
* User Input device (pushbutton)<br />
* 8x8 LED Matrix<br />
* Playable Stacker game<br />
<br />
What doesn’t work:<br />
* 64x32 LED Matrix (Unsuccessfully implemented. After hours of debugging, its behavior did not begin to match what was expected.) <br />
<br />
In the end, we were able to produce a nostalgic mini-version of the Stacker arcade game. It's a fairly straightforward project, which leaves a lot of opportunity for further development and interesting add-ons for us or others who find the project interesting. <br />
<br />
== Packaging ==<br />
We do not have any packaging. The BB Black, pushbutton, and LED matrix are bread boarded. <br />
<br />
== Installation Instructions ==<br />
Hardware needs: <br />
* BeagleBone Black<br />
* breadboard and wires<br />
* [https://www.adafruit.com/product/870 8x8 LED matrix]<br />
* Push buttons<br />
Any buttons you can tack on a breadboard will work. As will any breadboard and corresponding wires. The LED matrix we used is linked above. No kernel mods were used. <br />
<br />
How to install the project: <br />
* Building the circuit<br />
[[File:Circuit_diagram.jpeg|400px]]<br />
<br />
Recreate the above circuit using the components you've acquired. The LED matrix requires 5V power, a ground (GND) connection, serial clock (SCL), and serial data (SDA) connections. The I2C pins on the BeagleBone Black can be seen on the pinout diagram below. They are P9_19 and P9_20 for SCL and SDA respectively. Connect the ground rail of your breadboard to pin 2 of the P9 header on the BeagleBone. Connect 5V power (pin 3), to the power rail on your breadboard. And finally, connect a gpio pin (we used P9_23, or GPIO_49) to one side of the pushbutton, and connect the other side of the button to ground. And your circuit is now complete.<br />
<br />
Go to our [https://github.com/rhit-wendella/Stack_game_project.git github repository] and clone it. The README file should include the setup and installation scripts.<br />
<br />
The only python package needed to be installed is the Adafruit GPIO package, and the installation is handled by the install.sh file. The setup.sh file configures the IO and I2C of the BeagleBone for execution of the python file.<br />
<br />
== User Instructions ==<br />
* Once the programs are downloaded and the setup has been run, open the Stack_game_project directory. you should already be there from running the setup.sh file<br />
* you can then run the python script by running python and the Arcade_games.py file in the terminal. if you're using a debian installation on the BeagleBone, python is probably in the /usr/bin folder, so the command will look something like this: <br />
* $/usr/bin/python /Stack_game_project/Arcade_games.py<br />
* if you did it successfully, your LED matrix should have a bar scrolling at the bottom, which means your game is running, so press the button on your breadboard to stop the bar, and press it again to stack blocks atop the stack<br />
<br />
== Highlights ==<br />
* Our program implements an Interrupt Service Routine (ISR) using a button interrupt for the user input<br />
* The program can play the game over and over again until you break it. No need to run the program again to run the game back<br />
* The matrix will display a special sequence when you win the game<br />
* there is an easter egg programmed in for when you win the game with no blocks lost<br />
* it works<br />
<br />
[https://youtu.be/-JKpZJbED3E Here's a link] to a video explaining how our project works and some of its cool features.<br />
<br />
== Theory of Operation ==<br />
<br />
At initialization, the software connects to the peripheral display device. <br />
<br />
This figure visually describes the game flow:<br />
<br />
[[File:Program_flowchart.PNG|1000px]]<br />
<br />
The operation can be represented as a state machine, where the push of a button changes the idle state to an action state. In the action state, the program will determine the blocks stacked, check the game winning condition, and check the game loss condition.<br />
<br />
== Work Breakdown ==<br />
We have worked together throughout our undergraduate experience, so it's easy to collaborate and connect our ideas together. Much of the work was done together, but one of us was more responsible for each of the following tasks:<br />
<br />
* Wiring up the 64x32 LED matrix, managing the IO and headers - Josh<br />
* Developing the initial driver for the 64x32 LED matrix - Luke<br />
<br />
* Developing the Stacker game logic and program flow - Josh<br />
* Implementing the logic and constructing a template file - Luke<br />
<br />
We worked together, by pair programming, to debug the program and get the game to a playable state.<br />
<br />
Work not done yet: Migrating the game to the 64x32 LED matrix to be playable. <br />
<br />
== Future Work ==<br />
<br />
This project is a straightforward example of controlling user input devices to play a fun game. More games = more fun, so having a way to select a variety of different games on an LED Matrix, ideally of a larger size and higher resolution, would be very cool. We would start by adding Tetris as a second playable game, and go from there.<br />
<br />
== Conclusions ==<br />
We have a working game of Stacker in minigame form on the BeagleBone Black. This smaller version provides a bit of a nostalgic experience, and it was a good opportunity to get even more familiar with the Beagle Bone Black as a microcontroller and embedded linux platform. It required much collaboration, flexibility and debugging. We hope that anyone who stumbles upon this project finds it interesting, but there are a few more things we would have liked to do in furtherance of that aim. The first possibility would have been a second LED matrix that offers a multiplayer experience, where 2 players race to finish Stacking. As mentioned earlier, a second game, maybe mini-Tetris would have been nice. Or at least a few cosmetic upgrades (a bigger pushbutton, packaging, etc). <br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=ECE_434_BeagleCom&diff=580186ECE 434 BeagleCom2023-11-27T21:20:09Z<p>Yoder: </p>
<hr />
<div>[[Category:ECE434Fall2022 |PT]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Amadeus|Glody Mutebwa]] and [[user:Riveraar|Angel Rivera]]<br />
<br />
<br />
== Executive Summary ==<br />
<br />
Communication Network System aka '''BeagleCom'''<br />
<br />
The objective of the project is to equips the BeagleBone with native communication tools. Included are an irc client which connect to the [https://webchat.freenode.net/ Freenode] server and can communicate with anyone available online via a specific channel. We also have a file sharing system that allows the BeagleBone to share and receive files from continually.<br />
<br />
== Packaging ==<br />
Our project consists the LCD display, 2 LEDs (red and green) and the BeagleBone Black.<br />
<br />
The two LEDs are connected through P9_11 and P9_12.<br />
The LCD display is connected for a setup of SPI1.<br />
== Installation Instructions ==<br />
If you want to install the project onto your own BeagleBone, be sure to go to the [https://github.com/Amadeus-source/BeagleCom/tree/final Github page] and clone the project. The README.md file lists the proper commands in order to run certain parts of the project.<br />
<br />
Be sure to also have Python installed on the BeagleBone in order to run certain pieces of code.<br />
<br />
== User Instructions ==<br />
; After you cloned the project into your BeagleBone Black, move to the source folder :<br />
bone$ cd BeagleCom/src<br />
<br />
; If you want to start the IRC client and start chatting, follow the command line down below. :<br />
bone$ ./irc_client.py <username> <channelname><br />
<br />
The <username> is what your name you want it to be when others see you at the IRC channel, and the <channelname> is the name of the IRC channel. We set up a channel specifically called #BeagleCom at [https://webchat.freenode.net Freenode.] You can test this out by joining the IRC channel through a host computer and see if your BeagleBone joins the IRC channel. You do not need the # when entering the channel name on the command line. Note that this will not work if an IRC channel has a password to enter.<br />
<br />
When you receive a message from the IRC channel, the LED linked to the client will flash to signify that you have received it.<br />
<br />
<br />
; If you want to start receiving files from another BeagleBone or host computer, run this command line :<br />
bone$ ./receiver.py<br />
<br />
; When you run this code, it'll ask for a port and a local host IP :<br />
Enter port : {insert port # here}<br />
Enter host (ex:localhost): {insert host # here}<br />
Listening on port {port#}<br />
<br />
; On the other side (whether through BeagleBone or host PC), run this command to send the file to the receiving BeagleBone :<br />
bone$ ./sendfile.py -i <localhost> -p <port> -f <file><br />
<br />
The <localhost> should be whatever the IP address of the Linux system that you're using, the <port> was of your choosing (we usually use port 8888), and the <file> is the file that you send to the receiver (we tested using .txt files to speed testing).<br />
<br />
== Highlights ==<br />
Our video demo: [https://youtu.be/C6mogTZ1gCY Youtube]<br />
<br />
== Theory of Operation ==<br />
<br />
[[File:BeagleComTheoryBig.png|thumb|right|x400px|A high level look at the project on the interact between components]]<br />
<br />
The IRC client: Make use of socket to open a connection and connect to an external IRC server. Process received information and format data before displaying it either on the Terminal or on the LCD display.<br />
<br />
The receiver: Simply open a connection on a port and continually listen for incoming data on specified port. <br />
<br />
The sender: Open a connection and send a specified file to a specific IP address and its specified port.<br />
<br />
Our receiver would ideally run in the background before trying to send a file. To make a receiver available globally install NGROK and run ./ngriok tcp <port>.<br />
<br />
== Work Breakdown ==<br />
{| class="wikitable"<br />
|-<br />
! Work<br />
! Contributor<br />
|-<br />
| IRC Communication Client<br />
| Glody<br />
|-<br />
| File Transmission Code<br />
| Glody<br />
|-<br />
| LCD Display Implementation<br />
| Angel<br />
|-<br />
| Wiki and Hackster.io<br />
| Angel<br />
|}<br />
<br />
== Future Work/Conclusions ==<br />
The overall idea was to create our own IRC webpage hosted by a BeagleBone and have the interface of having text and files be sent through that medium, such as a textbox that can be typed up and sent through using the IRC client that we implemented previously. There would be another button that would allow us to pick a file in the Linux system to be sent through, which would be then use the File Transmission Python code to send the file from one BeagleBone to another. This would all be done using Flask as an interface and HTML setup for proper use.<br />
<br />
In the end, we were able to have the project fully working, but we'd hope for more that can be more tangible as a product using all of its utilities. Due to problems that crop up at the last minute and not enough time to implement more of our ideas, we ended up with this current project. It's satisfactory but it could've been done better if more time was allotted.<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=ECE434_Project_-_SnakeGame&diff=580183ECE434 Project - SnakeGame2023-11-27T21:19:40Z<p>Yoder: </p>
<hr />
<div>[[Category:ECE434Fall2022 |PT]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Yoder|Mark A. Yoder]]<br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
Add Extras<br />
<br />
09 Executive Summary<br />
09 Packaging<br />
09 Installation Instructions <br />
09 User Instructions<br />
09 Highlights<br />
09 Theory of Operation<br />
09 Work Breakdown<br />
09 Future Work/Conclusions<br />
09 Hackster.io<br />
09 Demo/Poster<br />
00 Not Late<br />
<br />
Score: 90/100<br />
</pre><br />
<br />
== Executive Summary ==<br />
[[File:Snake Game Example.PNG]]<br />
<br />
The project runs the snake game where you are a snake going in a world and you have to try and eat the apple in the game. Each time you eat the apple your snake grows in size. The goal is to not run into your own self and to stay in the game screen and continue to grow your snake as big as possible.<br />
<br />
We have the python script running pygame to display the game onto the LCD screen. We have all the growing and collisions working properly. We also have three GPIO buttons working. One is to slow down the game to make it easier to play , another to speed up the game to make it faster and a third one to start and reset the game back to the start whenever pressed, and a fourth to end the game whenever pressed. You can play the game using one of the rotary encoders to turn the snake left or right from the current direction the snake is moving. We have an 8x8 LED Matrix to display the score of the game as you play it and will reset back to 0 when you start or restart the game.<br />
<br />
We do not have the flask working currently to have the scoreboard updated so whenever you eat a fruit in the game the scoreboard would update the score to add 1 each time. The flask also doesn't work to control the game using the flask so that when you press the right button the snake would turn right and vice versa for the left turn button and the reset button.<br />
<br />
Overall the project has been fun to implement and has some frustrations involving the Flask but works good and does the snake game good. The game has several different aspects we have used in the class such as GPIO, Rotary encoders, and I2C.<br />
<br />
== Packaging ==<br />
The hardware used in this project is the LCD, Rotary Encoder, 4 Push buttons, 4 resistors, Matrix 8x8 LED display with 2 I2C pins and the BeagleBone Black.<br />
<br />
The LCD is setup for SPI1. The Rotary Encoder is set to pins P8_11 and P8_12. The push buttons are set to P9_21,P9_22, P9_23,and P9_26. We have the LED Matrix I2C pins connected to P9_19 and P9_20 connected to bus 2 of the I2C bus.<br />
<br />
== Installation Instructions ==<br />
<br />
Give step by step instructions on how to install your project. <br />
To the find all the code and instructions go to this github link: https://github.com/rhit-kimmw/ECE434Project-SnakeGame<br />
In this github you will find the README.md with all the up to date of how to run the files and the necessary setup instructions to do before you run the files.<br />
<br />
== User Instructions ==<br />
[[File:Snake Game Project.PNG]]<br />
<br />
The first thing you do to run the code is first to do 'chmod +x setup.sh' and then run './setup.sh' this will setup all your ports to be gpio or eqep for the necessary pins to run the program. After that is complete do 'chmod +x snake.py' and to run the file do 'sudo ./snake.py' this will run the snake game on the LCD and you can play the game as instructed. <br />
<br />
To turn right turn the encoder counter-clockwise. <br />
<br />
To turn left turn the encoder clockwise.<br />
<br />
To slow the game down press the push button connected to pin P9_23 or to speed the game up press the push button connected to P9_21. <br />
<br />
To start and restart the game press the push button connected to P9_26.<br />
<br />
To end the Game once in play press the push button connected to P9_22.<br />
<br />
To get the LED matrix to work connected the SCL to P9_19 and the SDA to P9_20 and connected the positive pin to voltage and the negative pin to ground.<br />
<br />
== Highlights ==<br />
<br />
Our project can run a fully functional Snake game in which the snake grows as you eat an apple and an apple randomly appears on the screen as you eat one. You can turn the head of the snake left or right as it moves to get the apples. Using the Push buttons you can speed up how fast the snake goes to make the game harder or slow down the game by pushing another push button. To start the game or restart the game you press the same push button whenever you are ready. To stop the program you simply press the fourth push button to end the game. We also have an LED 8x8 Matrix displaying the score of the game. If you eat an apple your score goes up and will display a 1 and continue to display the scores each time you eat an apple and will go back to 0 if you press the restart button.<br />
<br />
== Theory of Operation ==<br />
<br />
Youtube Video of Project : https://youtu.be/SN_Hy4Xf2fg<br />
<br />
We are using a python script called snake.py to run the snake game. Inside that snake game we are using pygame to run the game onto the LCD. We have three different classes in our code called Game, Snake, and Apple. The Game class controls the functionality of the game such as initializing the game and setting up the structure of how the game works. There are several functions within Game such as runGame which is called to run the game and inside that function it initializes the Snake and Apple and calls those classes to set up the Snake and Apple for the Game. In Snake class we set the snakes positions and also the snakes movements and the function of how it grows after it has a collision with the apple and eats it. The Apple class is very basic and just chooses a base position to start but once eaten the apple will choose a random position in the game and go to there and wait until the game restarts or is eaten by the snake. There are also several other functions within the game to do the features we have added such as increasing or decreasing the speed of the game in which we simply increase or decrease the ticks of the timer to control the speeds. There is functions to end and restart the game and to display the scores in which we make the byte values for each digit and then write functions to get them properly displayed onto the LED Matrix.<br />
<br />
== Work Breakdown ==<br />
<br />
Martino wrote the Python Script for the Game and got the collisions working between the them, He got the rotary encoder code working and made the Byte values to display on the LED Matrix.<br />
<br />
Ethan Set up the hardware and got the GPIO pins and the functionalities to work. Martino made the individual components but Ethan combined them to work together. <br />
<br />
Both worked to get the LCD to work properly.<br />
<br />
Ethan did the Wiki page stuff and Martino did the Hackster.io documentations.<br />
<br />
The things listed above are working for the project and Ethan worked on getting the Flask in the project but was not able to do so with either displaying the score or controlling the game.<br />
<br />
== Future Work ==<br />
<br />
we suggest sing the Flask would be something that we wanted to do but couldn't. Using the flask to display the score or to control the game would be something we would of wanted but couldn't do.<br />
<br />
== Conclusions ==<br />
<br />
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.<br />
<br />
Overall the project was fun to implement and try different things but some future additions that could be made is adding the Flask to either display the score of the game or control the snake game would be something that we weren't able to do. Another thing that could be done is a bigger screen to use and on a LED Matrix if wanted instead of the LCD. You can control the snake with a different controller is another good idea if you possibly could using a PlayStation controller or some of device would be cool. Overall getting the GPIO, I2C and the rotary encoders with the LCD to work and display together was fun and decent amount of features is overall good we think.<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=ECE434_Project_-_MIDI_Sequencer&diff=580180ECE434 Project - MIDI Sequencer2023-11-27T21:19:13Z<p>Yoder: </p>
<hr />
<div>[[Category:ECE434Fall2022 |PM]]<br />
<br />
Team members: [[user:Williagm|Gaven Williams]], [[user:perezbe|Brendan Perez]]<br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
Add Extras<br />
<br />
09 Executive Summary<br />
09 Packaging<br />
09 Installation Instructions <br />
09 User Instructions<br />
09 Highlights<br />
09 Theory of Operation<br />
09 Work Breakdown<br />
09 Future Work/Conclusions<br />
09 Hackster.io<br />
09 Demo/Poster<br />
00 Not Late<br />
<br />
Score: 90/100<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
[[File:Midi_hardware.png|320px|frameless]]<br />
<br />
Final hardware implementation of the MIDI Player<br />
<br />
<br />
Our project is a MIDI/WAV music player. The user can browse through a selection of .mid and .wav files using pushbuttons and an LCD screen, or put the player in "shuffle" mode. While in MIDI mode, the user also has the option of selecting a soundfont, which will then be used in MIDI synthesis. <br />
<br />
We have finished implementing all of these features.<br />
<br />
Source code: https://github.com/rhit-perezbe/MIDI-Player<br />
<br />
== Packaging ==<br />
<br />
[[File:Button_box.png|480px|frameless]]<br />
<br />
We constructed a small UI box that houses the pushbuttons and LCD screen. <br />
<br />
The CAD file (boxhole2.DXF) is located on our GitHub as well: https://github.com/rhit-perezbe/MIDI-Player<br />
<br />
== Installation Instructions ==<br />
<br />
All installation instructions can also be found on our GitHub repo: https://github.com/rhit-perezbe/MIDI-Player<br />
<br />
== User Instructions ==<br />
<br />
To get started with our program:<br />
<br />
bone$ cd MIDI-Player<br />
<br />
bone/MIDI-Player$ sudo ./midiPlayer.py<br />
<br />
Now that it's running, the user can operate the player solely from the LED pushbuttons and LCD display.<br />
<br />
User control is pretty straightforward, since the LCD display tells you each colored button's functionality. Additionally, depending on what state the player is currently, the available pushbutton options will be illuminated. Any non-illuminated buttons don't do anything when pressed in that state. <br />
<br />
<br />
There are essentially 3 states of the player: Stopped, playing, and settings. <br />
<br />
While stopped, these are the user options:<br />
<br />
Green: Play currently displayed song (enters playing state)<br />
<br />
Red: N/A<br />
<br />
Orange: Skip to next song<br />
<br />
White: Open setting menu<br />
<br />
<br />
While playing, these are the user options:<br />
<br />
Green: N/A<br />
<br />
Red: Stops playback (enters stopped state)<br />
<br />
Orange: Skip to next song<br />
<br />
White: N/A<br />
<br />
<br />
While in settings, these are the user options:<br />
<br />
Green: Switches to next soundfont<br />
<br />
Red: Toggles shuffle mode (illuminated while on, dark while off)<br />
<br />
Orange: Toggles MIDI/WAV mode (illuminated while in MIDI mode, dark while in WAV mode)<br />
<br />
White: Return to stopped state<br />
<br />
== Highlights ==<br />
<br />
Our project was designed to be as robust and versatile as possible, while still maintaining a simple and accessible user interface. <br />
<br />
One such feature is the ability to switch between soundfonts. This allows for any one MIDI file to be played with a variety of samples and instruments, giving the user a wide range of choices for how they want to listen to a certain song. We even included the infamous "meowsynth" if the user insists on hearing their music sung by the dulcet tones of a cat. <br />
<br />
Anyone who downloads our project can add any MIDI, WAV, and soundfont (SF2) files to their respective folders to expand the library of music. Additionally, uploading a 200x200 pixel image with the same name as a MIDI or WAV file will display that image when that song is playing. If a song without a dedicated image plays, a default image will display during that song. <br />
<br />
The user interface is clean and simple, streamlining the listening experience. There are 4 buttons, which are clearly labeled on the LCD screen. For additional simplicity, only illuminated buttons are functional in certain states.<br />
<br />
<br />
Demo video: https://youtu.be/UhCBo8olzPY<br />
<br />
Hackster.io Page: https://www.hackster.io/brendan8/beaglebone-black-midi-wav-player-f443a9<br />
<br />
== Theory of Operation ==<br />
MIDI/WAV playback - For playing the audio, both fluidsynth and aplay will block the rest of the program from running. This is an issue because that means the buttons would not work while a song way playing. To fix this, the program will make the audio player a background process, which allows the program to continue. To end the sound after the user requests to stop, the program will issue a kill command like <code>kill $(pidof fluidsynth)</code>.<br />
<br><br />
The buttons are read every 100ms and are polled and we are using gpiod to use the buttons. Because they are polled, it is possible to press one and have it miss reading a press. <br />
Also, some of the MIDI files are more resource intensive than others. This makes the button reading slower as the MIDI player uses up more CPU time than the python program. The WAV player does not have this problem.<br />
<br><br />
The screen is rendered using pygame. Pictures are searched for in the '''images/''' directory. If there is no picture matching the name of the playing song, a default 'No Image' file is used.<br />
<br />
[[File:Fsm434.JPG|1000px|frameless]]<br />
<br />
While stopped, these are the user options:<br />
<br />
Green: Play currently displayed song (enters playing state)<br />
<br />
Red: N/A<br />
<br />
Orange: Skip to next song<br />
<br />
White: Open setting menu<br />
<br />
<br />
While playing, these are the user options:<br />
<br />
Green: N/A<br />
<br />
Red: Stops playback (enters stopped state)<br />
<br />
Orange: Skip to next song<br />
<br />
White: N/A<br />
<br />
<br />
While in settings, these are the user options:<br />
<br />
Green: Switches to next soundfont<br />
<br />
Red: Toggles shuffle mode (illuminated while on, dark while off)<br />
<br />
Orange: Toggles MIDI/WAV mode (illuminated while in MIDI mode, dark while in WAV mode)<br />
<br />
White: Return to stopped state<br />
<br />
== Work Breakdown ==<br />
<br />
For the vast majority of this project's tasks, Brendan and Gaven worked together. There were two elements of the project that were more individual: Brendan handled the pushbutton logic, and Gaven handled the LCD display design and integration. Everything else was done together. <br />
<br />
<br />
Full breakdown:<br />
<br />
<br />
BeagleBone playing .wav files - Brendan and Gaven<br />
<br />
BeagleBone playing .mid files given a soundfont - Brendan and Gaven<br />
<br />
Can stop song playing (kills fluidsynth process) - Brendan<br />
<br />
Breadboarding user hardware - Brendan<br />
<br />
Software for user buttons - Brendan<br />
<br />
Start software for LCD display - Gaven<br />
<br />
Integrate LCD display software into main code - Gaven<br />
<br />
Put together box for user hardware - Brendan and Gaven<br />
<br />
Finalize documentation (hackster.io, wiki page, etc) - Brendan and Gaven<br />
<br />
== Future Work/Conclusions ==<br />
<br />
If we were to have more time on this project, we may have designed it such that the BeagleBone itself could have also fit in the enclosure. We may have been able to use a PocketBeagle to meet this goal. Otherwise, we are very satisfied with our final design from a code and user standpoint.<br />
<br />
== Timeline ==<br />
<br />
Fri 27-Jan-2023: BeagleBone playing .wav files<br />
<br />
Mon 30-Jan-2023: BeagleBone playing .mid files given a soundfont<br />
<br />
Sun 5-Feb-2023: Can stop song playing (kills fluidsynth process)<br />
<br />
Mon 6-Feb-2023: Breadboarding user hardware<br />
<br />
Tues 7-Feb-2023: Software for user buttons<br />
<br />
Fri 10-Feb-2023: Start software for LCD display<br />
<br />
Mon 13-Feb-2023: Finalize software for LCD display<br />
<br />
Fri 17-Feb-2023: Put together box for user hardware<br />
<br />
Sun 19-Feb-2023: Finalize documentation (hackster.io, wiki page, etc)<br />
<br />
Wed 22-Feb-2023: Final project DUE</div>Yoderhttps://elinux.org/index.php?title=ECE434_Project_-_Water_Gun_Sentry_Turret&diff=580177ECE434 Project - Water Gun Sentry Turret2023-11-27T21:18:17Z<p>Yoder: </p>
<hr />
<div>[[Category:ECE434Fall2022 |PI]]<br />
{{YoderHead}}<br />
<br />
Team members: <br />
[[user:harriss1|Sophia Harrison]]<br />
and [[user:DavidPurdy|David Purdy]]<br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
Add Extras<br />
<br />
09 Executive Summary<br />
09 Packaging<br />
09 Installation Instructions <br />
09 User Instructions<br />
09 Highlights<br />
09 Theory of Operation<br />
09 Work Breakdown<br />
09 Future Work/Conclusions<br />
09 Hackster.io<br />
09 Demo/Poster<br />
00 Not Late<br />
<br />
Score: 100/100<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
[[File:Project Picture2.jpeg|thumb|Water Gun Sentry Turret]]<br />
Introduction:<br />
<br><br />
For our project, we created a water gun sentry turret. This project consists of several components including the BeagleBone AI-64 (BBAI64), a stepper motor and driver, a servo motor, a water pump, and a relay to fire the water pump. In addition, this project runs a Machine Learning program on the BeagleBone AI-64 to detect if a face is in view of the connected webcam and if the face's mouth is open. When the camera detects an open mouth, the centroid of the mouth is calculated and the servo adjusts the water gun's angle in order to shoot water into the mouth. The water shot is pumped from a water reservoir using the water pump which activates soon after the mouth is detected to be open.<br />
<br><br />
<br />
What Worked:<br />
<br><br />
What we got to work for our project was majority of the components we set out to implement. We successfully connected and video streamed a webcam with the BBAi64 and we were able to implement the servo motor, relay, water pump, and wifi to connect wirelessly. Our stepper motor was implemented but the rotations it produced were very small.<br />
<br><br />
<br />
What Didn't Work:<br />
<br><br />
We ran into some difficulty when trying to use the BBAI64 as it worked much differently compared to the BeagleBone Black used throughout the class. We were not able to use a lot of python packages and using gpios was different and it took us a minute to figure out how to do so. Additionally, for our project the stepper motor would only rotate very slightly and thus wasn't able to rotate the platform as much as we would like. One possible source to this issue we suspected was insufficient power to our stepper motor and driver.<br />
<br><br />
<br />
Conclusion:<br />
<br><br />
In conclusion, we were able to create a water gun sentry turret which can detect when a person's mouth is open, aim the water nozzle, and gently shoot water into a persons mouth. While our stepper motor underperformed somewhat, the project still proved to be functional.<br />
<br><br />
<br />
== Packaging ==<br />
<br />
For our packaging we needed to use something that would protect the circuitry from water, since the components needed to work close to a water pump and nozzle. We chose a plastic container that could fit all of the peripherals and the BeagleBone inside it and also protect from possible water exposure. To allow for the power cords to be plugged into a wall, we drilled a small hole into the container towards the bottom on its side. Additionally, we had a square structure mounted on top of the plastic enclosure that held the servo motor, water nozzle end, and the camera on top of it secured with duct tape. <br />
<br><br />
<br />
Here you can see images of the container and its contents:<br />
<br><br />
<br />
[[File:circuit1.jpg|300px|Inside our project]] [[File:lid.jpg|200px|Stepper motor and servo motor connection]] [[File:topview.jpg|300px|Project Top View]]<br />
<br />
== Installation Instructions ==<br />
<br />
For further instructions on how the code works and how to setup your environment, visit our [https://github.com/DavidPurdy1/BeagleBoneWaterTurret github] <br><br />
<br />
Here are some instructions for how we set up the BeagleBone AI-64: <br />
<br><br />
* Install a graphical OS (makes it easier to debug later, We installed the Bullseye XFCE (with graphical desktop) for BeagleBone AI-64)<br />
* Once flashed on, to get the display port working you are going to want an ACTIVE micro display port adapter. Trust me there is a difference, the active ones have a thick block<br />
* Once you get this and boot you should see a desktop boot up on the display.<br />
* To get internet we setup the WIFI dongle and used this for downloading everything. We used instructions for setting up the WIFI drivers on the bone from the eLinux wiki page.<br />
<br />
After setting up our BeagleBone AI64, we set up our various peripherals using the code found in the peripherals_test directory in our repository. Using those as a guide, you can set up the hardware and then run the main script and then the project should work!<br />
<br><br />
<br />
Additional Hardware Needed:<br />
* [https://www.azurefilm.com/en/creality-42-34-stepper-motor-for-cr-series/ender-series Stepper Motor] <br><br />
* [https://www.hobbypartz.com/33p-solarservo-a102.html Servo]<br />
<br />
== User Instructions ==<br />
<br />
Once everything is installed, to use the project all you have to do is ssh into the bone and run detect_open_mouth.py, the main python script. To stop the script you press q on your keyboard and that's it! These two steps allow you to start and run the project. See our [https://github.com/DavidPurdy1/BeagleBoneWaterTurret gitrepo] for the code and additional help.<br />
<br />
== Highlights ==<br />
<br />
To see our project in action, check out our [https://youtu.be/36nt8Skgai4 demo] on YouTube!<br />
<br />
== Theory of Operation ==<br />
<br />
Our software is modular and there are contains several functions which handle different aspects of the project.<br />
* We first initialize the web cam and start reading the video stream<br />
* We use our machine learning script to detect when the camera sees an open mouth<br />
* We set up the PWM for the servo <br />
* We move the platform using the stepper motor a small increment every iteration of the loop, scanning for an open mouth<br />
* When an open mouth is detected we calculate the mouth's center and send the data to the servo angle calculation function<br />
* The angle needed to shoot the water into the mouth is calculated and sent to the servo<br />
* There are conditionals which decide if the mouth is within range and if the water gun should shoot<br />
* If the conditionals result in true, indicating the mouth is within range, the relay is sent a signal to fire up the water pump<br />
* The system waits 5 seconds for the water pump to finish shooting the water and then it goes back to the beginning of the loop, looking for an open mouth again<br />
<br />
== Work Breakdown ==<br />
<br />
Here are the major tasks we completed for our project. We both sat down and worked on these together. <br><br />
* Setup BeagleBone AI-64<br />
* Get webcam to work and read its videostream using python<br />
* Get stepper motor to work with the BeagleBone and write python code to interface with it<br />
* Get servo to work, write python code to interface with it<br />
* Implement the relay, test with led first before adding water<br />
* Create housing for the project, drill holes into the enclosure<br />
* Setup remote ssh into bone so the script can be run remotely<br />
* Test system with water and tweak as needed<br />
<br />
We were able to successfully complete all of these tasks.<br />
<br />
== Future Work ==<br />
<br />
Some things we could do in the future with this project include making the main python script for the water gun run on the bone's startup, so that you do not have to ssh into it to get it started, making the project easier to use. Additionally, we would improve the wiring and circuitry for our stepper motor so that the platform can turn a wider range of angles so the field of view is not as limited.<br />
<br />
== Conclusions ==<br />
<br />
In conclusion, our project is able to function correctly in aiming at a person's mouth and shooting water. As mentioned above, some improvements we could make involve using systemd to make the script start automatically as well as improving stepper motor performance. Futhermore, we accomplished all the tasks that we set for ourselves and our project successfully demonstrated what we wanted it to.<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=ECE434_Project_-_Intruder_Cam&diff=580174ECE434 Project - Intruder Cam2023-11-27T21:17:52Z<p>Yoder: </p>
<hr />
<div>[[Category:ECE434Spring2022 |PI]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Abelk|Abel Keeley]]<br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
Add Extras<br />
<br />
09 Executive Summary<br />
09 Packaging<br />
09 Installation Instructions <br />
09 User Instructions<br />
09 Highlights<br />
09 Theory of Operation<br />
09 Work Breakdown<br />
09 Future Work/Conclusions<br />
09 Hackster.io<br />
09 Demo/Poster<br />
00 Not Late<br />
<br />
Score: 90/100<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
[[File:20230127005505-00.jpg|720px|frameless]]<br />
<br />
The idea behind this project is to build a DIY intruder cam, with various connected features. The system should be capable of remotely alerting the owner.<br />
<br />
Currently, motion detection is working (using [https://motion-project.github.io/ motion]) and can fire off arbitrary scripts. I've integrated with [https://ifttt.com/ IFTTT] to send mobile notifications when a motion event starts. Captured footage can be reviewed (and, if desired, saved) via a webserver interface. More work could be done in polishing the UI, and integrating more ways to notify the owner of motion events.<br />
<br />
== Packaging ==<br />
For this project I used a [https://beagleboard.org/black BeagleBone Black] (a small single board computer) to host the webserver and interface with a USB webcam (I used a [https://www.amazon.com/dp/B004FHO5Y6 Logitech C270], but just about any webcam should work).<br />
<br />
== Installation Instructions ==<br />
<br />
See [https://github.com/rhit-keeleya/ECE434-Workspace/tree/master/project]<br />
<br />
== User Instructions ==<br />
<br />
First-time setup is a bit involved (see the GitHub repo linked above) but after it is done, the project should be running on bootup.<br />
<br />
== Highlights ==<br />
<br />
[https://youtu.be/aHx7p18pMzQ Video demo].<br />
<br />
[https://www.hackster.io/rhit-keeleya/intruder-cam-a5985e Hackster.io project page].<br />
<br />
== Theory of Operation ==<br />
<br />
[[File:Project_Theory_of_Operation.png|720px|frameless]]<br />
<br />
This project consists of three main components - motion detection, user notification, and user interface. The motion detection part of this project, as mentioned previously, uses the motion package to detect, store, and respond to motion events from a webcam. Captured footage is stored temporarily and served on an Nginx webserver. The response to motion event consists of launching a python script and passing it details about the triggering event. The python script then fetches a link to a remote [https://dashboard.ngrok.com/get-started/setup ngrok] tunnel(which allows for remote access without requiring port forwarding) and modifies the link to point to the webserver folder containing the corresponding footage, logs debug info to a google sheet, and then finally triggers an IFTTT notification with that link. Upon receiving the notification, a user can then follow the link, log into the webserver and review the captured footage. The user can then use a basic UI to navigate, save, or delete footage. Saving and deletion are implemented via a shell script.<br />
<br />
== Work Breakdown ==<br />
<br />
* Configure Motion to recognize webcam, detect motion, and launch an arbitrary script - Abel<br />
* Write a script to trigger an IFTTT notification - Abel<br />
* Setup basic Nginx webserver - Abel<br />
* Configure ngrok tunnel to the webserver, set it up a service that launches on startup - Abel<br />
* Modify script to get ngrok link, modify to point to correct folder on server, and integrate link in IFTTT notification - Abel<br />
* Modify Nginx setup to enable PHP - Abel<br />
* Move to PHP-based directory indexer to allow better navigation and dynamic webpages, add support to recognize button presses - Abel<br />
* Connect button presses to shell script for saving/deleting footage - Abel<br />
* Prettify the HTML for the webpage - Abel<br />
<br />
== Future Work ==<br />
<br />
* Better UI, with additional functionality (maybe allow user to remotely email footage/exfiltrate data)<br />
* Integrate additional ways to notify the user beyond just IFTTT<br />
<br />
== Conclusions ==<br />
<br />
All in all, this was a fun project for learning about developing embedded systems using Linux. I am by no means an expert at Nginx webservers or PHP - so use this at your own risk! I adopt no responsibility and provide no warranty for any associated software. With that said, I think this is a fun project to tinker with and I would encourage anyone else thinking about using it to: A. have fun and B. adapt, modify, delete, and rewrite it as they see fit.<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=ECE434_Project_-_Diabetic_Monitor&diff=580171ECE434 Project - Diabetic Monitor2023-11-27T21:17:13Z<p>Yoder: </p>
<hr />
<div>[[Category:ECE434Fall2022 |PD]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:mannanej|Eddie Mannan]] [[user:Carbite|David Mattingly]]<br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
Add Extras<br />
<br />
09 Executive Summary<br />
09 Packaging<br />
09 Installation Instructions <br />
09 User Instructions<br />
09 Highlights<br />
09 Theory of Operation<br />
09 Work Breakdown<br />
09 Future Work/Conclusions<br />
09 Hackster.io<br />
09 Demo/Poster<br />
00 Not Late<br />
<br />
Score: 90/100<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
Picture that summarizes the project.<br />
Not propper format<br />
<br />
This project is a way to easily monitor blood sugar levels for Type 1 Diabetics. In order to use this project, you must be using a Dexcom brand constant blood sugar monitor and have valid accounts with Dexcom. This project will take a downloaded .csv file from the Dexcom website, run computations on this spreadsheet to find an A1C, and display values with both LEDs and an LCD display.<br />
<br />
As of 2/9/2023, the project will pull a new Excel file from GitHub and search through all Excel files to find the newest one. Once it gets the newest file, it will run computations on it (turning on a Yellow LED to show that it is working) and display several values on the LCD screen. The values are:<br />
Eddie Mannan Dexcom Monitor<br />
Date: *Current Date*<br />
Time: *Current Time*<br />
A1C: *Current A1C*<br />
Current Sugar: *Current Sugar*<br />
Highest Sugar: *Highest Sugar*<br />
Lowest Sugar: *Lowest Sugar*<br />
Computation Time: *Computation Time*<br />
As of 2/9/2023, the only thing I can't get to work is a way to automate the collection of Excel sheets. Right now, the user has to add a new sheet every time they want new calculations. I would like to have this done automatically, but I haven't found a good process yet.<br />
<br />
All in all, this project should be an easy way to constantly display and track a persons blood sugar numbers. If the project can accurately track and clarify sugar values, it will be able to help type 1 diabetics stay healthy and safe.<br />
<br />
== Packaging ==<br />
As of right now, we don't have any of formal packaging. It is just the Beagle right next to a small bread board. It would be nice to get it in a small acrylic box of some sort, but we just didn't have the time for that.<br />
<br />
== Installation Instructions ==<br />
To install this project, it is quite simple. All you need to do is grab the project from [https://github.com/rhit-mattindc/ECE434_DiabeticMonitor, GitHub], run the '''install.sh''' file, then reboot to enable to device tree. You may want to check whether uboot_overlay_addr4 is already assigned, as that is the one this project arbitrarily uses for the LCD device tree. The project should begin running automatically every five minutes via the crontab, at the zero- and five-minute. It runs every 5 minutes since that's how often the Dexcom sensor takes a new reading.<br />
<br />
* Link for [https://www.amazon.com/DEVMO-ILI9341-Display-240X320-Module/dp/B07WR3J2TV/ref=sr_1_12_sspa?crid=2VSIL9JG1KFKO&keywords=adafruit+LCD+touchscreen&qid=1676855946&sprefix=adafruit+lcd+touchscreen%2Caps%2C91&sr=8-12-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUEyQklDT0E1QTRSUkFBJmVuY3J5cHRlZElkPUEwODE3ODkxM1FHS1hXNTJDT0lOOSZlbmNyeXB0ZWRBZElkPUEwNTc5Mzk5MjJTSlJTVjNSTVFYUiZ3aWRnZXROYW1lPXNwX210ZiZhY3Rpb249Y2xpY2tSZWRpcmVjdCZkb05vdExvZ0NsaWNrPXRydWU=, Additional Hardware]<br />
* Technically speaking, you would also need to purchase a [https://www.dexcom.com/en-us/g6-cgm-system, Dexcom G6 Monitor], but if you aren't a diabetic then you really wouldn't have much use for this system. Please follow your doctor's recommendations on treatment systems for diabetes, do not get a certain one just because you saw a neat project to display your stats.<br />
<br />
== User Instructions ==<br />
<br />
* Make a copy of the GitHub repo on your own Beagle. This would work best if you were also a type 1 diabetic, since I'm assuming you wouldn't want too see my data, but regardless it will work.<br />
* Go to [https://clarity.dexcom.com/#/overview, Dexcom Clarity], this is where you will download your .csv files for number crunching. Take this file and add it to the GitHub repo. When the Python file runs, it will do a '''git pull''' to get the newest file, then figure out and do math on the newest.<br />
* The python will then display the information on the LCD screen and light up an LED based on the Current Sugar value. Red for high, Green for good, and Blue for low. It will also light up a Yellow LED to show that the code is running.<br />
* If for some reason something goes awry, an easy fix would be to reboot the bone since it will run the program again on startup.<br />
* That's it! Should be easy enough to use!<br />
<br />
== Highlights ==<br />
<br />
The project can determine which file is newest and run it for you, making it easier on the end user.<br />
The project will display data both with words and with colors, making it easier to tell the reading from a distance if needed.<br />
The A1C is calculated with sugar numbers collected every 5 minutes for the last 90 days. This leads to an array of over 25,000 elements.<br />
The program, after setup, will autorun on start and run every 5 minutes by using CronTab.<br />
<br />
Here is a quick [https://youtu.be/iTgDwM5yVy8 YouTube] demo to visually show all of the features.<br />
<br />
== Theory of Operation ==<br />
* The first step is to add a new .csv file from the Dexcom Clarity website to Git. Once the sheet is added, the program will do a pull.<br />
* Next, it will look at all the excel files it has and determine which one is the newest, then crunch numbers on that one.<br />
* Then, it will get some values from the array, sort the array, and calculate the A1C value.<br />
* These values will then be sent to the LCD screen to be displayed and the LEDs to be updated.<br />
* The system will then use CronTab to autorun again in 5 minutes since this is how often the Dexcom sensor reads a new sugar value.<br />
<br />
== Work Breakdown ==<br />
<br />
*Determine if Python will be fast enough given such a big array - Eddie<br />
*Find a way to determine which Excel sheet is the newest - Eddie<br />
*Do the diabetic calulations to determine an A1C and find current/highest/lowest sugars - Eddie<br />
*Display the data collected on the LCD screen - Eddie<br />
*Create an install.sh - David<br />
*Create an setup.sh - David<br />
*Get the program to autorun - David<br />
*Optimize the programs runtime - Eddie<br />
<br />
== Future Work ==<br />
<br />
The biggest piece of future work is getting the Excel sheets. We would have loved to have a way to go to the Dexcom website automatically and get the numbers, but since this is medical data, it is quite a challenging process. So if a solution to that could be found, this project would be close to perfect.<br />
<br />
== Conclusions ==<br />
<br />
In conclusion, this project could be concidered a great success. The program is able to take an array of blood sugars, crunch the numbers, and return valuble feedback based on those numbers. This could be a great tool to help Type 1 Diabetics manage themselves and stay healthy. One future addition that could make the project MUCH more interesting would be finding a way to make the code got to the Dexcom webiste on its own and download the Excel file every 5 minutes or so. Since this is medical information, we currently don't know if that is even possible, but it would be neat none the less.<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=ECE434_Project_-_BT_StopWatch&diff=580168ECE434 Project - BT StopWatch2023-11-27T21:16:31Z<p>Yoder: </p>
<hr />
<div>[[Category:ECE434Fall2022 |PB]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Prof.nuduls|Derick Miller]], [[user:saucedm|Marco Saucedo]]<br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
Add Extras<br />
<br />
09 Executive Summary<br />
09 Packaging<br />
09 Installation Instructions <br />
09 User Instructions<br />
09 Highlights<br />
09 Theory of Operation<br />
09 Work Breakdown<br />
09 Future Work/Conclusions<br />
09 Hackster.io<br />
09 Demo/Poster<br />
00 Not Late<br />
<br />
Score: xx/100<br />
</pre><br />
<br />
== Executive Summary ==<br />
This project is a bluetooth enabled stopwatch, where the stopwatch will store profile accounts and then allows the user to get times, and time-splits of the profile account and then transmits the final time and splits to the receiver which then inputs the times and time-splits into google sheets.<br />
<br />
We focused on the profile and portability aspect of the stopwatch. We wanted to make an interface with easy to use software and only three buttons. To keep processing power and our systems light, we decided to implement one BeagleBone Black (BBB) as our actual "Stopwatch" and another BBB as a host that would stay on indefinetly and act as a "Server" where it would await Bluetooth commands from our stopwatch.<br />
<br />
In the code, we have developed profiles for our Linux mascots, Tux and Boris. Below we have included instructions on how to setup and run our application.<br />
<br />
== Packaging ==<br />
The packaging for the project is composed of 3 GPIO Buttons, 2 HC-05 Bluetooth Modules, 1 SPI LCD Display<br />
<br />
Diagrams of the '''Transmitter Board (Stopwatch)''' and the '''Reciever Board (Server)'''<br />
<br />
[[File:BT_TX_bb.png|550px|Transmitter Board (Stopwatch)]][[File:BT_RX_bb.png|450px|Reciever Board (Server)]]<br />
<br />
== Installation Instructions ==<br />
<br />
Give step by step instructions on how to install your project. <br />
<br />
1) Connect bone to internet and follow instructions on the [https://github.com/prof-nuduls/BT_StopWatch GitHub]<br />
<br />
2) Make sure git is installed and setup on both device<br />
<br />
3) Clone the repository on both devices using the following command<br />
bone$ '''git clone https://github.com/prof-nuduls/BT_StopWatch'''<br />
<br />
'''Stopwatch'''<br />
<br />
4) Navigate into GUI folder<br />
bone$ '''cd ./BT_StopWatch/GUI'''<br />
<br />
5) Run the following command to start timer application<br />
bone$ '''sudo ./timer.py'''<br />
<br />
'''Reciever'''<br />
<br />
6) Navigate to Receiver folder<br />
bone$ '''cd ./BT_StopWatch/Receiver'''<br />
<br />
7) Run the following command to start receiver application<br />
bone$ '''./receiver.py'''<br />
<br />
== User Instructions ==<br />
<br />
You will enter the welcome screen where you will Press START to select a profile. Using the LAP Button you will be able to cycle through the profiles. In order to select a profile, you will hit the START Button To start the stopwatch, press the START Button<br />
<br />
Press the LAP Button when you want to lap, and a split time will appear.<br />
<br />
Once you are done, press the STOP Button to stop the program and register the final time. After the Stop button has been pressed, the data will transfer to connected Bluetooth reciever and uploaded onto Google Sheets.<br />
<br />
== Highlights ==<br />
<br />
Our project boasts a Bluetooth-enabled stopwatch that prioritizes user-friendliness, offering a simple interface and only three buttons. The inclusion of profiles for Tux and Boris also adds an element of fun and personality to the project.<br />
<br />
To ensure optimal performance and efficiency, we've opted for a two-BeagleBone Black device setup - one serving as the stopwatch and the other functioning as a server to receive Bluetooth commands. Additionally, our stopwatch can transmit final times and splits to Google Sheets, simplifying the process of tracking and analyzing your workout data. Overall, this project offers a streamlined and fun way to time your workouts, with plenty of room for further expansion and customization.<br />
<br />
Here is a video demo which is available on [https://youtu.be/-Ch7axrCIds YouTube].<br />
<br />
We've also included a [https://www.hackster.io/mac0_tac0/bluetooth-stopwatch-with-profile-selector-4d2d3d Hackster.io] page.<br />
<br />
== Theory of Operation ==<br />
<br />
The user will run the transmitter code on a BeagleBone Black and run the receiver code on a separate Beagle Bone Black. The transmitter/GUI side uses 3 buttons (Start,Stop,Lap) to interface with the SPI LCD Display. The user will select a profile, then start the stopwatch, gather splits and relevant race data, and once the stop button is pressed the final time is displayed and transmitted over bluetooth to the receiver which logs the split data into google sheets for the relevant profile.<br />
<br />
[[File:Stopwatch_Code_Block.png|1000px|]]<br />
<br />
[[File:Receiver_Code_Block.png|1000px||]]<br />
<br />
== Work Breakdown ==<br />
<br />
'''<big><big>Timeline:</big></big>'''<br />
* Create basic code for HC-05 Bluetooth Modules to Transmit and Receive data to one another -- Feb. 9<br />
* Create basic code for GUI on the SPI LCD Display controlled by buttons -- Feb. 12<br />
* Debug and straighten out any bugs or erroneous button presses that could occur -- Feb. 18<br />
* Send Final time and splits to Bluetooth Receiver and send the results to google sheets -- Feb. 19<br />
<br />
'''<big><big>Division of Labor:</big></big>'''<br />
* Develop configuration, transmitter, and receiver code for HC-05 Bluetooth Modules (DERICK)<br />
* Develop Stopwatch and GUI Code, that stores splits into arrays and displays them onto the screen (MARCO)<br />
* Develop Bluetooth Receiver code/Google Sheets code, and add transmitting functionality to GUI and Stopwatch code (DERICK)<br />
* fix minor bugs, and test stopwatch (MARCO & DERICK)<br />
<br />
== Future Work ==<br />
<br />
To make this project even more interesting, future additions could include incorporating a larger display to provide better visibility for users, and incorporating machine learning to provide personalized coaching and recommendations for improvement based on users' previous performance. Additionally, expanding the project to include other fitness tracking features like heart rate monitoring, distance tracking, and calorie tracking would also be a valuable addition.<br />
<br />
== Conclusions ==<br />
<br />
Working on this project, we learned how to implement new hardware and protocols we've never interfaced with before, using forums to get assistance, and learned how to collaborate using GitHub in an effective manner in a team setting. It was rewarding to see all of the information we have learned about opensource, linux, and github come together in a final project and we think it came out great.<br />
<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=ECE434_Project_-_Audio_Spectrum_Display&diff=580165ECE434 Project - Audio Spectrum Display2023-11-27T21:15:58Z<p>Yoder: </p>
<hr />
<div>[[Category:ECE434Fall2022 |PA]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:dfirestorm|Donald Hau]]<br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
Add Extras<br />
<br />
09 Executive Summary<br />
09 Packaging<br />
09 Installation Instructions <br />
09 User Instructions<br />
09 Highlights<br />
09 Theory of Operation<br />
09 Work Breakdown<br />
09 Future Work/Conclusions<br />
09 Hackster.io<br />
09 Demo/Poster<br />
00 Not Late<br />
<br />
Score: 90/100<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
<br />
[[File:Audio spectrum display 8x8.jpeg|thumb|The completed project in use on a breadboard]]<br />
This project uses a microphone via an analog input, performs a FFT calculation on it and displays the output to a RGB LED matrix. <br />
<br />
The portions of the project which work well include the microphone and the FFT. Using continuous analog input on the iio system, the microphone produces an array which is perfect for FFT work. <br />
<br />
The RGB LED matrix refuses to work, at least with the PRU input. With mmap in python, it works better but not well enough to integrate with the audio processing. Instead, I used the 8x8 bi-color LED matrix found in the ECE434 kit, which required some code modification to accommodate the different display size. <br />
After some fine tuning of the scaling of magnitude and width of FFT buckets, the project is very good at displaying a rudimentary audio spectrum. <br />
<br />
== Packaging ==<br />
<br />
I will put a fritzing diagram here when I get that worked out. It currently sits on a breadboard but could easily be compressed to a tiny box for portable operation, or attached to the back of the larger matrix display. <br />
<br />
== Installation Instructions ==<br />
<br />
This project requires no more than the basic systems on board the Bone for the working version with the 8x8 matrix. an install.sh script is included for the python libraries used. <br />
The Github link is here, it includes much more detail than is listed here. [https://github.com/dfirestorm/bone-audio-display https://github.com/dfirestorm/bone-audio-display]. <br />
<br />
== User Instructions ==<br />
<br />
to run, just run ./main.py , and use ctrl-c to stop. This program runs continuously and takes up about 8% CPU so autostart was not the greatest option. <br />
<br />
== Highlights ==<br />
<br />
This project is very capable of real-time audio spectrum display, and could be used to determine the acoustic characteristics of a room, voice, or instrument quite quickly though somewhat inelegantly. The code is incredibly modular and can easily be changed to output the raw values to the console, or to change the matrix size. There is a lot of variability in the tuning of the output as well, from the minimum and maximum dB scaling to the amount of low end frequency to ignore. <br />
<br />
The FFT process is highly efficient and modular, and is coded in such a way that if one wished to change the display size or microphone, it is easily tunable to new parameters with just variables at the top of the code. <br />
<br />
== Theory of Operation ==<br />
<br />
The way it works is by using the industrial io system on the beaglebone to generate a 96kHz audio signal, making a 481-point FFT of it with numpy, then splitting that FFT into a number of buckets according to the display width. The relative magnitude of the highest point in each bucket to the minimum and maximum determines its height, and that height relative to the display maximum height determines its color. A series of if-else statements produce a matrix to output to the display, with all of the code functions fully modular and variable to different displays so long as the format is compatible.<br />
<br />
the code is set up to output an array with hex values for each column, one bit for each LED in the column and two hex values per column. The first hex value is green and the second is red, combining to make yellow between 50 and 75% of the maximum volume. The integration would need to send this array to the display to be output in the correct order. It assumes the 0,0 is in the bottom right of the display so that may be a desired change for a future user. As well, the setup of the display would need to be updated if the array size would be different as the initial array is hard coded and it only gets modified as the code runs. <br />
<br />
== Work Breakdown ==<br />
<br />
I did this project solo, so I got all of the code and compiled it myself. The major tasks involved were making all of the functions modular, making the FFT to bucket to display code, and fine tuning all of the thresholds for the variables. I also wrote all of the documentation and wiring diagrams, as well as a lot of work on the 64x32 matrix to get that somewhat working even though in the end it did not work. <br />
<br />
== Future Work ==<br />
This project is incredibly modular so long as the display output is in a similar format to the one used by the Adafruit 8x8 matrix. The obvious continuation is to convert it to the 64x32 matrix, but another important addition would be tuning it to the standard 20Hz-20kHz human hearing and marking the audio peaks. The audio peaks would not be difficult but on an 8x8 display are a little awkward. <br />
<br />
== Conclusions ==<br />
<br />
This was an enjoyable project, though working with the 64x32 matrix was much more difficult than expected. I would love to see someone get it working but it proved too much for myself. As well, this project could be interesting to port to other devices. <br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=ECE497_Past_Classes&diff=580162ECE497 Past Classes2023-11-27T21:15:08Z<p>Yoder: </p>
<hr />
<div>[[Category:ECE597 |Past]]<br />
{{YoderHead}}<br />
<br />
Here are the pages from past classes:<br />
<br />
* [[:Category:ECE434Winter2324 | Winter 2023-2024]]<br />
* [[:Category:ECE434Fall2022 | Fall 2022]]<br />
* [[:Category:ECE434Fall2021 | Fall 2021]]<br />
* [[:Category:ECE434Fall2020 | Fall 2020]]<br />
* [[:Category:ECE497Fall2019 | Fall 2019]]<br />
* [[:Category:ECE497Fall2018 | Fall 2018]]<br />
* [[:Category:ECE497Fall2017 | Fall 2017]]<br />
* [[:Category:ECE497Fall2016 | Fall 2016]]<br />
* [[:Category:ECE497Fall2014 | Fall 2014]]<br />
* [[:Category:ECE497Fall2013 | Fall 2013]]<br />
* [[:Category:ECE497Fall2012 | Fall 2012]]<br />
* [[:Category:ECE497Winter1112 | Winter 2011-2012]]<br />
* [[:Category:ECE497Spring2011| Spring 2011]]<br />
* [[:Category:ECE597Spring2010 | Spring 2010]]<br />
<br />
[[Category:ECE497 |Past]]<br />
[[Category:ECE497Fall2014]]<br />
[[Category:ECE497Fall2013]]<br />
[[Category:ECE497Fall2012]]<br />
[[Category:ECE497Winter1112]]<br />
[[Category:ECE497Spring2011]]<br />
[[Category:ECE597Spring2010]]<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=Category:ECE434Fall2022&diff=580159Category:ECE434Fall20222023-11-27T21:12:57Z<p>Yoder: Created blank page</p>
<hr />
<div></div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_09_Working_With_Open_Source&diff=580099EBC Exercise 09 Working With Open Source2023-11-14T21:14:04Z<p>Yoder: /* BeagleBoard Google Group */ Removed</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
The BeagleBoard has a huge open source community. To be effective at using the Beagle you need to learn how work with the community. The purpose of this exercise is to introduce you some of the Beagle communities. <br />
<br />
=== eLinux.org ===<br />
<br />
[http://eLinux.org eLinux.org] is where this page is posted. It's also where I've posted all the class exercises. I tag all my pages with '''<nowiki>[[Category:ECE497]]</nowiki>''' so it's easy to find all my pages here [[:Category:ECE497]]. Bookmark it, you'll use it a lot.<br />
<br />
# Create a user name on [http://elinux.org eLinux.org]<br />
# Edit your User page on eLinux and add '''<pre>[[Category:ECE497 |Ux]]</pre>''' to it, where ''x'' is the first initial of your last name. This will make it appear on the Category page under '''U''' sorted by last name. Check out [[User:Mayhewsw]] for ideas of what else to put on your User page.<br />
<br />
=== Beagle repos ===<br />
[https://elinux.org/EBC_Exercise_16_git_-_Beagle_repos https://elinux.org/EBC_Exercise_16_git_-_Beagle_repos] is a list of all the repositories I could find.<br />
<br />
=== BeagleBoard.org ===<br />
<br />
[http://beagleboard.org/ BeagleBoard.org] is the "official" BeagleBoard site, you'll find lots of good information here. <br />
<br />
Check out the FAQ. It has some good suggestions on where to find information.<br />
<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_05_Getting_Exercise_Support_Materials&diff=580096EBC Exercise 05 Getting Exercise Support Materials2023-11-14T21:10:22Z<p>Yoder: /* Download Reference Manuals */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
You need to download some reference manuals and set up your Beagle with some extra files. Here's what to do.<br />
<br />
== Download Reference Manuals ==<br />
There are two important hardware reference manuals you need to have, the '''System Reference Manual''' (SRM) and the '''Technical Reference Manual''' (TRM) for the ARM processor. Here's where to find them.<br />
# The official SRM is kept https://yoder.beagleboard.io/docs.beagleboard.io/latest/boards/beaglebone/black/index.html. You will want to bookmark this. <br />
# The TRM for the am335x is on [http://www.ti.com/lit/pdf/spruh73 TI's site].<br />
<br />
Keep both of these in an easy to find place, we'll reference them now and then.<br />
<br />
== Get the Files ==<br />
<br />
It only takes one command to pull down all the files.<br />
<br />
bone$ '''git clone https://github.com/MarkAYoder/BeagleBoard-exercises.git exercises --depth=1'''<br />
(The whole repo is some 700M. Using '''--depth=1''' you only get the recent history and it only takes 200M.)<br />
<br />
This will take a while since it's getting all the course files, including pdf files of the course PowerPoint. You only have to clone once for each computer. I suggest you do the same on your host computer if you haven't done so already.<br />
<br />
host$ '''git clone https://github.com/MarkAYoder/BeagleBoard-exercises.git exercises --depth=1'''<br />
<br />
Now take a look at what you got.<br />
<br />
bone$ '''cd exercises'''<br />
bone$ '''ls'''<br />
bone$ '''cd pptx'''<br />
bone$ '''ls'''<br />
<br />
== Set Up Git ==<br />
<br />
On ''both'' the host and the bone run:<br />
$ '''git config --global user.name "Mark A. Yoder"'''<br />
$ '''git config --global user.email Mark.A.Yoder@Rose-Hulman.edu'''<br />
$ '''git config --global core. Editor nano'''<br />
Use your name and email address and your favorite editor. This sets the global values.<br />
<br />
Later exercises will tell you which files to use from here.<br />
<br />
== P8 and P9 Header Files ==<br />
The BeagleBone Black has two headers, P8 and P9, that have lots of IO. There are two [http://derekmolloy.ie/gpios-on-the-beaglebone-black-using-device-tree-overlays/ pdf files] that have lots of information about the headers in this git repository. Here's how to get them<br />
host$ '''git clone https://github.com/derekmolloy/exploringBB.git'''<br />
host$ '''cd exploringBB/chp06/docs'''<br />
host$ '''ls'''<br />
BeagleboneBlackP8HeaderTable.pdf BeagleboneBlackP9HeaderTable.pdf<br />
Put these where you can find them again.<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_03_Installing_a_Beagle_OS&diff=580093EBC Exercise 03 Installing a Beagle OS2023-11-14T20:50:34Z<p>Yoder: /* Downloads */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
In this class we run [https://www.debian.org/ The Debian Distribution] on the BeagleBoard. Here's how to load the Debian image we'll be using on an SD card. First get a microSD card that holds at least 8G.<br />
== Downloads ==<br />
There are two items you need to download, the image to copy to your SD card and the software to copy it. <br />
<br />
Use '''balenaEtcher''' to copy to your SD card. Download it from here: https://etcher.balena.io/. It runs on Linux, Mac or Windows, so pick your favorite OS and install it.<br />
Or <br />
host$ '''sudo apt install balena-etcher-electron'''<br />
host$ '''cd /usr/bin'''<br />
host$ '''rm balena-etcher-electron'''<br />
host$ '''sudo ln -s /opt/balenaEtcher/balena-etcher-electron .'''<br />
host$ '''balena-etcher-electron --no-sandbox --disable-gpu-sandbox --disable-seccomp-filter-sandbox'''<br />
<br />
From https://cloudsmith.io/~balena/repos/etcher/setup/#formats-deb and https://github.com/balena-io/etcher/issues/3761<br />
<br />
There are many versions of Debian we could use. Browse to https://forum.beagleboard.org/t/debian-12-x-bookworm-monthly-snapshot-2023-10-07/36175 and download [https://rcn-ee.com/rootfs/release/2023-10-07/bookworm-iot-armhf/am335x-debian-12.2-iot-armhf-2023-10-07-4gb.img.xz '''am335x-debian-12.2-iot-armhf-2023-10-07-4gb.img.xz''']<br />
<br />
== Copying to your SD card ==<br />
# Start up balenaEtcher. <br />
# Select the image you downloaded (no need to uncompress it). <br />
# Put your SD card in the reader and select it. <br />
# Click '''Flash!''' and wait for it to finish.<br />
<br />
Once the SD card is flashed, put it in your Bone and boot it up.<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_03_Installing_a_Beagle_OS&diff=580090EBC Exercise 03 Installing a Beagle OS2023-11-14T20:49:06Z<p>Yoder: /* Downloads */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
In this class we run [https://www.debian.org/ The Debian Distribution] on the BeagleBoard. Here's how to load the Debian image we'll be using on an SD card. First get a microSD card that holds at least 8G.<br />
== Downloads ==<br />
There are two items you need to download, the image to copy to your SD card and the software to copy it. <br />
<br />
Use '''balenaEtcher''' to copy to your SD card. Download it from here: https://etcher.balena.io/. It runs on Linux, Mac or Windows, so pick your favorite OS and install it.<br />
Or <br />
host$ '''sudo apt install balena-etcher-electron'''<br />
host$ '''cd /usr/bin'''<br />
host$ '''rm balena-etcher-electron'''<br />
host$ '''sudo ln -s /opt/balenaEtcher/balena-etcher-electron .'''<br />
host$ '''balena-etcher-electron --no-sandbox --disable-gpu-sandbox --disable-seccomp-filter-sandbox'''<br />
<br />
From https://cloudsmith.io/~balena/repos/etcher/setup/#formats-deb and https://github.com/balena-io/etcher/issues/3761<br />
<br />
There are many versions of Debian we could use. Browse to https://forum.beagleboard.org/t/debian-12-x-bookworm-monthly-snapshot-2023-10-07/36175 and download [https://rcn-ee.com/rootfs/bb.org/testing/2022-11-01/bullseye-iot-armhf/am335x-debian-11.5-iot-armhf-2022-11-01-4gb.img.xz '''am335x-debian-11.5-iot-armhf-2022-10-10-4gb.img.xz''']<br />
<br />
== Copying to your SD card ==<br />
# Start up balenaEtcher. <br />
# Select the image you downloaded (no need to uncompress it). <br />
# Put your SD card in the reader and select it. <br />
# Click '''Flash!''' and wait for it to finish.<br />
<br />
Once the SD card is flashed, put it in your Bone and boot it up.<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_03_Installing_a_Beagle_OS&diff=580087EBC Exercise 03 Installing a Beagle OS2023-11-14T20:45:53Z<p>Yoder: /* Downloads */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
In this class we run [https://www.debian.org/ The Debian Distribution] on the BeagleBoard. Here's how to load the Debian image we'll be using on an SD card. First get a microSD card that holds at least 8G.<br />
== Downloads ==<br />
There are two items you need to download, the image to copy to your SD card and the software to copy it. <br />
<br />
Use '''balenaEtcher''' to copy to your SD card. Download it from here: https://etcher.balena.io/. It runs on Linux, Mac or Windows, so pick your favorite OS and install it.<br />
Or <br />
host$ '''sudo apt install balena-etcher-electron'''<br />
host$ '''cd /usr/bin'''<br />
host$ '''rm balena-etcher-electron'''<br />
host$ '''sudo ln -s /opt/balenaEtcher/balena-etcher-electron .'''<br />
host$ '''balena-etcher-electron --no-sandbox --disable-gpu-sandbox --disable-seccomp-filter-sandbox'''<br />
<br />
From https://cloudsmith.io/~balena/repos/etcher/setup/#formats-deb and https://github.com/balena-io/etcher/issues/3761<br />
<br />
There are many versions of Debian we could use. Browse to https://forum.beagleboard.org/tag/latest-images and download [https://rcn-ee.com/rootfs/bb.org/testing/2022-11-01/bullseye-iot-armhf/am335x-debian-11.5-iot-armhf-2022-11-01-4gb.img.xz '''am335x-debian-11.5-iot-armhf-2022-10-10-4gb.img.xz''']<br />
<br />
== Copying to your SD card ==<br />
# Start up balenaEtcher. <br />
# Select the image you downloaded (no need to uncompress it). <br />
# Put your SD card in the reader and select it. <br />
# Click '''Flash!''' and wait for it to finish.<br />
<br />
Once the SD card is flashed, put it in your Bone and boot it up.<br />
<br />
{{YoderFoot}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_01_Start_Here&diff=580084EBC Exercise 01 Start Here2023-11-14T20:21:09Z<p>Yoder: /* You may have, or will have to buy */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
== Overview ==<br />
<br />
There are three major things that need to be done to have the BeagleBoard ready to run for class:<br />
# Get your Beagle Hardware together<br />
# Set up a host computer, running Linux for code development<br />
# Clone the course git repository on both the host and the Beagle<br />
<br />
== The Hardware ==<br />
<br />
Here's the hardware you will need and where you get it.<br />
<br />
=== You may have, or will have to buy ===<br />
<br />
We are using the [https://www.beagleboard.org/boards/beaglebone-black BeagleBone Black] this year. Since it's only $75 (or so) I'll have you buy your own. There are a few other things you will need to get before the first day of class.<br />
* BeagleBone Black. See [https://www.beagleboard.org/boards/beaglebone-black https://www.beagleboard.org/boards/beaglebone-black] for suggestions of where to buy the Black. I suggest ordering sooner rather than later since it may take a couple of weeks. Note: If you already have a different Beagle and want to use it, contact me.<br />
* At least two 8G micro SD cards. I suggest you have 2 or 3 cards since it's easy to mess up one and it takes some 10 minutes to reload it.<br />
* micro SD card reader/writer<br />
<br />
==== Books ====<br />
* (optional but good) [http://exploringbeaglebone.com/ Exploring BeagleBone]. Be sure to get the [https://www.amazon.com/Exploring-BeagleBone-Techniques-Building-Embedded/dp/1119533163 second edition].<br />
* (optional but free) [https://docs.beagleboard.io/latest/books/beaglebone-cookbook/index.html BeagleBone Cookbook] (Not the BeagleBone Black Cookbook, it's a different book.)<br />
<br />
=== What you buy from the Instrument Room ===<br />
<br />
* various input devices, sensors, displays, etc.<br />
<br />
=== What you borrow from the Instrument Room ===<br />
* Proto Plate with full sized breadboard<br />
* 5V power supply<br />
* [http://www.monoprice.com/products/product.asp?c_id=104&cp_id=10419&cs_id=1041913&p_id=7703&seq=1&format=2 micro HDMI to HDMI adapter]<br />
* [https://www.sparkfun.com/products/9717 FTDI USB to Serial Adapter] Must be 3.3V version<br />
* [http://www.adafruit.com/products/902 Bicolor LED Square Pixel Matrix with I2C Backpack]<br />
* Two (2) [http://www.ti.com/product/tmp101 TMP101] temperature sensors<br />
* Other sensors<br />
<br />
== The Linux host computer ==<br />
<br />
Since we are doing Linux development, it's generally agreed the host computer should be running Linux. I suggest you run [https://www.ubuntu.com/download/desktop Ubuntu 22.04 (LTS)]. You want the '''desktop-amd64.iso''' if you have a 64-bit machine.<br />
<br />
There are options as to how to run Linux.<br />
# Install Windows Subsystem for Linux (WSL) ([https://learn.microsoft.com/en-us/windows/wsl/install install]) I run it and it works fine. I suggest using it.<br />
# Install in a virtual machine. I've been running [https://www.virtualbox.org Virtual Box]. <br />
# Native install ([http://www.ubuntu.com/download])<br />
<br />
I suggest you use WSL.<br />
No matter which method you use be sure to have some 30G of disk space. The kernel tools will need at least 6G.<br />
<br />
If you do use Virtual Box, do this once you've set things up:<br />
* In the VM, go to Devices:Insert Guest Addition CD Image...<br />
* A box will appear. Click '''RUN''' Wait while it installs.<br />
* If it says '''This system is currently not set up to build kernel modules.''', run '''sudo apt update''' and '''sudo apt install gcc make perl'''<br />
* Reboot the VM.<br />
* In the VM, go to Devices:USB and select the Beagle.<br />
You are ready to go.<br />
<br />
{{YoderHead}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_01_Start_Here&diff=580081EBC Exercise 01 Start Here2023-11-14T20:20:18Z<p>Yoder: /* You may have, or will have to buy */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
== Overview ==<br />
<br />
There are three major things that need to be done to have the BeagleBoard ready to run for class:<br />
# Get your Beagle Hardware together<br />
# Set up a host computer, running Linux for code development<br />
# Clone the course git repository on both the host and the Beagle<br />
<br />
== The Hardware ==<br />
<br />
Here's the hardware you will need and where you get it.<br />
<br />
=== You may have, or will have to buy ===<br />
<br />
We are using the [https://www.beagleboard.org/boards/beaglebone-black BeagleBone Black] this year. Since it's only $75 (or so) I'll have you buy your own. There are a few other things you will need to get before the first day of class.<br />
* BeagleBone Black. See [https://www.beagleboard.org/boards/beaglebone-black https://www.beagleboard.org/boards/beaglebone-black] <br />
for suggestions of where to buy the Black. I suggest ordering sooner rather than later since it may take a couple of weeks. Note: If you already have a different Beagle and want to use it, contact me.<br />
* At least two 8G micro SD cards. I suggest you have 2 or 3 cards since it's easy to mess up one and it takes some 10 minutes to reload it.<br />
* micro SD card reader/writer<br />
<br />
==== Books ====<br />
* (optional but good) [http://exploringbeaglebone.com/ Exploring BeagleBone]. Be sure to get the [https://www.amazon.com/Exploring-BeagleBone-Techniques-Building-Embedded/dp/1119533163 second edition].<br />
* (optional but free) [https://docs.beagleboard.io/latest/books/beaglebone-cookbook/index.html BeagleBone Cookbook] (Not the BeagleBone Black Cookbook, it's a different book.)<br />
<br />
=== What you buy from the Instrument Room ===<br />
<br />
* various input devices, sensors, displays, etc.<br />
<br />
=== What you borrow from the Instrument Room ===<br />
* Proto Plate with full sized breadboard<br />
* 5V power supply<br />
* [http://www.monoprice.com/products/product.asp?c_id=104&cp_id=10419&cs_id=1041913&p_id=7703&seq=1&format=2 micro HDMI to HDMI adapter]<br />
* [https://www.sparkfun.com/products/9717 FTDI USB to Serial Adapter] Must be 3.3V version<br />
* [http://www.adafruit.com/products/902 Bicolor LED Square Pixel Matrix with I2C Backpack]<br />
* Two (2) [http://www.ti.com/product/tmp101 TMP101] temperature sensors<br />
* Other sensors<br />
<br />
== The Linux host computer ==<br />
<br />
Since we are doing Linux development, it's generally agreed the host computer should be running Linux. I suggest you run [https://www.ubuntu.com/download/desktop Ubuntu 22.04 (LTS)]. You want the '''desktop-amd64.iso''' if you have a 64-bit machine.<br />
<br />
There are options as to how to run Linux.<br />
# Install Windows Subsystem for Linux (WSL) ([https://learn.microsoft.com/en-us/windows/wsl/install install]) I run it and it works fine. I suggest using it.<br />
# Install in a virtual machine. I've been running [https://www.virtualbox.org Virtual Box]. <br />
# Native install ([http://www.ubuntu.com/download])<br />
<br />
I suggest you use WSL.<br />
No matter which method you use be sure to have some 30G of disk space. The kernel tools will need at least 6G.<br />
<br />
If you do use Virtual Box, do this once you've set things up:<br />
* In the VM, go to Devices:Insert Guest Addition CD Image...<br />
* A box will appear. Click '''RUN''' Wait while it installs.<br />
* If it says '''This system is currently not set up to build kernel modules.''', run '''sudo apt update''' and '''sudo apt install gcc make perl'''<br />
* Reboot the VM.<br />
* In the VM, go to Devices:USB and select the Beagle.<br />
You are ready to go.<br />
<br />
{{YoderHead}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_01_Start_Here&diff=580078EBC Exercise 01 Start Here2023-11-14T20:19:00Z<p>Yoder: /* You may have, or will have to buy */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
== Overview ==<br />
<br />
There are three major things that need to be done to have the BeagleBoard ready to run for class:<br />
# Get your Beagle Hardware together<br />
# Set up a host computer, running Linux for code development<br />
# Clone the course git repository on both the host and the Beagle<br />
<br />
== The Hardware ==<br />
<br />
Here's the hardware you will need and where you get it.<br />
<br />
=== You may have, or will have to buy ===<br />
<br />
We are using the [https://www.beagleboard.org/boards/beaglebone-black BeagleBone Black] this year. Since it's only $55 (or so) I'll have you buy your own. There are a few other things you will need to get before the first day of class.<br />
* BeagleBone Black. See [http://beagleboard.org/black http://beagleboard.org/black] for suggestions of where to buy the Black. I suggest ordering sooner rather than later since it may take a couple of weeks. Note: If you already have a different Beagle and want to use it, contact me.<br />
* At least two 8G micro SD cards. I suggest you have 2 or 3 cards since it's easy to mess up one and it takes some 10 minutes to reload it.<br />
* micro SD card reader/writer<br />
<br />
==== Books ====<br />
* (optional but good) [http://exploringbeaglebone.com/ Exploring BeagleBone]. Be sure to get the [https://www.amazon.com/Exploring-BeagleBone-Techniques-Building-Embedded/dp/1119533163 second edition].<br />
* (optional but free) [https://docs.beagleboard.io/latest/books/beaglebone-cookbook/index.html BeagleBone Cookbook] (Not the BeagleBone Black Cookbook, it's a different book.)<br />
<br />
=== What you buy from the Instrument Room ===<br />
<br />
* various input devices, sensors, displays, etc.<br />
<br />
=== What you borrow from the Instrument Room ===<br />
* Proto Plate with full sized breadboard<br />
* 5V power supply<br />
* [http://www.monoprice.com/products/product.asp?c_id=104&cp_id=10419&cs_id=1041913&p_id=7703&seq=1&format=2 micro HDMI to HDMI adapter]<br />
* [https://www.sparkfun.com/products/9717 FTDI USB to Serial Adapter] Must be 3.3V version<br />
* [http://www.adafruit.com/products/902 Bicolor LED Square Pixel Matrix with I2C Backpack]<br />
* Two (2) [http://www.ti.com/product/tmp101 TMP101] temperature sensors<br />
* Other sensors<br />
<br />
== The Linux host computer ==<br />
<br />
Since we are doing Linux development, it's generally agreed the host computer should be running Linux. I suggest you run [https://www.ubuntu.com/download/desktop Ubuntu 22.04 (LTS)]. You want the '''desktop-amd64.iso''' if you have a 64-bit machine.<br />
<br />
There are options as to how to run Linux.<br />
# Install Windows Subsystem for Linux (WSL) ([https://learn.microsoft.com/en-us/windows/wsl/install install]) I run it and it works fine. I suggest using it.<br />
# Install in a virtual machine. I've been running [https://www.virtualbox.org Virtual Box]. <br />
# Native install ([http://www.ubuntu.com/download])<br />
<br />
I suggest you use WSL.<br />
No matter which method you use be sure to have some 30G of disk space. The kernel tools will need at least 6G.<br />
<br />
If you do use Virtual Box, do this once you've set things up:<br />
* In the VM, go to Devices:Insert Guest Addition CD Image...<br />
* A box will appear. Click '''RUN''' Wait while it installs.<br />
* If it says '''This system is currently not set up to build kernel modules.''', run '''sudo apt update''' and '''sudo apt install gcc make perl'''<br />
* Reboot the VM.<br />
* In the VM, go to Devices:USB and select the Beagle.<br />
You are ready to go.<br />
<br />
{{YoderHead}}</div>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_16_git_-_Beagle_repos&diff=579679EBC Exercise 16 git - Beagle repos2023-10-11T17:34:58Z<p>Yoder: /* Documentation */</p>
<hr />
<div>[[Category:ECE497]]<br />
{{YoderHead}}<br />
<br />
The repositories used for the Beagle seem to be scattered all over the place. Here's an attempt to list them. <br />
<br />
== Collaboration ==<br />
<br />
; Discord<br />
: https://bbb.io/discord<br />
<br />
; Slack<br />
: https://beagleboard.slack.com<br />
<br />
; Forum<br />
: https://forum.beagleboard.org/<br />
<br />
== Documentation ==<br />
<br />
; git.beagleboard.org<br />
: https://git.beagleboard.org/docs/docs.beagleboard.io/-/tree/main/<br />
<br />
; git.beagleboard.org/yoder<br />
: https://git.beagleboard.org/yoder/docs.beagleboard.io<br />
<br />
; Formatted<br />
: https://docs.beagleboard.org/latest/index.html<br />
<br />
; Staged<br />
: https://docs.beagleboard.io/latest/index.html<br />
<br />
; Mine<br />
: https://yoder.beagleboard.io/docs.beagleboard.io/latest/<br />
<br />
== Images ==<br />
<br />
; Latest<br />
: https://forum.beagleboard.org/tag/latest-images<br />
<br />
; Snapshot<br />
: https://rcn-ee.net/rootfs/snapshot/<br />
<br />
== System Reference Manuals ==<br />
<br />
; Black<br />
: https://github.com/beagleboard/beaglebone-black/wiki/System-Reference-Manual<br />
<br />
; Pocket<br />
: https://github.com/beagleboard/pocketbeagle/wiki/System-Reference-Manual<br />
<br />
; AI<br />
: https://github.com/beagleboard/beaglebone-ai/wiki/System-Reference-Manual<br />
<br />
; Cape<br />
: https://elinux.org/Beagleboard:BeagleBone_cape_interface_spec<br />
<br />
== Technical Reference Manuals ==<br />
<br />
; am335x<br />
: http://www.ti.com/lit/pdf/spruh73 Black, Pocket, etc.<br />
<br />
; am572x<br />
: http://www.ti.com/lit/ug/spruhz6k/spruhz6k.pdf AI<br />
<br />
== Beagle github repos ==<br />
<br />
; repos<br />
: https://github.com/rcn-ee/repos<br />
<br />
;Kernel<br />
: https://github.com/RobertCNelson/bb-kernel<br />
<br />
; Test images<br />
: https://rcn-ee.com/rootfs/bb.org/testing/<br />
<br />
; Device Trees<br />
: https://github.com/beagleboard/BeagleBoard-DeviceTrees Look in src/arm. am5729-beagleboneai.dts is for the AI.<br />
<br />
; Overlays<br />
: https://github.com/beagleboard/bb.org-overlays This may already be in <code>/opt/source/bb.org-overlays</code><br />
<br />
; Boot Scripts<br />
: https://github.com/RobertCNelson/boot-scripts Just a bunch of useful scripts placed under /opt/scripts/.<br />
<br />
; Image Builder<br />
: https://github.com/beagleboard/image-builder Image builder and eeprom database.<br />
<br />
; Beagle Tester<br />
: https://github.com/jadonk/beagle-tester Simplify and standardize testing of BeagleBoard.org designs<br />
<br />
; udev rules<br />
: https://github.com/beagleboard/customizations Look in etc/udev/rules.d for udev rules<br />
<br />
; Cloud9 Examples<br />
: https://github.com/beagleboard/cloud9-examples.git These are the files that appear in the navigation tree on the left of Cloud9.<br />
<br />
; BoneScript<br />
: https://github.com/beagleboard/bonescript Scripting tools for the BeagleBoard and BeagleBone<br />
<br />
; Adafruit BeagleBone Python<br />
: https://github.com/adafruit/adafruit-beaglebone-io-python Adafruit's BeagleBone IO Python Library<br />
<br />
; Seed Grove kernel module<br />
: https://github.com/Seeed-Studio/seeed-linux-dtoverlays/tree/master/modules<br />
<br />
; BeagleBoard exercieses<br />
: https://github.com/MarkAYoder/BeagleBoard-exercises.git This is the repo I use for my class.<br />
<br />
; BeagleBone Cookbook<br />
: https://atlas.oreilly.com/oreillymedia/beaglebone-cookbook You need a password for this one.<br />
<br />
; PRU Cookbook<br />
: https://github.com/MarkAYoder/PRUCookbook.git The repo for the PRU Cookbook. No password needed.<br />
<br />
; Exploring BeagleBoard<br />
: https://github.com/derekmolloy/exploringBB.git A great book by Derek Molloy.<br />
<br />
; Mag Pi Downloader<br />
: https://github.com/joergi/MagPiDownloader.git Good source of ideas.<br />
<br />
== Header files ==<br />
<br />
; BeagleBone Black P8<br />
:https://github.com/derekmolloy/boneDeviceTree/blob/master/docs/BeagleboneBlackP8HeaderTable.pdf<br />
<br />
; BeagleBone Black P9<br />
:https://github.com/derekmolloy/boneDeviceTree/blob/master/docs/BeagleboneBlackP9HeaderTable.pdf<br />
<br />
; PocketBeagle pins<br />
: https://docs.google.com/spreadsheets/d/1FRGvYOyW1RiNSEVprvstfJAVeapnASgDXHtxeDOjgqw/edit#gid=0<br />
<br />
; BeagleBone AI P8 Header<br />
: https://docs.google.com/spreadsheets/d/1opaOLjF7_EDNCR3g5NiEILsJba8h5ZumSeBwOvD1-6Q/edit#gid=0<br />
<br />
; BeagleBone AI P9 Header<br />
: https://docs.google.com/spreadsheets/d/12qkmnyM3qgxL-F6tBKBaA220u_hGWrLgVg9rrCykZ2Q/edit#gid=0<br />
<br />
; BeagleBone AI PRU pins<br />
: https://docs.google.com/spreadsheets/d/19u2rtqVGChSOd0_8ZJj_E3XosuGBpWy7j633__siOvw/edit#gid=0<br />
<br />
; BeagleBone Cape Header Pins<br />
: https://docs.google.com/spreadsheets/d/1fE-AsDZvJ-bBwzNBj1_sPDrutvEvsmARqFwvbw_HkrE/edit?ts=5d3a7a23#gid=1518010293<br />
<br />
{{YoderFoot}}</div>Yoder