Difference between revisions of "BeagleBoard/GSoC/2021 Proposal/beagle config"

From eLinux.org
Jump to: navigation, search
(Created page with "= Proposal for Device Tree Improvement = * Student: [https://elinux.org/User:Satacker Shreyas Atre] * Mentors: Not Assigned * Code: [N/A] * Proposal : https://elinux.org/inde...")
 
 
(31 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Proposal for Device Tree Improvement =
+
[[Category:GSoCProposal2021]]
 +
= Proposal for Beagle Config =
  
 
* Student: [https://elinux.org/User:Satacker Shreyas Atre]
 
* Student: [https://elinux.org/User:Satacker Shreyas Atre]
* Mentors: Not Assigned
+
* Mentors: Kumar Abhishek (IRC: Abhishek_ ) , Deepak Khatri (IRC: lorforlinux)
 
* Code: [N/A]
 
* Code: [N/A]
* Proposal : https://elinux.org/index.php?title=BeagleBoard/GSoC/2021_Proposal/usb_configfs_in_device_tree
+
* Proposal : https://elinux.org/index.php?title=BeagleBoard/GSoC/2021_Proposal/beagle_config
 
* Wiki: [N/A]
 
* Wiki: [N/A]
 
* GSoC: [N/A]
 
* GSoC: [N/A]
Line 12: Line 13:
  
 
= Proposal =
 
= Proposal =
* Completed "Hello Wolrd" of cross compilation mentioned in the requirements list.
+
* Completed all the general requirements
 +
* Completed "Hello World" of cross-compilation mentioned in the requirements list.
 
* Sent a PR to the mentioned upstream [https://github.com/jadonk/gsoc-application/pull/145 #145]
 
* Sent a PR to the mentioned upstream [https://github.com/jadonk/gsoc-application/pull/145 #145]
  
 
== About You ==
 
== About You ==
  
* IRC : satacker  (@satacker:matrix.org)
+
* IRC: satacker  (@satacker:matrix.org)
 
* Github: https://github.com/SAtacker/
 
* Github: https://github.com/SAtacker/
 
* School: [https://vjtimumbai.in/ Veermata Jijabai Technological Institute (VJTI)]
 
* School: [https://vjtimumbai.in/ Veermata Jijabai Technological Institute (VJTI)]
 
* Country: India
 
* Country: India
* Primary language : English, Hindi, Marathi
+
* Primary language: English, Hindi, Marathi
* Typical work hours : 10AM - 7PM Indian Standard Time
+
* Typical work hours: 10 AM - 7 PM Indian Standard Time
 
* Experience :  
 
* Experience :  
* [https://github.com/SAtacker/pid-tuning-gui/tree/satacker/cpp_port Qt Embedded] is my Graphing Qt application as well as for sending data to esp32 microcontroller using Boost.ASIO as Netowrking stack  
+
* [https://github.com/SAtacker/pid-tuning-gui/tree/satacker/cpp_port PID-Tuning-GUI] is my Graphing Qt application as well as for sending data to esp32 microcontroller using Boost.ASIO as Networking stack to configure the Proportional-Integral-Derivative (PID) Controller.
* [https://github.com/SAtacker/kernel_learn kernel learn] is a repo I had created for kernel learning purpose in which I had learned several Kernel development Basics .
+
* [https://github.com/SAtacker/kernel_learn kernel learn] is a repo I had created for kernel learning purposes in which I had learned Kernel module development Basics.
* I have realised the beauty of embedded systems after working on esp32 dev board and reading [http://exploringbeaglebone.com/ Exploring Linux with Beaglebone by  Derek Molloy] while in [https://www.sravjti.in/ Society of Robotics and Automation] as a core team member.  
+
* I have realized the beauty of embedded systems after working on esp32 dev board and reading [http://exploringbeaglebone.com/ Exploring Linux with Beaglebone by  Derek Molloy] while in [https://www.sravjti.in/ Society of Robotics and Automation] as a core team member.  
* This is the first time i am participating in GSoC
+
* This is the first time I am participating in GSoC
  
 
= About Your Project =
 
= About Your Project =
Line 35: Line 37:
 
== Description ==
 
== Description ==
  
* As we all know , nearly all of the user operations in Linux can be done using shell commands , scripts and Linux Userspace Api for advanced users. But all that being said for an average user and sometimes in production these steps can be repetitive and time consuming. For example- Simply sharing network i.e. editing iptables and enabling packet forwarding with Pocketbeagle is an uphill task without a script provided. However running scripts could be dangerous. Even adding a USB gadget without [https://github.com/RobertCNelson/boot-scripts/blob/master/boot/bbai_usb_gadget.sh rcn-ee's boot script] is definitely difficult.  
+
* As we all know, nearly all of the user operations in Linux can be done using shell commands, scripts, and Linux Userspace API for advanced users. But all that being said for an average user and sometimes in production, these steps can be repetitive and time-consuming. For example- Simply sharing a network i.e. editing iptables and enabling forwarding on the host pc is an uphill task without a script provided. However running scripts could be dangerous. [https://www.linuxjournal.com/content/writing-secure-shell-scripts This] explains that using a compiled program instead can implement safe and proper security.
* Enabling the PRU and loading the firmware is much daunting and unless anybody goes through their usage Documentations it will be difficult.
+
* Enabling the PRU and loading the firmware is much daunting and unless anybody goes through their usage, Documentations will be difficult.  
* Not only does it makes beagle devices more friendly but provides an edge to beagleboard over other similar platforms.
+
* Hence ''I propose beagle-config''', a terminal-based UI application that brings down the steep curve and enables anybody to configure their beagle device as they wish. Also, a host-side application to enable ICS
* Hence I propose *beagle-config* which is a terminal based UI application that brings down the steep curve and enables anybody to config their beagle device as they wish.
+
* Not only does it makes beagle devices more friendly but provides an edge to beagle devices over other similar platforms.
* Also while configuring sometimes if the script has hard coded values it makes difficult for the user to go back to default configurations. With beagle-config that won't be a problem anymore
+
* Also, while configuring sometimes if the script has hard-coded values, it is difficult for the user to go back to default configurations. With beagle-config that won't be a problem anymore. Beagle-Config will store the defaults at /usr/local/share/ and user configurations in /home/user/.config/beagle-config/Backups/config.json . This ensures portability and helps in reverting to defaults in case settings are unwanted.
* '''Goal''' : Beagle-Config aims to provide the functionality to make the most common low level configuration changes in beagle devices easily and providing a terminal UI to do the same.
+
* '''Goal''': Beagle-Config aims to provide the functionality to make the most common low-level configuration changes in beagle devices easily and providing a terminal UI to do the same as well as a host-side application for ICS
  
 
== Implementation Details ==
 
== Implementation Details ==
  
* Here are few details of the beagle-config which will use bash, C/C++ as back end for low level access to linux's userspace api and [https://github.com/ArthurSonzogni/FTXUI FTXUI] for frontend.
+
* Beagle-Config consists of a host-side application developed with cross-platform framework Qt.
 +
Reason to choose Qt: It seems that Qt satisfies the objectives which are Good Documentations, Fewer dependencies, and as for deployment electron is easier but Qt is not much difficult. This isn't performance-critical right now but if in the future it adds some performance-critical activity then Qt would be great here.
 +
* Beagle-Config on user (board) side which will use bash, C/C++ as back end for low-level access to linux's userspace API and [https://github.com/ArthurSonzogni/FTXUI FTXUI] for frontend.
  
 +
==== Comparision of a few text-based GUI ====
 +
{| class="wikitable"
 +
|-
 +
! Name !! Description
 +
|-
 +
| [https://github.com/vadimdemedes/ink ink] ||
 +
* It is basically React for cli
 +
* Depends on [https://github.com/facebook/yoga yoga by Facebook]
 +
* Javascript
 +
|-
 +
| [https://github.com/cronvel/terminal-kit terminal-kit] ||
 +
* This is again a JS library
 +
* Easy to develop
 +
|-
 +
| [https://github.com/magiblot/tvision tvision] ||
 +
* UI/UX feels old enough or retro like
 +
* C++ is a plus point
 +
* Depends on libncursesw
 +
|-
 +
| [https://github.com/yaronn/blessed-contrib blessed contrib] ||
 +
* JS
 +
* Nice Widgets support
 +
|-
 +
| [https://github.com/urwid/urwid urwid] ||
 +
* Python
 +
* Many applications built on it
 +
|-
 +
| [https://github.com/ArthurSonzogni/FTXUI FXTUI] ||
 +
* Functional style. Inspired by [1] and React
 +
* No dependencies.
 +
* Cross platform
 +
* Simple and elegant syntax
 +
|}
 +
This wasn't a detailed review but definitely, I would choose FXTUI despite its newness, I feel it has all that I need and doesn't involve dependencies while providing a DOM manip. functional style like react.
 +
* All the configuration options are stored in the user's home directory inside /home/user/.config/beagle-config/Backups/config.json
 +
* A restore to defaults option
 +
 +
== Host ==
 +
* Internet Connection Sharing Enabling in Linux as well as  windows
 +
# Using netsh or PowerShell scripts
 +
* console for SSH within the application
 +
* Recipe Outline -
 +
# libssh is a multiplatform C library implementing the SSH
 +
# It has fairly well examples [https://api.libssh.org/stable/libssh_tutorial.html here]
 +
# Request a shell with ssh_channel_request_shell()
 +
# ssh_channel_read() and ssh_channel_read_nonblocking() are the ways to read data from a channel
 +
# User's input is sent to the remote site with ssh_channel_write().
 +
# The above steps are fairly less but give an idea about how easy libssh makes it to implement
 +
# Remaining part is handled using qt-console GUI and cmdlets/PS scripts
 +
 +
==User (Board) ==
 
=== System Options ===
 
=== System Options ===
The system options sub menu allows you to make configuration changes to various parts of the boot, login and networking process, along with some other system level changes.
+
The system options sub-menu allows you to make configuration changes to various parts of the boot, login, and networking process, along with some other system-level changes.
 
 
  
# PRU enable/disable
+
==== PRU enable/disable ====
This will enable hobbyists to enable / disable their PRUs if they want to test their PRU code in c or in simppru .
+
This will enable hobbyists to enable/disable their PRUs (/var/lib/cloud9/common/Makefile TARGET=gpio.prux start) and if they want to test their PRU code in c or in simppru (Checks and asks if they want to install).
 
Example -
 
Example -
 
                 PRU Conf
 
                 PRU Conf
 
                         PRU 1 Enable Disable
 
                         PRU 1 Enable Disable
 
                         PRU 2 Enable Disable
 
                         PRU 2 Enable Disable
# GPIO configuration
+
* Recipe Outline -
Enabling a GPIO pin for input/output
+
# It will essentially be a wrapper around make targets (clpru and lnkpru ,the PRU compiler and linker are already installed on the standard images.)
 +
# The PRUs appear in the Linux file space at /sys/devices/platform/ocp/4a32600*.pruss-soc-bus/4a300000.pruss
 +
Note: If it comes out that the addresses are not fixed I would have to traverse through the ocp node until I discover "pruss-soc-bus"
 +
# Select .out file and copy to  /sys/devices/platform/ocp/4a32600*.pruss-soc-bus/4a300000.pruss/lib/firmware/am335x-pruX-fw (X=0,1)
 +
 
 +
==== GPIO configuration ====
 +
Enabling a GPIO pin for input/output using config-pin
 
Example -  
 
Example -  
 
                 GPIO 18 -
 
                 GPIO 18 -
 
                         Enable Disable Set Value
 
                         Enable Disable Set Value
 +
* Recipe Outline -
 +
# Now there's config-pin utility available by default.
 +
# Also traversing through /sys/class/gpio is an option
  
# Internet Sharing Client Configurations
+
==== Internet Sharing and Client Configurations ====
Enables users to share their host internet within a click
+
Enables users to share their host internet with a click
 
Example -
 
Example -
 
                 Host  
 
                 Host  
Line 71: Line 134:
 
                                 Set IP gateway
 
                                 Set IP gateway
 
                         Return to Defaults
 
                         Return to Defaults
 +
                Host Name          BBB
 +
                    Edit
 +
                Country Code      <Select Menu>
 +
* Recipe Outline -
 +
# Ask for user password
 +
# Add routes for default gateways
 +
# Add nameservers IP addresses
 +
* On host side -
 +
# If Linux then configures USB Ethernet with default IP address and iptables rules.
 +
# If windows then use `net start SharedAccess` (Windows 7) or [https://superuser.com/questions/1511952/automate-sharing-internet-between-network-adapters-on-Windows-10 Powershell script]
  
# Wireless LAN Configurations
+
==== eMMC and MicroSD stats ====
# Audio
+
Enables users to extend the sd card partition size if available
# Password
+
Example -
# Hostname
+
              eMMC Storage        Total 52 %
# Boot / Auto login
+
                    Free            --------
# Splash Screen
+
                    Extend          --------
# User LED
+
* Recipe Outline -  
# Power LED
+
# Uses fdisk, resize2fs tools while giving options to the user about partion size and available size
# Display Options
+
# Reference [https://elinux.org/Beagleboard:Expanding_File_System_Partition_On_A_microSD microSD resize]
# Resolution
+
# There are boot scripts provided by [https://github.com/RobertCNelson/boot-scripts rcn-ee]
# Interfacing Options
+
# Implementing resizer scripts similar to above link
# Camera
 
# SSH
 
# SPI
 
# I2C
 
# Overlay File System
 
# Fan
 
# Remote GPIO
 
# Timezone
 
# Keyboard
 
# Network Proxy Settings
 
# Expand Filesystem
 
# Update
 
# About
 
# USB Gadget configurations
 
# Device Tree Add-ons/Overlays
 
* Provide an easy interface to add overlays to device trees
 
For example -  
 
    Select Node -  
 
      Select Property
 
            Edit Property
 
  Add Node -
 
      Add Alias
 
          Add Address
 
          Add Property
 
          Add register address
 
Allows setting of the wireless LAN SSID and passphrase.
 
 
 
 
 
Specifiy the audio output destination.
 
 
 
 
 
 
 
The default user on Raspberry Pi OS is pi with the password raspberry. You can change that here. Read about other users.
 
 
 
 
 
  
Set the visible name for this Pi on a network.
+
==== Freeze Packages ====
 +
apt-mark hold <package> and make a note of it in JSON
  
 +
==== Wireless Configurations ====
 +
For wireless-enabled devices like beaglebone black wireless configuring Access Point names, [https://askubuntu.com/questions/972630/what-is-mdns-is-it-possible-to-make-mdns-query-without-mdns-service-running mDNS] configurations, etc
 +
* Recipe Outline -
 +
# Wireless configurations using conmanctl
 +
# Enable /etc/systemd/resolved.conf and turn MulticastDNS=yes
 +
# The other way is by using Avahi
 +
# Specifying the configuration file
 +
# Configurations include host name , domain-name (default is .local)
  
From this submenu you can select whether to boot to console or desktop and whether you need to log in or not. If you select automatic login, you will be logged in as the pi user.
+
==== Sensor Stats and Configurations ====
 +
If beagle bone has onboard sensors then enabling them, viewing stats
 +
For ex. on Beaglebone Blue 9-axis IMU, barometer, thermometer, and a balancing LiPo charger are present
 +
* Recipe Outline -
 +
# I am assuming that device trees stay for long ahead
 +
# Once again this could be done in iio class or sensors class
 +
# The procedure is the same as cd /sys/class/sensor/thermal && cat temperature or voltage of DAC
  
 +
==== Password ====
 +
Configure passwords along with the addition of users, groups
 +
* Recipe Outline -
 +
# Nothing more than a simple password changing utility
 +
# Add accounts functionality similar to a desktop using simple Linux admin tools
  
Use this option to wait for a network connection before letting boot proceed.
+
==== Boot / Auto login ====
 +
We can configure whether to boot in desktop mode or using just console enabled. Add option to login automatically.
 +
* Recipe Outline -
 +
# Similar steps as in [https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#remove_root_password remove-root-password]
 +
# We have to remove the user password
  
 +
==== User LED ====
 +
Configure the USR LEDs on the board. Their frequency and events.
 +
* Recipe Outline -
 +
# sysfs's led class just like i can change the keyboard's brightness using  echo "1" >> /sys/class/leds/asus::kbd_backlight/brightness
  
Enable or disable the splash screen displayed at boot time
+
==== Firmware Update ====
 +
Firmware - apt update and upgrade to update your system,
 +
* Recipe Outline -
 +
# Provide timely update option
 +
# wrapper for apt update and apt upgrade
  
 +
=== Display Options ===
  
If the model of Pi permits it, you can change the behaviour of the power LED using this option.
+
==== Resolution ====
 +
Enable configuration of HDMI/DVI if the board supports it
 +
* Recipe Outline -
 +
# Changing the xorg configuration /etc/X11/xorg.conf
 +
# Or using xrandr example xrandr --output HDMI-0 --mode 720x480 --rate 60
  
 +
=== Interfacing Options ===
  
 +
==== SSH ====
 +
Configure ssh, enable/disable, and setup password
 +
* Recipe Outline -
 +
# Enable ssh (if not) from /etc/ssh/sshd_config
 +
# Password configuration using PermitRootLogin without-password or yes
 +
# Remote auth e/d using ChallengeResponseAuthentication
 +
# x11 forwarding using ForwardX11
  
 +
==== Provide an easy interface to manage uboot overlays ====
 +
* Recipe Outline -
 +
U-Boot /boot/uEnv.txt configuration in /boot/uEnv.txt:
 +
                    enable_uboot_overlays=1
 +
                To Disable eMMC:
 +
                    disable_uboot_overlay_emmc
 +
                To Disable HDMI VIDEO & AUDIO:
 +
                    disable_uboot_overlay_video
 +
                    disable_uboot_overlay_audio
 +
                    disable_uboot_overlay_wireless
 +
                    disable_uboot_overlay_adc
  
Define the default HDMI/DVI video resolution to use when the system boots without a TV or monitor being connected. This can have an effect on RealVNC if the VNC option is enabled.
+
==== Overlay File System ====
 +
Enable or disable a read-only file system
 +
Basically, the writes put a lot of pressure on SD cards, we can disable and use it read-only when not needed.
 +
* Recipe Outline -
 +
# Change the root mount to read-only
 +
# Add a couple of temporary file systems to handle logs. This will contain the option for logging size.
 +
# Backup the old fstab
 +
Reference - [https://groups.google.com/g/beagleboard/c/9J2r8xn3-Os Link1] , [https://yagrebu.net/unix/rpi-overlay.md link2]
 +
* Alternative -
 +
# Overlay file systems have been defaulted in since Kernel 3.18
 +
# Essentially we can create a top-level directory that can be modified while having the layers beneath to be read-only
 +
# mount -t overlay overlay -o lowerdir=/lower,upperdir=/upper,workdir=/work /merged . Note - work should be an empty directory
 +
# Update the init ramfs image and uEnv.txt
 +
[https://github.com/ghollingworth/overlayfs Reliable Overlay FS]
  
 +
==== Update ====
 +
Update Beagle-Config
 +
* Recipe Outline -
 +
# First way is to create a ppa [https://saveriomiroddi.github.io/Building-a-debian-deb-source-package-and-publishing-it-on-an-ubuntu-ppa/ reference]
 +
# Second is to make Github releases and code the application to check for a new release
  
Underscan
+
==== About ====
Old TV sets had a significant variation in the size of the picture they produced; some had cabinets that overlapped the screen. TV pictures were therefore given a black border so that none of the picture was lost; this is called overscan. Modern TVs and monitors don't need the border, and the signal doesn't allow for it. If the initial text shown on the screen disappears off the edge, you need to enable overscan to bring the border back.
+
Show strings, license, author, version name, and kernel version
 
 
Any changes will take effect after a reboot. You can have greater control over the settings by editing config.txt.
 
 
 
On some displays, particularly monitors, disabling overscan will make the picture fill the whole screen and correct the resolution. For other displays, it may be necessary to leave overscan enabled and adjust its values.
 
 
 
 
 
Pixel Doubling
 
Enable/disable 2x2 pixel mapping.
 
 
 
Composite Video
 
On the Raspberry Pi4, enable composite video. On models prior to the Raspberry Pi4, composite video is enabled by default so this option is not displayed.
 
 
 
Screen Blanking
 
Enable or disable screen blanking.
 
 
 
 
 
Interfacing Options
 
In this submenu there are the following options to enable/disable: Camera, SSH, VNC, SPI, I2C, Serial, 1-wire, and Remote GPIO.
 
 
 
 
 
 
 
Enable/disable the CSI camera interface.
 
 
 
 
 
 
 
Enable/disable remote command line access to your Pi using SSH.
 
 
 
SSH allows you to remotely access the command line of the Raspberry Pi from another computer. SSH is disabled by default. Read more about using SSH on the SSH documentation page. If connecting your Pi directly to a public network, you should not enable SSH unless you have set up secure passwords for all users.
 
 
 
 
 
VNC
 
Enable/disable the RealVNC virtual network computing server.
 
 
 
 
 
 
 
Enable/disable SPI interfaces and automatic loading of the SPI kernel module, needed for products such as PiFace.
 
 
 
 
 
 
 
Enable/disable I2C interfaces and automatic loading of the I2C kernel module.
 
 
 
 
 
Serial
 
Enable/disable shell and kernel messages on the serial connection.
 
 
 
 
 
1-wire
 
Enable/disable the Dallas 1-wire interface. This is usually used for DS18B20 temperature sensors.
 
 
 
Enable or disable remote access to the GPIO pins.
 
 
 
Performance Options
 
 
 
Overclock
 
On some models it is possible to overclock your Raspberry Pi's CPU using this tool. The overclocking you can achieve will vary; overclocking too high may result in instability. Selecting this option shows the following warning:
 
 
 
Be aware that overclocking may reduce the lifetime of your Raspberry Pi. If overclocking at a certain level causes system instability, try a more modest overclock. Hold down the Shift key during boot to temporarily disable overclocking.
 
 
 
 
 
GPU Memory
 
Change the amount of memory made available to the GPU.
 
 
 
 
 
Enable or disable a read-only filesystem
 
 
 
Fan
 
Set the behaviour of a GPIO connected fan
 
 
 
 
 
Localisation Options
 
The localisation submenu gives you these options to choose from: keyboard layout, time zone, locale, and wireless LAN country code.
 
 
 
Locale
 
Select a locale, for example en_GB.UTF-8 UTF-8.
 
 
 
Time Zone
 
Select your local time zone, starting with the region, e.g. Europe, then selecting a city, e.g. London. Type a letter to skip down the list to that point in the alphabet.
 
 
 
Keyboard
 
This option opens another menu which allows you to select your keyboard layout. It will take a long time to display while it reads all the keyboard types. Changes usually take effect immediately, but may require a reboot.
 
 
 
WLAN Country
 
This option sets the country code for your wireless network.
 
 
 
 
 
Advanced Options
 
 
 
If you have installed Raspberry Pi OS using NOOBS, the filesystem will have been expanded automatically. There may be a rare occasion where this is not the case, e.g. if you have copied a smaller SD card onto a larger one. In this case, you should use this option to expand your installation to fill the whole SD card, giving you more space to use for files. You will need to reboot the Raspberry Pi to make this available. Note that there is no confirmation: selecting the option begins the partition expansion immediately.
 
 
 
 
 
GL Driver
 
Enable/disable the experimental GL desktop graphics drivers.
 
 
 
 
 
GL (Full KMS)
 
Enable/disable the experimental OpenGL Full KMS (kernel mode setting) desktop graphics driver.
 
 
 
 
 
GL (Fake KMS)
 
Enable/disable the experimental OpenGL Fake KMS desktop graphics driver.
 
 
 
 
 
Legacy
 
Enable/disable the original legacy non-GL VideoCore desktop graphics driver.
 
 
 
Compositor
 
Enable/Display the xcompmgr composition manager
 
 
 
Network Interface Names
 
Enable or disable predictable network interface names.
 
 
 
 
 
Configure the network's proxy settings.
 
 
 
 
 
On the Raspberry Pi4, you can specify whether to boot from USB or network if the SD card isn't inserted. See this page for more information.
 
 
 
Bootloader Version
 
On the Raspberry Pi4, you can tell the system to use the very latest boot ROM software, or default to the factory default if the latest version causes problems.
 
 
 
 
 
Update
 
Update this tool to the latest version.
 
 
 
 
 
About beagle-config
 
  
 
== Timeline ==
 
== Timeline ==
Line 274: Line 260:
 
! Date !! Status !! Details
 
! Date !! Status !! Details
 
|-
 
|-
| 13/04/2021 to 17/05/2021 || Application Review Period || Right After submitting the application I will go through rigorous set of reference materials [https://www.udemy.com/course/linux-device-driver-programming-using-beaglebone-black/ udemy course] which has practical implementation with device tree. [http://xillybus.com/tutorials/device-tree-zynq-1 Resource 1] [https://bootlin.com/pub/conferences/2021/webinar/petazzoni-device-tree-101/petazzoni-device-tree-101.pdf Resource 2] [https://bootlin.com/blog/device-tree-101-webinar-slides-and-videos/ Resource 3] [http://wiki.dreamrunner.org/public_html/Embedded-System/Linux-Device-Tree.html Resource 4]
+
| 13/04/2021 to 17/05/2021 || Application Review Period ||  
 +
* Before it begins Complete College exams, vivas, practicals, and stuff (from 26th April to May Mid or at least the first week)
 +
* Right After this I will go through a rigorous set of reference materials  
 +
* Go through [https://github.com/ArthurSonzogni/FTXUI FTXUI] documentations
 
|-
 
|-
 
| 17/05/2021 to 07/06/2021 || Community Bonding ||  
 
| 17/05/2021 to 07/06/2021 || Community Bonding ||  
* Complete College exams , vivas, practicals and stuff
+
* libssh docs and minimal implementation
* Make sure that stuff for project is available
+
* Implement real-life advanced scripts and take suggestions from mentors about some specific doubts
* Coding Begins
+
* Make sure that stuff for the project is available
 +
* A proper project structure will ensure a great development. This will be completed before coding begins.
 
|-
 
|-
 
| 14/06/2021 || Milestone #1 ||  
 
| 14/06/2021 || Milestone #1 ||  
 
* Introductory Video
 
* Introductory Video
* Build and test the already present device tree files
+
* Implement a basic TUI with basic operations like USR LED enable, disable, frequency
* Update as per mentioned kernel version and bindings as necessary
+
* Add
 +
# Network (ICS and Wireless settings)
 +
# ssh
 +
# timezone
 +
configurations
 
|-
 
|-
 
| 21/06/2021 || Milestone #2 ||  
 
| 21/06/2021 || Milestone #2 ||  
* Build and Test A prototype of Device Tree
+
* Add
* Configure kernel for configfs module
+
# PRU
* Build and test the kernel with minimal configfs implementation
+
# GPIO
 +
# eMMC stats and sd card resizer
 +
configurations
 
|-
 
|-
 
| 28/06/2021 || Milestone #3 ||  
 
| 28/06/2021 || Milestone #3 ||  
* Integrate libusbgx for providing configuration files
+
* Add
* Configure USB Nodes in /config/devicetree using libusbgx
+
# Sensor stats and
* Test libusbgx and implement unit tests for functions
+
# Display
 +
# boot
 +
# Password
 +
# Freeze Packages
 +
configurations
 
|-
 
|-
| 05/07/2021 - 10/07/2021 || Milestone #4 ||  
+
| 05/07/2021 - 10/07/2021 || Milestone #4 ||
* Eliminate the boot scripts for usb-gadget configuration
 
 
* Review the configurations for errors   
 
* Review the configurations for errors   
 
* Documentation for everything till now
 
* Documentation for everything till now
 
|-
 
|-
 
| 17/07/2021 || Milestone #5 ||  
 
| 17/07/2021 || Milestone #5 ||  
* Verify the usb functions
+
* Add
* Rewrite with the changes required and verify with mentor
+
# U-boot
 +
# File System
 +
# Firmware Update
 +
configurations
 
|-
 
|-
 
| 24/07/2021 || Milestone #6 ||   
 
| 24/07/2021 || Milestone #6 ||   
* Integrate with libusbg gadget schemes
+
* Build A Host side Qt application to enable ICS
* Build and test functionality on all Beagle Devices
+
* Add SSH console within the Application itself
* Implement examples for cdc-acm-ecm
 
 
|-
 
|-
 
| 31/07/2021 - 03/07/2021|| Milestone #7 ||  
 
| 31/07/2021 - 03/07/2021|| Milestone #7 ||  
 
* Documentation of everything till now
 
* Documentation of everything till now
* Brief overview and discussion with mentor  
+
* Brief overview and discussion with a mentor  
 
* Bring in required changes
 
* Bring in required changes
 
|-
 
|-
 
| 10/08/2021 || Milestone #8 ||  
 
| 10/08/2021 || Milestone #8 ||  
* Compile with other latest kernels  
+
* Compile user(board) application with other latest kernels  
* Test the kernel modules and Verify the functionality  
+
* Test the Host Application for cross platform functionality
* Implement unit tests for the same
 
 
|-
 
|-
 
| 17/08/2021 || Milestone #9 ||  
 
| 17/08/2021 || Milestone #9 ||  
* Add additional configurations for overlays
+
* Add additional configurations for updates
 
* Document If anything remaining
 
* Document If anything remaining
* If finished early solve the kernel bugs
+
* Add final About page
 +
* Distribute a Debian package
 +
* Distribute Windows executable
 
|-
 
|-
 
| 24/08/2021 || Milestone #10 ||  
 
| 24/08/2021 || Milestone #10 ||  
* Students submit final work product and final mentor evaluation
+
* Submit final work product and final mentor evaluation
* Completion of youtube video
+
* Completion of YouTube video
 
|-
 
|-
 
| 31/08/2021 || Milestone #11 || Completion of GSoC
 
| 31/08/2021 || Milestone #11 || Completion of GSoC
 
|}
 
|}
  
== Benefit ==
+
 
=== Quotes ===
+
===Experience and approach===
 +
* Previously I have worked with Qt and Boost.ASIO. [https://github.com/SAtacker/pid-tuning-gui/tree/satacker/cpp_port PID-Tuning-GUI] is an application that sends data to ESP32 microcontroller which supports WiFi connectivity. Handled Application threads and Plotting of data as well as sending user input to the microcontroller.
 +
* [https://github.com/SAtacker/kernel_learn kernel learn] is a repository I had created for kernel learning purpose in which I had learned several Kernel Development Basics.
 +
* I have played with Pocketbeagle for a month and learned a lot about u-boot, device trees, and Loadable Kernel Modules.
 +
* This gives me the best of both the worlds embedded as well as a bit in the frontend (Qt).
 +
 
 +
===Contingency===
 +
* There is good documentation of FXTUI and Qt
 +
* Plenty of examples to get me through if I am stuck.
 +
* experience regarding Qt and DOM manipulation combined with experience in embedded and loadable kernel module development will pay off in this duration.
 +
 
 +
===Benefit===
 +
* Having a seamless one-click experience to configure is enjoyed by any user, be it production or a robotics team.
 +
* Provides a configuration file to the users. Remembers defaults and helps in accidental modification to low-level configurations.
 +
 
 +
==== Quotes ====
 +
* [https://matrix.to/#/!CQPHJusQpcGJkOXBfC:matrix.org/$16178954339549NOXXp:matrix.org?via=matrix.org&via=beagleboard.org lorforlinux]: "The idea is pretty good albeit now polished. I wanted to deliver a similar terminal gui app with my project last year ... "
 +
* [https://matrix.to/#/!CQPHJusQpcGJkOXBfC:matrix.org/$1617980929112kASBn:beagleboard.org?via=matrix.org&via=beagleboard.org jkridner]: Getting a nice UI and defining what the settings are seems really useful.
 +
 
 +
==Misc==
 +
* For hello_world of cross-compilation, sent a PR to the mentioned upstream [https://github.com/jadonk/gsoc-application/pull/145 #145]
 +
 
 +
== Future Work ==
 +
* Theme options
 +
* Webserver for beagle-config (jkridner's idea)
 +
* Flashing functionality can be added instead of making the user download a third-party application like etcher
 +
* An IDE within the beagle-config host

Latest revision as of 10:40, 10 April 2021

Proposal for Beagle Config

Status

  • Pre-application phase

Proposal

  • Completed all the general requirements
  • Completed "Hello World" of cross-compilation mentioned in the requirements list.
  • Sent a PR to the mentioned upstream #145

About You

About Your Project

  • Project name: Beagle Config

Description

  • As we all know, nearly all of the user operations in Linux can be done using shell commands, scripts, and Linux Userspace API for advanced users. But all that being said for an average user and sometimes in production, these steps can be repetitive and time-consuming. For example- Simply sharing a network i.e. editing iptables and enabling forwarding on the host pc is an uphill task without a script provided. However running scripts could be dangerous. This explains that using a compiled program instead can implement safe and proper security.
  • Enabling the PRU and loading the firmware is much daunting and unless anybody goes through their usage, Documentations will be difficult.
  • Hence I propose beagle-config', a terminal-based UI application that brings down the steep curve and enables anybody to configure their beagle device as they wish. Also, a host-side application to enable ICS
  • Not only does it makes beagle devices more friendly but provides an edge to beagle devices over other similar platforms.
  • Also, while configuring sometimes if the script has hard-coded values, it is difficult for the user to go back to default configurations. With beagle-config that won't be a problem anymore. Beagle-Config will store the defaults at /usr/local/share/ and user configurations in /home/user/.config/beagle-config/Backups/config.json . This ensures portability and helps in reverting to defaults in case settings are unwanted.
  • Goal: Beagle-Config aims to provide the functionality to make the most common low-level configuration changes in beagle devices easily and providing a terminal UI to do the same as well as a host-side application for ICS

Implementation Details

  • Beagle-Config consists of a host-side application developed with cross-platform framework Qt.

Reason to choose Qt: It seems that Qt satisfies the objectives which are Good Documentations, Fewer dependencies, and as for deployment electron is easier but Qt is not much difficult. This isn't performance-critical right now but if in the future it adds some performance-critical activity then Qt would be great here.

  • Beagle-Config on user (board) side which will use bash, C/C++ as back end for low-level access to linux's userspace API and FTXUI for frontend.

Comparision of a few text-based GUI

Name Description
ink
terminal-kit
  • This is again a JS library
  • Easy to develop
tvision
  • UI/UX feels old enough or retro like
  • C++ is a plus point
  • Depends on libncursesw
blessed contrib
  • JS
  • Nice Widgets support
urwid
  • Python
  • Many applications built on it
FXTUI
  • Functional style. Inspired by [1] and React
  • No dependencies.
  • Cross platform
  • Simple and elegant syntax

This wasn't a detailed review but definitely, I would choose FXTUI despite its newness, I feel it has all that I need and doesn't involve dependencies while providing a DOM manip. functional style like react.

  • All the configuration options are stored in the user's home directory inside /home/user/.config/beagle-config/Backups/config.json
  • A restore to defaults option

Host

  • Internet Connection Sharing Enabling in Linux as well as windows
  1. Using netsh or PowerShell scripts
  • console for SSH within the application
  • Recipe Outline -
  1. libssh is a multiplatform C library implementing the SSH
  2. It has fairly well examples here
  3. Request a shell with ssh_channel_request_shell()
  4. ssh_channel_read() and ssh_channel_read_nonblocking() are the ways to read data from a channel
  5. User's input is sent to the remote site with ssh_channel_write().
  6. The above steps are fairly less but give an idea about how easy libssh makes it to implement
  7. Remaining part is handled using qt-console GUI and cmdlets/PS scripts

User (Board)

System Options

The system options sub-menu allows you to make configuration changes to various parts of the boot, login, and networking process, along with some other system-level changes.

PRU enable/disable

This will enable hobbyists to enable/disable their PRUs (/var/lib/cloud9/common/Makefile TARGET=gpio.prux start) and if they want to test their PRU code in c or in simppru (Checks and asks if they want to install). Example -

               PRU Conf
                       PRU 1 Enable Disable
                       PRU 2 Enable Disable
  • Recipe Outline -
  1. It will essentially be a wrapper around make targets (clpru and lnkpru ,the PRU compiler and linker are already installed on the standard images.)
  2. The PRUs appear in the Linux file space at /sys/devices/platform/ocp/4a32600*.pruss-soc-bus/4a300000.pruss

Note: If it comes out that the addresses are not fixed I would have to traverse through the ocp node until I discover "pruss-soc-bus"

  1. Select .out file and copy to /sys/devices/platform/ocp/4a32600*.pruss-soc-bus/4a300000.pruss/lib/firmware/am335x-pruX-fw (X=0,1)

GPIO configuration

Enabling a GPIO pin for input/output using config-pin Example -

                GPIO 18 -
                       Enable Disable Set Value
  • Recipe Outline -
  1. Now there's config-pin utility available by default.
  2. Also traversing through /sys/class/gpio is an option

Internet Sharing and Client Configurations

Enables users to share their host internet with a click Example -

               Host 
                   Host A
                       Enable Internet
                       Advanced
                               Set IP gateway
                       Return to Defaults
               Host Name           BBB
                   Edit 
               Country Code       <Select Menu>
  • Recipe Outline -
  1. Ask for user password
  2. Add routes for default gateways
  3. Add nameservers IP addresses
  • On host side -
  1. If Linux then configures USB Ethernet with default IP address and iptables rules.
  2. If windows then use `net start SharedAccess` (Windows 7) or Powershell script

eMMC and MicroSD stats

Enables users to extend the sd card partition size if available Example -

              eMMC Storage        Total 52 %
                   Free            --------
                   Extend          --------
  • Recipe Outline -
  1. Uses fdisk, resize2fs tools while giving options to the user about partion size and available size
  2. Reference microSD resize
  3. There are boot scripts provided by rcn-ee
  4. Implementing resizer scripts similar to above link

Freeze Packages

apt-mark hold <package> and make a note of it in JSON

Wireless Configurations

For wireless-enabled devices like beaglebone black wireless configuring Access Point names, mDNS configurations, etc

  • Recipe Outline -
  1. Wireless configurations using conmanctl
  2. Enable /etc/systemd/resolved.conf and turn MulticastDNS=yes
  3. The other way is by using Avahi
  4. Specifying the configuration file
  5. Configurations include host name , domain-name (default is .local)

Sensor Stats and Configurations

If beagle bone has onboard sensors then enabling them, viewing stats For ex. on Beaglebone Blue 9-axis IMU, barometer, thermometer, and a balancing LiPo charger are present

  • Recipe Outline -
  1. I am assuming that device trees stay for long ahead
  2. Once again this could be done in iio class or sensors class
  3. The procedure is the same as cd /sys/class/sensor/thermal && cat temperature or voltage of DAC

Password

Configure passwords along with the addition of users, groups

  • Recipe Outline -
  1. Nothing more than a simple password changing utility
  2. Add accounts functionality similar to a desktop using simple Linux admin tools

Boot / Auto login

We can configure whether to boot in desktop mode or using just console enabled. Add option to login automatically.

  • Recipe Outline -
  1. Similar steps as in remove-root-password
  2. We have to remove the user password

User LED

Configure the USR LEDs on the board. Their frequency and events.

  • Recipe Outline -
  1. sysfs's led class just like i can change the keyboard's brightness using echo "1" >> /sys/class/leds/asus::kbd_backlight/brightness

Firmware Update

Firmware - apt update and upgrade to update your system,

  • Recipe Outline -
  1. Provide timely update option
  2. wrapper for apt update and apt upgrade

Display Options

Resolution

Enable configuration of HDMI/DVI if the board supports it

  • Recipe Outline -
  1. Changing the xorg configuration /etc/X11/xorg.conf
  2. Or using xrandr example xrandr --output HDMI-0 --mode 720x480 --rate 60

Interfacing Options

SSH

Configure ssh, enable/disable, and setup password

  • Recipe Outline -
  1. Enable ssh (if not) from /etc/ssh/sshd_config
  2. Password configuration using PermitRootLogin without-password or yes
  3. Remote auth e/d using ChallengeResponseAuthentication
  4. x11 forwarding using ForwardX11

Provide an easy interface to manage uboot overlays

  • Recipe Outline -

U-Boot /boot/uEnv.txt configuration in /boot/uEnv.txt:

                   enable_uboot_overlays=1
               To Disable eMMC:
                   disable_uboot_overlay_emmc
               To Disable HDMI VIDEO & AUDIO:
                   disable_uboot_overlay_video
                   disable_uboot_overlay_audio
                   disable_uboot_overlay_wireless
                   disable_uboot_overlay_adc

Overlay File System

Enable or disable a read-only file system Basically, the writes put a lot of pressure on SD cards, we can disable and use it read-only when not needed.

  • Recipe Outline -
  1. Change the root mount to read-only
  2. Add a couple of temporary file systems to handle logs. This will contain the option for logging size.
  3. Backup the old fstab

Reference - Link1 , link2

  • Alternative -
  1. Overlay file systems have been defaulted in since Kernel 3.18
  2. Essentially we can create a top-level directory that can be modified while having the layers beneath to be read-only
  3. mount -t overlay overlay -o lowerdir=/lower,upperdir=/upper,workdir=/work /merged . Note - work should be an empty directory
  4. Update the init ramfs image and uEnv.txt

Reliable Overlay FS

Update

Update Beagle-Config

  • Recipe Outline -
  1. First way is to create a ppa reference
  2. Second is to make Github releases and code the application to check for a new release

About

Show strings, license, author, version name, and kernel version

Timeline

Date Status Details
13/04/2021 to 17/05/2021 Application Review Period
  • Before it begins Complete College exams, vivas, practicals, and stuff (from 26th April to May Mid or at least the first week)
  • Right After this I will go through a rigorous set of reference materials
  • Go through FTXUI documentations
17/05/2021 to 07/06/2021 Community Bonding
  • libssh docs and minimal implementation
  • Implement real-life advanced scripts and take suggestions from mentors about some specific doubts
  • Make sure that stuff for the project is available
  • A proper project structure will ensure a great development. This will be completed before coding begins.
14/06/2021 Milestone #1
  • Introductory Video
  • Implement a basic TUI with basic operations like USR LED enable, disable, frequency
  • Add
  1. Network (ICS and Wireless settings)
  2. ssh
  3. timezone

configurations

21/06/2021 Milestone #2
  • Add
  1. PRU
  2. GPIO
  3. eMMC stats and sd card resizer

configurations

28/06/2021 Milestone #3
  • Add
  1. Sensor stats and
  2. Display
  3. boot
  4. Password
  5. Freeze Packages

configurations

05/07/2021 - 10/07/2021 Milestone #4
  • Review the configurations for errors
  • Documentation for everything till now
17/07/2021 Milestone #5
  • Add
  1. U-boot
  2. File System
  3. Firmware Update

configurations

24/07/2021 Milestone #6
  • Build A Host side Qt application to enable ICS
  • Add SSH console within the Application itself
31/07/2021 - 03/07/2021 Milestone #7
  • Documentation of everything till now
  • Brief overview and discussion with a mentor
  • Bring in required changes
10/08/2021 Milestone #8
  • Compile user(board) application with other latest kernels
  • Test the Host Application for cross platform functionality
17/08/2021 Milestone #9
  • Add additional configurations for updates
  • Document If anything remaining
  • Add final About page
  • Distribute a Debian package
  • Distribute Windows executable
24/08/2021 Milestone #10
  • Submit final work product and final mentor evaluation
  • Completion of YouTube video
31/08/2021 Milestone #11 Completion of GSoC


Experience and approach

  • Previously I have worked with Qt and Boost.ASIO. PID-Tuning-GUI is an application that sends data to ESP32 microcontroller which supports WiFi connectivity. Handled Application threads and Plotting of data as well as sending user input to the microcontroller.
  • kernel learn is a repository I had created for kernel learning purpose in which I had learned several Kernel Development Basics.
  • I have played with Pocketbeagle for a month and learned a lot about u-boot, device trees, and Loadable Kernel Modules.
  • This gives me the best of both the worlds embedded as well as a bit in the frontend (Qt).

Contingency

  • There is good documentation of FXTUI and Qt
  • Plenty of examples to get me through if I am stuck.
  • experience regarding Qt and DOM manipulation combined with experience in embedded and loadable kernel module development will pay off in this duration.

Benefit

  • Having a seamless one-click experience to configure is enjoyed by any user, be it production or a robotics team.
  • Provides a configuration file to the users. Remembers defaults and helps in accidental modification to low-level configurations.

Quotes

  • lorforlinux: "The idea is pretty good albeit now polished. I wanted to deliver a similar terminal gui app with my project last year ... "
  • jkridner: Getting a nice UI and defining what the settings are seems really useful.

Misc

  • For hello_world of cross-compilation, sent a PR to the mentioned upstream #145

Future Work

  • Theme options
  • Webserver for beagle-config (jkridner's idea)
  • Flashing functionality can be added instead of making the user download a third-party application like etcher
  • An IDE within the beagle-config host