Comments (13)
If I run it without the debug part this is the output:
`
pi@raspberrypi:~/fanshim-python/examples $ sudo ./install-service.sh --on-threshold 60 --off-threshold 50 --delay 2
Setting up with:
Off Threshold: 50 C
On Threshold: 60 C
Delay: 2 seconds
Preempt: no
Disable LED: no
Disable Button: no
Brightness: 255
To change these options, run:
sudo ./install-service.sh --off-threshold --on-threshold --delay --brightness (--preempt) (--noled) (--nobutton)
Or edit: /etc/systemd/system/pimoroni-fanshim.service
Checking for rpi.gpio>=0.7.0 (for Pi 4 support)
rpi.gpio >= 0.7.0 already installed
Checking for Fan SHIM
Installing Fan SHIM
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: fanshim in /usr/local/lib/python3.7/dist-packages/fanshim-0.0.2-py3.7.egg (0.0.2)
Requirement already satisfied: plasmalights in /usr/local/lib/python3.7/dist-packages/plasmalights-0.0.1-py3.7.egg (from fanshim) (0.0.1)
Requirement already satisfied: RPi.GPIO in /usr/lib/python3/dist-packages (from plasmalights->fanshim) (0.7.0)
Checking for psutil
psutil already installed
Installing service to: /etc/systemd/system/pimoroni-fanshim.service
`
from fanshim-python.
from fanshim-python.
Hello Druck, indeed I tried this and:
pi@raspberrypi:~ $ sudo systemctl status pimoroni-fanshim.service
● pimoroni-fanshim.service - Fan Shim Service
Loaded: loaded (/etc/systemd/system/pimoroni-fanshim.service; enabled; vendor preset: enabled)
Active: inactive (dead)
I was trying to status/stop/start/ctrl+c/status:
pi@raspberrypi:~ $ sudo systemctl stop pimoroni-fanshim.service
pi@raspberrypi:~ $ sudo systemctl status pimoroni-fanshim.service
● pimoroni-fanshim.service - Fan Shim Service
Loaded: loaded (/etc/systemd/system/pimoroni-fanshim.service; enabled; vendor preset: enabled)
Active: inactive (dead)
pi@raspberrypi:~ $ sudo systemctl start pimoroni-fanshim.service
^C
pi@raspberrypi:~ $ sudo systemctl status pimoroni-fanshim.service
● pimoroni-fanshim.service - Fan Shim Service
Loaded: loaded (/etc/systemd/system/pimoroni-fanshim.service; enabled; vendor preset: enabled)
Active: inactive (dead)
pi@raspberrypi:~ $
And it keeps being inactive. Also there is no led lit on the fan itself.
from fanshim-python.
Also
pi@raspberrypi:~/fanshim-python/examples $ python automatic.py
Traceback (most recent call last):
File "automatic.py", line 2, in
from fanshim import FanShim
File "/home/pi/fanshim-python/examples/fanshim.py", line 1, in
from fanshim import FanShim
ImportError: cannot import name FanShim
from fanshim-python.
The latter is to be expected- since Fan Shim runs with (and is installed for) Python 3- you'd have to test with python3 automatic.py
and see if you get any useful output.
from fanshim-python.
Hello & thank you for your response. The output its preetty much the same:
pi@raspberrypi:/fanshim-python/examples $ alias python37/fanshim-python/examples $ python37 -m pdb automatic.py
alias python37='/usr/bin/python3.7'
pi@raspberrypi:
/home/pi/fanshim-python/examples/automatic.py(2)()
-> from fanshim import FanShim
(Pdb)
from fanshim-python.
I'm guessing in your case the library just hasn't been installed for your Python version- I merged a fix earlier today which might help if you "git pull" the repository and run "examples/install-service.sh" again.
from fanshim-python.
Thank you for your suggestion. Same thing - please see attached log (http://s000.tinyupload.com/index.php?file_id=03746890479925919913)
I am including the part where I am checking that the library was installed before/after refreshing the repo.
from fanshim-python.
Do you still see "inactive (dead)" when you sudo systemctl status pimoroni-fanshim.service
?
I'm starting to wonder if the code is fine, but the physical connection between Fan SHIM and your Pi is flaky. It might be worth trying to adjust the fit of Fan SHIM, giving it a wiggle to make sure the friction-fit header is making good contact.
from fanshim-python.
Hello again. Unfortunately, yes:
pi@raspberrypi:~ $ sudo systemctl status pimoroni-fanshim.service
● pimoroni-fanshim.service - Fan Shim Service
Loaded: loaded (/etc/systemd/system/pimoroni-fanshim.service; enabled; vendor preset: enabled)
Active: inactive (dead)
pi@raspberrypi:~ $ date
Mon 19 Aug 2019 03:04:45 PM CEST
Actually its a bit weird since at the moment the fan is all the time on. I would assume its really fitting the GPIO.
from fanshim-python.
Possible thought- is the exec bit set on automatic.py
? Since the unit file for the service is running ExecStart=/home/pi/fanshim-python/examples/automatic.py
directly.
The fan should be on-by-default which means it's getting power- the enable pin is pulled up. It not turning off could be indicative of a flaky connection.
It might be worth trying to toggle it more directly by running something like this in python3:
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.OUT)
GPIO.output(18, 0) # SHould turn fan off
GPIO.output(18, 1) # Should turn fan on
This should help narrow down if it's the software or the hardware/connection causing the problem.
from fanshim-python.
Thank you for your reply. It took a while since I couldnt physically check on the fan until now.
I did what you suggested (just adding the GPIO.cleanup() at the end), but it did not shutdown the fan at all. It just kept going. I kind of saved the output to the file below.
http://s000.tinyupload.com/index.php?file_id=03743350135855647087
Forgot to mention here that script indeed is executable:
pi@raspberrypi:~/fanshim-python/examples $ ll
total 44K
drwxr-xr-x 2 pi pi 4.0K Aug 19 15:55 pycache
-rwxr-xr-x 1 pi pi 4.2K Aug 19 14:31 automatic.py
...
from fanshim-python.
The fan defaults to "on", so it should only turn off when pin 18 is actively driven low. My example above probably needed to look more like:
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.OUT)
GPIO.output(18, 0) # Should turn fan off
time.sleep(5) # Wait 5 seconds
GPIO.output(18, 1) # Should turn fan on
time.sleep(5) # Wait 5 seconds
So that you actually had time to see the fan stop, rather than the pin just toggling really fast and doing ... nothing much.
from fanshim-python.
Related Issues (20)
- install.sh fails on ubuntu server 21.04 HOT 2
- Fan software not working HOT 2
- Fan operating continuously, can't control it (or the LED) with fanshim HOT 1
- Default GPIO Pins HOT 1
- commands work but fan doesn't start HOT 2
- import fanshim crash HOT 2
- Fan always on and not responding to button or automatic code HOT 3
- doesn't install/detect on some systems HOT 2
- #104 breaks on Alpine Linux HOT 1
- Fanshim installation fails on Alpine Linux aarch64 HOT 1
- Service installation hangs on Raspberry Pi OS Lite 64bit April 4th 2022 HOT 2
- Running install-service.sh on LibreELEC 5.10.95 produces syntax errors
- The fan does not work HOT 6
- Dual case GPIO 15 (UART RX)
- Requesting AUR package
- Not working on DietPI
- automatic.py makes the LED bright green between cycles HOT 1
- Fan does not go off if the PI is powered down HOT 3
- FanShim service run correct but fan is still running HOT 2
- Example readme missing low-temp high-temp arguments 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 fanshim-python.