CHEERSNetworkClimate & health

Home / Resources / Weather station

CHEERS technical resources · WindChaser

Source code for wind_bearer_software.utils.permission

WindChaser technical documentation: Source code for wind_bearer_software.utils.permission. Original instructions, component references and source limitations.

Original documentation: Min Tai Yap and Julian Walker · © 2025. Migrated to CHEERS on 3 December 2026. This is working documentation; unresolved source gaps remain visible.

Software source reference
"""
Contains a helper function to set the GPIO permissions.

Authors:
    Min Tai Yap
"""

import subprocess

[docs] def set_gpio_permissions(): """ Changes the ownership of the /dev/gpiomem to root:gpio and gives read and write access to the gpio group. """ try: # Change the ownership of /dev/gpiomem to root:gpio subprocess.run(['sudo', 'chown', 'root:gpio', '/dev/gpiomem'], check=True) # Change the permissions to give read/write access to the gpio group subprocess.run(['sudo', 'chmod', 'g+rw', '/dev/gpiomem'], check=True) print("Permissions for /dev/gpiomem have been successfully updated.") except subprocess.CalledProcessError as e: print(f"Error: {e}") print("Failed to update permissions for /dev/gpiomem.")