.. include:: Embedded Computing 1 (STECE-2024): Summer ========================================= .. toctree:: :hidden: syllabus homework-2026-03-02 homework-2026-03-16-pwm .. topic:: Semester Information * :doc:`syllabus` * Git repository: https://codeberg.org/jfasch/FH-STECE2024 2026-02-22: Intro: OS And C++ (Live Demo) ----------------------------------------- **Livehacked by teacher** * Login to Pi at home: ``ssh -p 2022 jfasch.bounceme.net`` .. code-block:: console $ ls -l /sys/class/hwmon/ $ ls -l /sys/class/hwmon/hwmon2/ * Show how to use that sensor from the commandline (:doc:`/trainings/material/soup/linux/hardware/w1/topic`) * Write a C program that reads the sensor value in a loop (a "data logger", so to say). (:doc:`/trainings/material/soup/linux/sysprog/syscalls/index`) * Transform the sensor into a dedicated type/class (:doc:`/trainings/material/soup/cxx/cxx03/020-data-encapsulation/index`) .. literalinclude:: code/intro.cpp :caption: :download:`code/intro.cpp` :language: c++ .. _fh-2026-03-02-workenv: 2026-02-2{3,4}: Prepare Work Environment ---------------------------------------- .. contents:: :local: Install OS .......... Current options ... * Use Egon Teiniker's Debian VirtualBox image from previous semesters * *Pro*: already there * *Con*: compiler version *might* be too low for our C++ topics * Use Windows Subsystem for Linux (WSL2), see :doc:`/trainings/material/soup/linux/basics/intro/wsl` * *Pro* * Seamless integration with Windows * VS Code extension(s) available * The way to go * *Con* * No Linux GUI program possible (yet) * Use MacOS * *Pro*: already there * *Con*: not Linux, for that matter * Use Linux * *Pro*: best * *Con*: none Programming Environment, Project ................................ * Clone and build project according to its build instructions https://codeberg.org/jfasch/FH-STECE2024 2026-03-02 (3VO): File I/O And Systems Programming, Homework ------------------------------------------------------------ .. contents:: :local: Permissions Intro ................. From :doc:`/trainings/material/soup/linux/basics/permissions/basics` * :ref:`fileio-basics--owner-and-permissions` * :ref:`fileio-basics--simple-example` * :ref:`fileio-basics--permission-check-user` * :ref:`fileio-basics--tuning-permissions` Program Entry And Exit ...................... * :doc:`/trainings/material/soup/linux/sysprog/process/exit/index` * :doc:`/trainings/material/soup/linux/sysprog/process/argv/index` System Calls Intro .................. * :doc:`/trainings/material/soup/linux/sysprog/syscalls/overview/index` * :doc:`/trainings/material/soup/linux/sysprog/syscalls/errorhandling/index` File IO ....... From :doc:`/trainings/material/soup/linux/sysprog/file-io/index` * :doc:`/trainings/material/soup/linux/sysprog/file-io/file-descriptors/index` * :doc:`/trainings/material/soup/linux/sysprog/file-io/open/index` * :doc:`/trainings/material/soup/linux/sysprog/file-io/file-input/index` * :doc:`/trainings/material/soup/linux/sysprog/file-io/file-output/index` * :doc:`/trainings/material/soup/linux/sysprog/file-io/create/index` Homework ........ .. topic:: Homework * :doc:`homework-2026-03-02` .. _fh-2026-03-09: 2026-03-09 (3UE*2): File I/O (Homework) --------------------------------------- Continuing with homework from last time around ... * Trainer pushes missing artifacts (argh) * Trainer live-hacks solution .. topic:: Homework * Due date: 2026-03-13 * :doc:`homework-2026-03-02` 2026-03-13 (3VO): Git (SSH), C++ Intro -------------------------------------- .. topic:: Trainer's note * Ensure that we access the repo over HTTPS *and see a password prompt* .. contents:: :local: Basic ``git`` Workflow: ``add``, ``commit``, ``push`` (, ``pull``) .................................................................. * View changes Current working directory *somewhere inside* the tree, .. code-block:: console $ git status ... * ``git add`` changes: stage for next commit .. code-block:: console $ git add file.h file.cpp ... Review repo situation .. code-block:: console $ git status ... * ``git commit`` what you staged Either non-interactive (giving the commit message as a commandline parameter) .. code-block:: console $ git commit -m 'frobozz the foobar' Or letting git pop up your favorite ``$EDITOR`` .. code-block:: console $ git commit * ``git push`` * ``git pull`` SSH, And Using It For Git Repository Access ........................................... .. topic:: See also * :doc:`/trainings/material/soup/linux/ssh/basics` * :doc:`/trainings/material/soup/linux/ssh/key-pair` * :doc:`/trainings/material/soup/linux/ssh/scp` * :doc:`/trainings/material/soup/linux/ssh/portforwarding` * :doc:`/trainings/material/soup/linux/ssh/sshfs` From :doc:`/trainings/material/soup/linux/ssh/index`: * :doc:`/trainings/material/soup/linux/ssh/basics` * :doc:`/trainings/material/soup/linux/ssh/key-pair` Exercise: Key Pair, Deployed To Codeberg ........................................ * Create key pair. *Leave passphrase empty* (else you'll have to type it in over and over, just like the HTTPS password) * Send to trainer * Public key (``id_rsa.pub``) * Codeberg account name * Deploy SSH public key on Codeberg (account (icon above right) -> "Settings" -> "SSH / GPG keys") * You have a clone of your fork of the upstream repo; change that clone's upstream URL from HTTPS to SSH. First, look: .. code-block:: console $ git remote origin $ git remote -v origin https://codeberg.org/_codebergaccountname_/FH-STECE2024.git (fetch) origin https://codeberg.org/_codebergaccountname_/FH-STECE2024.git (push) Then set: .. code-block:: console $ git remote set-url origin ssh://git@codeberg.org/_codebergaccountname_/FH-STECE2024.git .. _fh-ss-2024-update-fork: Distributed ``git``: Update Your Fork From *Upstream* ..................................................... .. figure:: forgejo-fresh-fork-and-clone.jpg :scale: 100% :align: left Current situation .. figure:: forgejo-update-fork.jpg :scale: 100% :align: left Wanted: merge changes from upstream * Create a remote for *upstream* https://codeberg.org/jfasch/FH-STECE2024.git .. code-block:: console $ git remote add upstream https://codeberg.org/jfasch/FH-STECE2024.git .. code-block:: console $ git remote -v origin https://codeberg.org/_codebergaccountname_/FH-STECE2024.git (fetch) origin https://codeberg.org/_codebergaccountname_/FH-STECE2024.git (push) upstream https://codeberg.org/jfasch/FH-STECE2024.git (fetch) upstream https://codeberg.org/jfasch/FH-STECE2024.git (push) * Fetch from *upstream* .. code-block:: console $ git fetch upstream ... roedel ... * Merge ``upstream/master`` into your local ``master`` branch Check that your current branch is ``master``, .. code-block:: console $ git branch * master Merge, .. code-block:: console $ git merge upstream/master Note that this is not always so easy - you might have to resolve conflicts. Push to default location - your fork, .. code-block:: console $ git push * Shorthand: ``git pull``. This is the same as ``fetch`` followed by ``merge`` .. _fh-2026-03-16: 2026-03-16 (3UE*2): Exercise: PWM Controller (TDD) -------------------------------------------------- See :doc:`homework-2026-03-16-pwm` 2026-03-20 (3VO): ``cp-for-the-poor`` (Recap), C++ Intro -------------------------------------------------------- Exercises ......... * :doc:`homework-2026-03-02` * Closed; was optional anyhow * List of pull requests * Morena_M (REJECTED): rejected: build/ added * johanneshranitzky (DONE): conflict marker committed * pholz (DONE): (sehr geil) * FarzanehN (REJECTED): unrelated changes (my-codeberg-name) * KoenigMaxi (REJECTED): exit status 130 * |longrightarrow| Complaint summary: ``build/`` directory part of PR, unrelated changes, ... * Sommer_r: strace session :-) * :doc:`PWM exercise ` ongoing, questions Commandline Repetition ...................... From :doc:`/trainings/material/soup/linux/basics/shell/index` in :doc:`/trainings/material/soup/linux/basics/index`: * :doc:`/trainings/material/soup/linux/basics/shell/commandline` * :doc:`/trainings/material/soup/linux/basics/shell/paths` * :doc:`/trainings/material/soup/linux/basics/shell/special-paths` * :doc:`/trainings/material/soup/linux/basics/shell/ls` * :doc:`/trainings/material/soup/linux/basics/shell/cwd` * :doc:`/trainings/material/soup/linux/basics/shell/file_dir_create_rm` * :doc:`/trainings/material/soup/linux/basics/shell/cp` * :doc:`/trainings/material/soup/linux/basics/shell/mv` * :doc:`/trainings/material/soup/linux/basics/shell/links` * :doc:`/trainings/material/soup/linux/basics/shell/configfiles` **Exercise** * :doc:`/trainings/material/soup/linux/basics/shell/exercises/cp-mv-mkdir-rm/index` 2026-03-23 (3UE*2): PWM Exercise, Shell Exercise ------------------------------------------------ * :doc:`/trainings/material/soup/linux/basics/shell/exercises/cp-mv-mkdir-rm/index` Show an inline loop, reading temperature. Discuss the nature of ``true`` and ``false``, and ``[``. Transform into shell script. Initially without shebang, but 755, then explain interpreter line. * Bring :doc:`PWM exercise ` to an end Near Future ----------- C++ Intro ......... * :doc:`/trainings/material/soup/cxx/cxx03/001-introduction/topic` From :doc:`/trainings/material/soup/cxx/cxx03/020-data-encapsulation/index`: * :doc:`/trainings/material/soup/cxx/cxx03/020-data-encapsulation/c` * :doc:`/trainings/material/soup/cxx/cxx03/020-data-encapsulation/cpp-introduction` * :doc:`/trainings/material/soup/cxx/cxx03/020-data-encapsulation/ctor-custom` * :doc:`/trainings/material/soup/cxx/cxx03/020-data-encapsulation/ctor-default`