Skip to content

2.0.0

Latest

Choose a tag to compare

@MMetelko MMetelko released this 12 Aug 15:57

UBUNTU 22.04 (VM, BBB, RPi) & DEBIAN 12 (TI AM64B) SYSTEM UPDATE ONLY

No further updates will be made to Ubuntu 20.04 packages

IMPORTANT NOTE:
The platform moves to Ubuntu 22.04 with this includes many 3rd party libraries that support the RIAPS platform. Therefore, all devices must be setup for the new platform (VM, BBB and RPi).

Note for CAN1 interface users: Most of the BBB boards we have used for testing have eMMC flash images that have an older U-Boot version (2019). To enable the CAN1 interface, you need to physically update the eMMC flash image to a newer image (2023). Instructions are included in a section below.

New Features in riaps-pycom

  • System platform updates
    • Capnproto library from_bytes must be wrapped in a context manager (with <function> as <var>:) due to an API change with version update
      • This is a breaking change for applications that use Capnp Proto messaging, see note below on how to adjust your code
    • Move python version to 3.10
      • Set apparmor python version using script and systemd service based on system python version
    • Netifaces library version update
  • Changes for Debian Bookworm systems
    • Added --break-system-packages to pip installs
    • Added softlink to /dev/root for quota service

Improvements in riaps-pycom

  • Update tmux api calls due to library version update
  • riaps_fab redesigned to use Fabric2.X and break into CLI-based and API
    • Improve command helpstrings and error messages
    • Output execution information only on error (except for sys.arch)
      • Note: you can use -v to get verbose feedback on any command
    • Reference RIAPSHOME for loading hosts
    • Provide role hints on invalid role
    • CLI hostlists now usurp role checks
    • sys.get -n flag renames local file, prints results nicely
    • sys.put checks for file before sending
    • sys.put/sys.get outputs are more readable
    • Simplify riaps.reset
    • Add flag to pass hostfile path
    • ctrlgui: Update fabric usage to rfab
    • deplo.status exit-code acceptance
      • systemctl-status will exit 3 if a service is inactive, but rfab treats non-zero exits as "Failed". Adding this test accepts exit (3) as a success
    • Adding Task class
    • Add logging files
    • Change riaps_deplo launch backgrounding to disowning
    • Consolidate result types to enable more hints
    • RFabGroupResult class always hints for socket.gaierror

Fixes

  • riaps-pycom:
    • Remove StandardOutput=syslog from riaps-deplo.service
    • Localhost not first interface, leading to invalid connection on locals
    • Opendht crash on 600 sec t/o due to not cleaning listener
    • Change needed to Jenkins deployment due to function deprecation
    • Workaround to spdlog problem -- spdlog (python) must be imported first to avoid signal handler issues
    • Set RIAPS* envvars for SSH sessions in /etc/environment using Debian preinst for remote nodes
      • Commands executed over SSH such as ssh <host> <cmd> or those via Fabric occur in non-login non-interactive shells, which don't hit any of our .bash* or .profile* config files. This config sets RIAPSHOME and RIAPSAPPS for SSH sessions matching the riaps user.
    • Remove setuptools_scm from the pip install requirements
      • This caused an error related to git meta data, but did not affect the installation of the package.
    • Found extra removal of conf files for riaps-pycom
    • Better formatting for log message
    • Prohibit MulticastDNS for systemd-resolved
      • We use Avahi for .local domain resolution, but the default systemd-resolved configuration also runs mDNS, which conflicts. This file and option disables mDNS.
    • Fixes to 100% utilization in deplo (due to zmqdevice\)
    • Better logging for dc
    • DC w/ redis works for rapid group membership changes
    • Added deplo/relay code
    • Fixes for rapid group membership changes
      • Note: opendht's cancelListen does not work (from Python)
  • riaps-timesync:
    • timesyncctl: send logger to stdout instead of stderr
    • Change needed to Jenkins deployment due to function deprecation

Capnproto library “from_bytes” API change Notes:

Updates to pycapnp library now requires from_bytes() functions to be wrapped in a context manager. Below is an example of changes needed to applications using this function. This example is from the app.IMCP code from SYSTEM_OPERATOR_MQTT.py (line 55):

v1.1.23 code:

def on_state_sub(self):
    msg_bytes = self.state_sub.recv()
    msg = imcp_capnp.StateMsg.from_bytes(msg_bytes)
    if debugMode:
        self.logger.info(f"{helper.Yellow}"
                        f"Operator\n"
                        f"on_state_sub:{msg.sender} \n"
                        f"recv state sub msgcounter: {msg.msgcounter} \n"
                        f"state: {msg.currentState} \n"
                        f" breaker: {msg.breaker} and action: {msg.action} \n"
                        f" group: {msg.group}  and reconfigcontrol {msg.reconfigcontrol}\n"
                        f"{helper.RESET}")

    self.node_states[msg.sender] = msg.currentState

Modification for v2.0.0:

def on_state_sub(self):
    msg_bytes = self.state_sub.recv()
    with imcp_capnp.StateMsg.from_bytes(msg_bytes) as msg:
        if debugMode:
            self.logger.info(f"{helper.Yellow}"
                             f"Operator\n"
                             f"on_state_sub:{msg.sender} \n"
                             f"recv state sub msgcounter: {msg.msgcounter} \n"
                             f"state: {msg.currentState} \n"
                             f" breaker: {msg.breaker} and action: {msg.action} \n"
                             f" group: {msg.group}  and reconfigcontrol {msg.reconfigcontrol}\n"
                             f"{helper.RESET}")

        self.node_states[msg.sender] = msg.currentState

Apps, interfaces and example code with capnproto from_bytes call:

  • Currently used application:
    • app.IMCP
  • Older code base that might be reused:
    • app.MgManage
    • app.MgManage_SingleMg
    • app.OpalRT-Microgrid-Monitor-Demo
    • app.RensycnFullFeeder1Banshee
    • interface.PyDSS
    • interface.gridlabd
    • BansheeFSM
    • example.varcontrol

eMMC Update Process for BBB Boards

  1. Download the am335x-eMMC-flasher-debian-12.2-minimal-armhf-2023-10-7-2gb.img.xz image on https://forum.beagleboard.org/t/debian-12-x-bookworm-monthly-snapshot-2023-10-07/36175
  2. Put the image on a SD card using balenaEtcher
  3. Hold down the button by the SD card slot on the BBB board and power on the board
  4. Keep holding the button until writing begins which is signaled by a cycling of the 4 LEDs

    Note: If you get a solid light only, try again making sure to hold down the button until it starts writing (which takes a couple of seconds)

  5. After the eMMC write finishes, the BBB will turn off
  6. Then remove the SD card and power back up the BBB with the downloaded RIAPS image inserted