Comments (7)
Which instructions?
from enviro-phat.
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.
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.
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.
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.
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.
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)
- Missing dependency HOT 3
- Installation command rejected? HOT 6
- Importing from envirophat fails with a TypeError HOT 11
- Importing from envirophat fails on zero HOT 2
- Loading script on boot: [Errno 25] Inappropriate ioctl for device HOT 1
- QNH defined HOT 3
- Error when passing unit kwarg into pressure(self, unit=None) HOT 2
- Enviro phat not conecting. HOT 3
- Missing unit argument in learn guide HOT 1
- OLD vs NEW enviro pHAT HOT 3
- OSError: [Errno 121] Remote I/O error 3 HOT 4
- Migrate Enviro pHAT library to new breakout packages HOT 1
- Remote I/O Error HOT 6
- Such serious! HOT 1
- light sensor: division by zero HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from enviro-phat.