Difference between revisions of "ECE434 Project - BBIO in Python Project"

From eLinux.org
Jump to: navigation, search
(Executive Summary)
(Work Breakdown)
 
(28 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
{{YoderHead}}
 
{{YoderHead}}
  
Team members: [[user:Yoder|Mark A. Yoder]]
+
Team members: [[user:Morsee|Eric Morse]] [[user:ELin_J|Joshua Key]]
  
 
== Grading Template ==
 
== Grading Template ==
Line 34: Line 34:
 
BBIO are a group of library files for GPIOD that are written in C that uses Python wrappers to run it in Python.  Our project is to rewrite the Python to be fully in Python rather than using wrappers.
 
BBIO are a group of library files for GPIOD that are written in C that uses Python wrappers to run it in Python.  Our project is to rewrite the Python to be fully in Python rather than using wrappers.
  
Give two sentences telling what works.
+
What works:
 +
The GPIO, UART, and ADC capabilities will now run the same way they normally would, except the Python does not use a Python wrapper.
  
Give two sentences telling what isn't working.
+
What isn't working.
 +
The programs have only been tested on the BeagleBone Black with kernel 4.19. The BBIO programs may not function correctly on other kernels or BeagleBones.
  
End with a two sentence conclusion.
+
Conclusion:
 
+
The BBIO library no longer requires a Python wrapper as all of the functions interact with the BeagleBone directly from Python.
The sentence count is approximate and only to give an idea of the expected length.
 
  
 
== Packaging ==
 
== Packaging ==
If you have hardware, consider [http://cpprojects.blogspot.com/2013/07/small-build-big-execuition.html Small Build, Big Execuition] for ideas on the final packaging.
+
This project has no hardware, but the code library must be run on a BeagleBone Black with Ubuntu kernel 4.19 running on it.
  
 
== Installation Instructions ==
 
== Installation Instructions ==
  
Give step by step instructions on how to install your project.   
+
"sudo pip3 install BBIOPY" will install the bbiopy package to your device.   
  
* Include your [https://github.com/ github] path as a link like this to the read-only git site: [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  
+
In your code, use "from bbiopy import GPIOmay" to load the GPIOmay functions into the workspace of your code. "import bbiopy" does nothing.
* Be sure your README.md is includes an up-to-date and clear description of your project so that someone who comes across you git repository can quickly learn what you did and how they can reproduce it.
+
 
* Include a Makefile for your code if using C.
+
List of files that can be imported from bbiopy: 
* Include any additional packages installed via '''apt'''Include '''install.sh''' and '''setup.sh''' files.
+
 
* Include kernel mods.
+
GPIOmay, which is the general gpiod library.
* If there is extra hardware needed, include links to where it can be obtained.
+
 
 +
uart, which handles uart functionality.
 +
 
 +
PinMux, which handles pin multiplexing (already called from GPIOmay).   
 +
 
 +
adc, which handles analog to digital conversion.
  
 
== User Instructions ==
 
== User Instructions ==
  
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.
+
The programmer has to import the library into the code that they write and call the gpiod functions from that library.
 +
 
 +
== Highlights ==
  
Consider making it autostart for full credit.
+
We created a full drop-in replacement of gpiod's pywrapper in C to a full python implement of gpiod for python programmers. 
 +
It has full gpiod functionality with gpio pin event detection and setting outputs on gpio pins.
 +
It supports setting directions during setup.  It also supports setting up multiple gpio pins at the same time, which is how gpiod differs from regular gpio. 
 +
It has full support for UART functionality, as well as ADC conversions.
  
== Highlights ==
+
== Theory of Operation ==
 +
 
 +
The library is a drop-in replacement of the py-wrapper version of BBIO gpiod.  A programmer would import the library files into the code they write and call the functions. 
  
Here is where you brag about what your project can do.
+
.setup() to setup a gpio pin.   
  
Include a [http://www.youtube.com/ YouTube] demo the audio description.
+
.output() to configure the output of a gpio pin that has been setup already.  
  
== Theory of Operation ==
+
.add_event_detect() to detect a change in the value of a gpio pin, and go to a callback function when it changes. 
  
Give a high level overview of the structure of your software. Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.
+
.cleanup() to close all memory allocations and remove all pins.
  
 
== Work Breakdown ==
 
== Work Breakdown ==
  
List the major tasks in your project and who did what.
+
Joshua Key and Eric Morse did pair-programming. 
 +
 
 +
We worked the entire project and all modules together. 
 +
 
 +
We completed all GPIO functionality of GPIOD, including event detection.
 +
 
 +
We completed all UART functionality of GPIOD.
 +
 
 +
We completed all PWM functionality of GPIOD.
 +
 
 +
We also completed all PinMux and ADC (Analog to Digital Conversion) of GPIOD.
  
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.
+
Mark Yoder did initial work on GPIOmay.py, and worked most of it, except event detection.
  
 
== Future Work ==
 
== Future Work ==
  
Suggest addition things that could be done with this project.
+
The columns are being changed in an update to BBIO, which will mean that the columns of our table will need to be changed to reflect that. 
 +
The code should work fine, but maintenance of the code will need to happen if it does not work under any new update.
  
 
== Conclusions ==
 
== Conclusions ==
  
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.
+
In the near future, there will be a new image for the 4.19 Black kernel that will switch the Consumer and the Name for gpioinfo. This will remove an error that we had to work around, which will require an update to implement. Additional functionality will need to be implemented to both the C and the Python library.
  
 
{{YoderFoot}}
 
{{YoderFoot}}

Latest revision as of 10:28, 18 November 2020

thumb‎ Embedded Linux Class by Mark A. Yoder


Team members: Eric Morse Joshua Key

Grading Template

I'm using the following template to grade. Each slot is 10 points. 0 = Missing, 5=OK, 10=Wow!

09 Executive Summary
09 Packaging
09 Installation Instructions 
09 User Instructions
09 Highlights
09 Theory of Operation
09 Work Breakdown
09 Future Work/Conclusions
09 Hackster.io
09 Demo/Poster
00 Late
Comments: Have a good day.

Score:  90/100

(Inline Comment)

Executive Summary

Picture that summarizes the project.

BBIO are a group of library files for GPIOD that are written in C that uses Python wrappers to run it in Python. Our project is to rewrite the Python to be fully in Python rather than using wrappers.

What works: The GPIO, UART, and ADC capabilities will now run the same way they normally would, except the Python does not use a Python wrapper.

What isn't working. The programs have only been tested on the BeagleBone Black with kernel 4.19. The BBIO programs may not function correctly on other kernels or BeagleBones.

Conclusion: The BBIO library no longer requires a Python wrapper as all of the functions interact with the BeagleBone directly from Python.

Packaging

This project has no hardware, but the code library must be run on a BeagleBone Black with Ubuntu kernel 4.19 running on it.

Installation Instructions

"sudo pip3 install BBIOPY" will install the bbiopy package to your device.

In your code, use "from bbiopy import GPIOmay" to load the GPIOmay functions into the workspace of your code. "import bbiopy" does nothing.

List of files that can be imported from bbiopy:

GPIOmay, which is the general gpiod library.

uart, which handles uart functionality.

PinMux, which handles pin multiplexing (already called from GPIOmay).

adc, which handles analog to digital conversion.

User Instructions

The programmer has to import the library into the code that they write and call the gpiod functions from that library.

Highlights

We created a full drop-in replacement of gpiod's pywrapper in C to a full python implement of gpiod for python programmers. It has full gpiod functionality with gpio pin event detection and setting outputs on gpio pins. It supports setting directions during setup. It also supports setting up multiple gpio pins at the same time, which is how gpiod differs from regular gpio. It has full support for UART functionality, as well as ADC conversions.

Theory of Operation

The library is a drop-in replacement of the py-wrapper version of BBIO gpiod. A programmer would import the library files into the code they write and call the functions.

.setup() to setup a gpio pin.

.output() to configure the output of a gpio pin that has been setup already.

.add_event_detect() to detect a change in the value of a gpio pin, and go to a callback function when it changes.

.cleanup() to close all memory allocations and remove all pins.

Work Breakdown

Joshua Key and Eric Morse did pair-programming.

We worked the entire project and all modules together.

We completed all GPIO functionality of GPIOD, including event detection.

We completed all UART functionality of GPIOD.

We completed all PWM functionality of GPIOD.

We also completed all PinMux and ADC (Analog to Digital Conversion) of GPIOD.

Mark Yoder did initial work on GPIOmay.py, and worked most of it, except event detection.

Future Work

The columns are being changed in an update to BBIO, which will mean that the columns of our table will need to be changed to reflect that. The code should work fine, but maintenance of the code will need to happen if it does not work under any new update.

Conclusions

In the near future, there will be a new image for the 4.19 Black kernel that will switch the Consumer and the Name for gpioinfo. This will remove an error that we had to work around, which will require an update to implement. Additional functionality will need to be implemented to both the C and the Python library.




thumb‎ Embedded Linux Class by Mark A. Yoder