Cheers, haukex.

Problem is with these two pieces of functionality (PWM and direct mods to the hardware clock), that doesn't work, as they can't use /dev/gpiomem, as they aren't directly related to the GPIO itself, and function outside of that scope.

I'm still looking for some form of workaround. All other functionality thus far works fine the way you state, as I'm just dealing with GPIO directly.

update: That said, if you happen to come across any C/Python/<insert lang> code that operates on either of these (PWM is *far* more common) without requiring root access, I would hugely appreciate a reply or private message, so that I can review the code and see how they are doing it. I know some libraries (particularly Python) that secretly use sudo, but nothing (ie. docs/changelog, CLI notice etc) mentions this. I outright refuse to do this, as it opens potential security holes and isn't fair to the end-user. I'd sooner have the Pi crash hard, then, when I get emails, I can say "RTFM for X and Y again" ;) (well not really, but if sudo is secretly used in one place, who knows where else it is used).

I did have some of my code doing this in the extreme early stages of this project, but it felt dirty and I backed it all out. This was at the time that /dev/gpiomem wasn't standard, and *all* code paths to the GPIO required root.

Now that those restrictions have been lifted/integrated into the OS by default (newer Raspbian OS cuts), there's no need for this less specific non-GPIO-direct functionality.


In reply to Re^2: Running specific test files with sudo (updated) by stevieb
in thread Running specific test files with sudo by stevieb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.