Shell Scripting on Raspberry PI

เสร็จสมบูรณ์ โพสต์แล้ว 5 ปีที่ผ่านมา ชำระเงินเมื่อจัดส่ง
เสร็จสมบูรณ์ ชำระเงินเมื่อจัดส่ง

Consider the leds (the little lights) on your raspberry pi. These lights can be changed by sending messages to the device about how to behave.

The first script you are to write (which you must decompose into smaller scripts/functions) is to allow a user of your script to manipulate the leds on your pi.

When the script starts up, it will scan the contents of /sys/class/leds to get a list of the leds on the system (each link in this directory points to a directory for the settings of that led).

The two files we are interested in are “brightness” and “trigger”.

The scripting tasks:

Each of these scripting tasks must be in a separate function. It should have a sensible name to streamline maintainability (task1, task2, etc will be marked down) and should follow standard conventions such as paths to executables specified in variables at the top of the script, functions should only reference local variables UNLESS they represent shared state in the program (hardly any of these should so you need to make a case as to why you have done this in your README if you have).

You are required to check for errors after each command you enter and capture any output text into a variable. You should then output error messages in a reasonable format such as “This operation has failed:” followed by the error message that was output by the command.

You are required to disable the control-c interupt of the script and the script should handle any requests to quit gracefully. You should opt in all cases for the calling of programs to do work for you rather than performing operations in your script. For the purpose of these tasks you must restrict yourself to standard UNIX utilities.

Note that all submitted scripts must use bash and must specify the interpreter at the top of the script.

Task 2: Script launch (8 marks)

On start of your script it should read the contents of the /sys/class/leds directory and present a menu for your program. An example run of your program should look like:

Welcome to Led_Konfigurator!

============================

Please select an led to configure:

1. input0::capslock

2. input0::numlock

3. input0::scrolllock

4. input4::capslock

5. input4::numlock

6. input4::scrolllock

7. led0

8. led1

9. Quit

Please enter a number (1-9) for the led to configure or quit:

Please note that hardcoding this menu will get you 0 marks. It must be generated from the contents of the /sys/class/leds directory.

Task 3: LED Manipulation Menu (10 Marks)

Create a function that will display a menu of options for any led selected which shall look like the following:

[LED NAME] <-- replace this name with the actual name of the led.

==========

What would you like to do with this led?

1) turn on

2) turn off

3) associate with a system event

4) associate with the performance of a process

5) stop association with a process’ performance

6) quit to main menu

Please enter a number (1-6) for your choice:

Task 4: Turn on and off the led (4 Marks)

The “turn on” command above echoes 1 into the brightness file for the respective led and the “turn off” command echoes 0 into the brightness file.

Task 5: Associate LED with a system event (10 Marks)

The associate with a system event menu will list the events from the trigger file with a * next to the currently selected event. So the menu for that option would look like (next page):

Please note that if the options on the menu scroll off the screen, you are required to page the menu with more. Please note that hard coding this menu will get you 0 marks. It must be dynamically generated from the contents of the trigger file.

Program Documentation,

All functions must be appropriately comments with a header comment for each function describing parameters and the expected outcome of the function. There must be a reasonable number of comments in your program so that it is clear what you intention is. Also, you must provide a readme file that explains how we can use your program

Linux Programming Python Raspberry Pi สถาปัตยกรรมซอฟต์แวร์

หมายเลขโปรเจค: #17937771

เกี่ยวกับโปรเจกต์

6 ข้อเสนอ โปรเจกต์ระยะไกล ใช้งาน %project.latestActivity_relativeTime|แทนที่%

มอบให้กับ:

kaloyan13

I have done Bash menus, and will write the script with very high quality - functions, comments, local variables, etc.

$100 AUD ใน 1 วัน
(308 รีวิว)
6.9

freelancer 6 คน กำลังเสนอราคาในงานนี้ โดยมีราคาเฉลี่ยอยู่ที่ $165

DevStar925

Dear Employer, How are you? As you can see in my profile, I have great experience in C/C++, C#, and Java programming as well as Microcontroller. Especially, I have completed many Raspberry Pi and Arduino projects and เพิ่มเติม

$155 AUD ใน 3 วัน
(73 รีวิว)
7.4
shadabkhan92

https://www.freelancer.com/projects/php/Temperature-monitoring-tool-for-toy/ https://www.freelancer.com/projects/php/License-Plate-Detection-With-Chinese/ done the similar jobs lets chat

$294 AUD ใน 3 วัน
(42 รีวิว)
6.5
VarunUnix

Hello, Looks like an interesting project in shell script. You can refer my profile and if interested please contact me. I can share my previous works on shell scripts or you can find the reviews here. I need acce เพิ่มเติม

$100 AUD ใน 3 วัน
(42 รีวิว)
5.1
mihalylengyel

I have worked on scripts like this a bit when developing test/build systems for various projects. I may need a few days to get my hands on a PI but after that, I can deliver the code to you for in a day. This small tas เพิ่มเติม

$230 AUD ใน 10 วัน
(0 รีวิว)
0.0
triangletodd

I've been a systems and software engineer for nearly a decade. I write shell scripts in many different scripting languages, in a large corporate environment, every day. Bash is currently one of my strongest and most en เพิ่มเติม

$111 AUD ใน 1 วัน
(0 รีวิว)
0.0