Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook

[PROBLEM] Fan control - GPIO pins not working
Thank you for your donation

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Problem: Fan control - GPIO pins not working
26th Apr, 2020, 10:46 PM
Post: #1
oz1sej Offline
Registered
Posts: 1
Joined: Aug 2019
Reputation: 0
Fan control - GPIO pins not working
How does one control a fan under xbian?

I'm running Linux xbian 4.19.90+ #1 SMP PREEMPT Wed Dec 18 20:39:10 CET 2019 armv7l GNU/Linux on a Raspberry Pi 3. For all my other Raspberry Pi's, I've attached a fan for PID CPU temperature control which is PWM modulated via a GPIO pin through a python script. It works flawlessly on my other Pi's.

First thing I notice is that python says

Terminal
ImportError: No module named RPi.GPIO

So I try

Terminal
pip install RPi.GPIO

Turns out that pip is not installed. So I go to https://pip.pypa.io/en/stable/installing/ which says to run

Terminal
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

Turns out that curl is not installed. So I run

Terminal
sudo apt install curl

and then

Terminal
sudo curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

and then

Terminal
sudo pip install RPi.GPIO

which gives me LOTS of errors. Then I say to myself: If I can just turn on the fan, at least I can cool the CPU. But it turns out that even

Terminal
sudo echo 1 > /sys/class/gpio/gpio17/value

gives me "Access denied".

How does one control a fan under xbian?
Find all posts by this user
Quote this message in a reply
29th Apr, 2020, 10:06 PM
Post: #2
Nachteule Offline
Administrator
******
Posts: 2,405
Joined: Dec 2014
Reputation: 122
RE: Fan control - GPIO pins not working
Good question. Maybe you have to figure out first why sudo pip install RPi.GPIO creates a lot of errors
Find all posts by this user
Quote this message in a reply
31st Aug, 2021, 02:35 AM
Post: #3
the_redburn Offline
Registered
Posts: 1
Joined: Aug 2021
Reputation: 0
RE: Fan control - GPIO pins not working
For the record, the easiest way to install RPi.GPIO is with
Terminal
sudo xbian-config
Look in package > python

To install a pre-release of RPi.GPIO, do
Terminal
sudo apt-get install python-dev
then
Terminal
pip install RPi.GPIO==[version]
If you go to https://pypi.org/project/RPi.GPIO/#history then click on the version you want, the command will be shown at the top of the page.

By the way, 0.7.1a4 or later is needed for Raspberry 4 support.

I forgot to mention that root is currently needed on xbian for GPIO access.
See https://github.com/xbianonpi/xbian/issues/898 for non root access.
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 10th May, 2025, 08:32 AM Powered By MyBB, © 2002-2025 MyBB Group.