Giter Site home page Giter Site logo

'Sudo python' for use about enviro-phat HOT 7 CLOSED

bsimmo avatar bsimmo commented on August 28, 2024
'Sudo python' for use

from enviro-phat.

Comments (7)

Gadgetoid avatar Gadgetoid commented on August 28, 2024

Which instructions?

from enviro-phat.

bsimmo avatar bsimmo commented on August 28, 2024

Guides and tutorials link, then Getting started (so 'Getting started with the Environment pHAT on Pimoroni)
Specifically states use 'sudo python' to open up a new python prompt for use.
At a recent PiJam that was then the used method. Which seems bad practice to me?

from enviro-phat.

RogueM avatar RogueM commented on August 28, 2024

yes, I agree wholeheartedly it is bad practise. However, a lot of our guides were written at a time rpi.gpio required elevated privileges, so it is not unusual to come across instructions that feature commands enforcing sudo on many sites dealing with physical computing on the Pi.

In fact, looking outside our learn portal, I have found most people don't even put much thoughts into it even when writing instructions from scratch in 2017, and blindly precede everything with sudo. Again, I can only concur it would be best avoided, and in many cases can be.

... anyhow we'll try to fix our older guides in the learn portal, but I wanted to outline the context they were written in (when it wasn't wise to assume users were running a recent version of rpi.gpio).

Ultimately, regardless of whatever guide you find that tells you to 'run a command with sudo', I think it is a good exercise to run it without and learn from the outcome i.e did the command succeed or complain? and try to figure out why in the later case (and by that I mean why is elevated privilege required), you'll learn something from it :)

from enviro-phat.

bsimmo avatar bsimmo commented on August 28, 2024

I will, just waiting for it to be delivered :-).
This is for my son after using it at Pi Jam (we were connecting it to the Hull LoRA network internet of things).
He enjoyed using it, I only asked as it was released a while after sudo was no longer needed for GPIO. So wondered if something on it did need it.
My only shame is you use GPIO4 the 1-wire default pin for the led. It just makes it a bit more faffy to use 1-wire at the same time,but it impossible.

from enviro-phat.

RogueM avatar RogueM commented on August 28, 2024

I don't recall when enviro-phat came out, but it certainly would have been only a small time after jessie was released, and AFAIK there was never a Wheezy release of RPi.GPIO with 'sudo-less' capabilities.

Still, while we can't really assume that all users will have migrated even a year plus on from the pHAT release, I think it's a reasonable comment and it is on our todo list to go through all our tutorials and try to be more discerning in this respect.

from enviro-phat.

Gadgetoid avatar Gadgetoid commented on August 28, 2024

I'll have to admit that clashing the LED pin with 1-wire was a silly, avoidable blunder on my part! Although I think that choice pre-dated my running some analytics on our database (pinout.xyz) of Raspberry Pi add-ons and finding GPIO pins which were seldom used, and was probably motivated for ease of routing!

from enviro-phat.

Gadgetoid avatar Gadgetoid commented on August 28, 2024

I couldn't find any reference to sudo in this guide: https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-enviro-phat - so I think we've since updated it. If you find any other mentions, I'll be keen to know. For now, though, I'm considering this issue resolved and closing it!

from enviro-phat.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.