Top Hat Fan not working

After updating the PI software and packages, upgrading the firmware and reinstalling the script the top hat fan will not spin. Several reboots and complete power shutdown/unplugged the fan will not activate at any temp. I verified the fan does have power and is not defective. My thought is that in the updating process the code to activate the fan is stopped working. Thoughts/ideas? Appreciate the help.

What about uname -a?

Please downgrade your kernel to stable.

Results of uname -a
Linux PiNAS 4.19.118-v7l+ #1311 SMP Mon Apr 27 14:26:42 BST 2020 armv7l GNU/Linux

To be clear the kernel was not updated when I performed the standard sudo apt update && sudo apt -y full-upgrade

What kernel do you suggest I downgrade to?

I thought you have done an rpi-update.

Please tell me the result of sudo systemctl status pigpiod.service

Results below:
pigpiod.service - Daemon required to control GPIO pins via pigpio
Loaded: loaded (/lib/systemd/system/pigpiod.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2020-07-09 10:33:16 CDT; 7h ago
Process: 650 ExecStart=/usr/bin/pigpiod -l (code=exited, status=0/SUCCESS)
Main PID: 663 (pigpiod)
Tasks: 4 (limit: 4915)
Memory: 760.0K
CGroup: /system.slice/pigpiod.service
└─663 /usr/bin/pigpiod -l

Jul 09 10:33:16 PiNAS systemd[1]: Starting Daemon required to control GPIO pins via pigpio…
Jul 09 10:33:16 PiNAS systemd[1]: Started Daemon required to control GPIO pins via pigpio.

sudo systemctl status rockpi-sata.service

Results below:
rockpi-sata.service - Rockpi SATA Hat
Loaded: loaded (/lib/systemd/system/rockpi-sata.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2020-07-09 10:39:17 CDT; 11h ago
Main PID: 3429 (python3)
Tasks: 4 (limit: 4915)
Memory: 12.1M
CGroup: /system.slice/rockpi-sata.service
├─3429 /usr/bin/python3 /usr/bin/rockpi-sata/main.py on
├─3455 /usr/bin/python3 /usr/bin/rockpi-sata/main.py on
├─3456 /usr/bin/python3 /usr/bin/rockpi-sata/main.py on
└─3457 /usr/bin/python3 /usr/bin/rockpi-sata/main.py on

Jul 09 10:39:20 PiNAS python3[3429]: self._target(*self._args, **self._kwargs)
Jul 09 10:39:20 PiNAS python3[3429]: File “/usr/bin/rockpi-sata/fan.py”, line 80, in running
Jul 09 10:39:20 PiNAS python3[3429]: change_dc(get_dc())
Jul 09 10:39:20 PiNAS python3[3429]: File “/usr/bin/rockpi-sata/fan.py”, line 74, in change_dc
Jul 09 10:39:20 PiNAS python3[3429]: gpio.hardware_PWM(12, 25000, dc * 10000)
Jul 09 10:39:20 PiNAS python3[3429]: File “/usr/lib/python3/dist-packages/pigpio.py”, line 2013, in hardware_PWM
Jul 09 10:39:20 PiNAS python3[3429]: self.sl, _PI_CMD_HP, gpio, PWMfreq, 4, extents))
Jul 09 10:39:20 PiNAS python3[3429]: File “/usr/lib/python3/dist-packages/pigpio.py”, line 1030, in _pigpio_command_ex
Jul 09 10:39:20 PiNAS python3[3429]: sl.s.sendall(ext)
Jul 09 10:39:20 PiNAS python3[3429]: AttributeError: ‘NoneType’ object has no attribute ‘sendall’

cat /etc/network/interfaces
cat /etc/hosts
ping localhost
netstat -a | grep 8888

Hi,

I’m experiencing the same problem here, I just updated the rockpi drivers and now temperature a rocketing to 70 celsius on idle. Also, my fans are reversed and I didn’t reach above 55 after doing it.

I’m seeing the same Python errors while checking the Rockpi service

Jul 11 12:04:57 stockage python3[680]:     self._target(*self._args, **self._kwargs)
Jul 11 12:04:57 stockage python3[680]:   File "/usr/bin/rockpi-sata/fan.py", line 80, in running
Jul 11 12:04:57 stockage python3[680]:     change_dc(get_dc())
Jul 11 12:04:57 stockage python3[680]:   File "/usr/bin/rockpi-sata/fan.py", line 74, in change_dc
Jul 11 12:04:57 stockage python3[680]:     gpio.hardware_PWM(12, 25000, dc * 10000)
Jul 11 12:04:57 stockage python3[680]:   File "/usr/lib/python3/dist-packages/pigpio.py", line 2013, in hardware_PWM
Jul 11 12:04:57 stockage python3[680]:     self.sl, _PI_CMD_HP, gpio, PWMfreq, 4, extents))
Jul 11 12:04:57 stockage python3[680]:   File "/usr/lib/python3/dist-packages/pigpio.py", line 1030, in _pigpio_command_ext
Jul 11 12:04:57 stockage python3[680]:     sl.s.sendall(ext)
Jul 11 12:04:57 stockage python3[680]: AttributeError: 'NoneType' object has no attribute 'sendall'
root@stockage:~#  netstat -a | grep 8888
tcp6       0      0 ip6-localhost:8888      [::]:*                  LISTEN

I don’t have any custom kernels or anything, it’s just a standard Raspbian

Linux stockage 4.19.118-v7l+ #1311 SMP Mon Apr 27 14:26:42 BST 2020 armv7l GNU/Linux

cat /etc/network/interfaces
cat /etc/hosts
ping localhost

pi@stockage:~ $ cat /etc/network/interfaces# This file is auto-generated by openmediavault (https://www.openmediavault.org)# WARNING: Do not edit this file, your changes will get lost.

interfaces(5) file used by ifup(8) and ifdown(8)

Better use netplan.io or systemd-networkd to configure additional interface stanzas.

Include files from /etc/network/interfaces.d:

source-directory /etc/network/interfaces.d
pi@stockage:~ $ cat /etc/hosts# This file is auto-generated by openmediavault (https://www.openmediavault.org)

WARNING: Do not edit this file, your changes will get lost.

127.0.0.1 localhost.localdomain localhost
127.0.1.1 stockage

The following lines are desirable for IPv6 capable hosts.

::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
192.168.0.2 stockage
pi@stockage:~ $ ping localhost
PING localhost.localdomain (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.040 ms
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=2 ttl=64 time=0.070 ms
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=3 ttl=64 time=0.087 ms
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=4 ttl=64 time=0.088 ms
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=5 ttl=64 time=0.059 ms
^C
— localhost.localdomain ping statistics —
5 packets transmitted, 5 received, 0% packet loss, time 127ms
rtt min/avg/max/mdev = 0.040/0.068/0.088/0.020 ms

Thank you for your information. I will fix it tomorrow.

@fmo @Mike_J

Hello, I uploaded a new version and I think the bug should be fixed.
Please reinstall it and let me know the result.

That worked for me, thanks @setq

Fix and working. Curious to know what the bug was. - Thanks for your help.

The pigpio daemon listening ip6-localhost but the pigpio client uses localhost by default.

The bug may be caused by the different content of /etc/hosts.

Hi,
I’m running Ubuntu 20.04, and the top fan was working fine until today when I updated some packages.

Start-Date: 2020-08-05 11:12:39
Commandline: apt upgrade
Requested-By: mediadmin (1001)
Upgrade: apport:arm64 (2.20.11-0ubuntu27.4, 2.20.11-0ubuntu27.6), python3-apport:arm64 (2.20.11-0ubuntu27.4, 2.20.11-0ubuntu27.6), python3-problem-report:arm64 (2.20.11-0ubuntu27.4, 2.20.11-0ubuntu27.6)
End-Date: 2020-08-05 11:12:54

After that the fan no longer spins up.

rockpi-sata.service - Rockpi SATA Hat
Loaded: loaded (/lib/systemd/system/rockpi-sata.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/rockpi-sata.service.d
└─local.conf
Active: active (running) since Wed 2020-08-05 13:35:28 UTC; 3min 45s ago
Process: 5203 ExecStartPost=/bin/sleep 10 (code=exited, status=0/SUCCESS)
Main PID: 5202 (python3)
Tasks: 4 (limit: 9255)
CGroup: /system.slice/rockpi-sata.service
├─5202 /usr/bin/python3 /usr/bin/rockpi-sata/main.py on
├─5223 /usr/bin/python3 /usr/bin/rockpi-sata/main.py on
├─5224 /usr/bin/python3 /usr/bin/rockpi-sata/main.py on
└─5225 /usr/bin/python3 /usr/bin/rockpi-sata/main.py on

Aug 05 13:35:20 mediatca python3[5226]:   File "/usr/bin/rockpi-sata/fan.py", line 81, in running
Aug 05 13:35:20 mediatca python3[5226]:     change_dc(get_dc())
Aug 05 13:35:20 mediatca python3[5226]:   File "/usr/bin/rockpi-sata/fan.py", line 75, in change_dc
Aug 05 13:35:20 mediatca python3[5226]:     gpio.hardware_PWM(12, 25000, dc * 10000)
Aug 05 13:35:20 mediatca python3[5226]:   File "/usr/local/lib/python3.8/dist-packages/pigpio.py", line 2044, in hardware_PWM
Aug 05 13:35:20 mediatca python3[5226]:     return _u2i(_pigpio_command_ext(
Aug 05 13:35:20 mediatca python3[5226]:   File "/usr/local/lib/python3.8/dist-packages/pigpio.py", line 1062, in _pigpio_command_ext
Aug 05 13:35:20 mediatca python3[5226]:     sl.s.sendall(ext)
Aug 05 13:35:20 mediatca python3[5226]: AttributeError: 'NoneType' object has no attribute 'sendall'
Aug 05 13:35:28 mediatca systemd[1]: Started Rockpi SATA Hat.

I reinstalled the rockpi-sata drivers (now it shows 0.14) which rebuilt the pigpiod drivers and it’s working fine now.

$ uname -a
Linux mediatca 5.4.0-1015-raspi #15-Ubuntu SMP Fri Jul 10 05:34:24 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux

● pigpiod.service - Daemon required to control GPIO pins via pigpio
Loaded: loaded (/lib/systemd/system/pigpiod.service; enabled; vendor prese>
Active: active (running) since Thu 2020-08-06 14:03:39 +08; 5min ago
Process: 1630 ExecStart=/usr/local/bin/pigpiod -l (code=exited, status=0/SU>
Main PID: 1647 (pigpiod)
Tasks: 6 (limit: 9255)
CGroup: /system.slice/pigpiod.service
└─1647 /usr/local/bin/pigpiod -l

Aug 06 14:03:38 mediatca systemd[1]: Starting Daemon required to control GPIO p>
Aug 06 14:03:39 mediatca systemd[1]: Started Daemon required to control GPIO pi>
Warning: The unit file, source configuration file or drop-ins of rockpi-sata.se>
● rockpi-sata.service - Rockpi SATA Hat
Loaded: loaded (/lib/systemd/system/rockpi-sata.service; enabled; vendor p>
Drop-In: /etc/systemd/system/rockpi-sata.service.d
└─local.conf
Active: active (running) since Thu 2020-08-06 14:03:49 +08; 5min ago
Process: 1649 ExecStartPost=/bin/sleep 10 (code=exited, status=0/SUCCESS)
Main PID: 1648 (python3)
Tasks: 6 (limit: 9255)
CGroup: /system.slice/rockpi-sata.service
├─1648 /usr/bin/python3 /usr/bin/rockpi-sata/main.py on
├─2105 /usr/bin/python3 /usr/bin/rockpi-sata/main.py on
├─2106 /usr/bin/python3 /usr/bin/rockpi-sata/main.py on
├─2107 /usr/bin/python3 /usr/bin/rockpi-sata/main.py on
└─2108 /usr/bin/python3 /usr/bin/rockpi-sata/main.py on

Aug 06 14:03:39 mediatca systemd[1]: Starting Rockpi SATA Hat…
Aug 06 14:03:49 mediatca systemd[1]: Started Rockpi SATA Hat.

Hi
unfortunately, I have the same issue. But with all the settings above.

$ uname -a
Linux nextpy01-aro 5.4.72-v7l+ #1356 SMP Thu Oct 22 13:57:51 BST 2020 armv7l GNU/Linux

$ systemctl status pigpiod.service
● pigpiod.service - Daemon required to control GPIO pins via pigpio
Loaded: loaded (/lib/systemd/system/pigpiod.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/pigpiod.service.d
└─public.conf
Active: active (running) since Fri 2020-11-13 21:12:32 CET; 29min ago
Main PID: 470 (pigpiod)
Tasks: 4 (limit: 4915)
CGroup: /system.slice/pigpiod.service
└─470 /usr/bin/pigpiod

Nov 13 21:12:32 nextpy01-aro systemd[1]: Starting Daemon required to control GPIO pins via pigpio…
Nov 13 21:12:32 nextpy01-aro systemd[1]: Started Daemon required to control GPIO pins via pigpio.

$ systemctl status rockpi-sata.service
● rockpi-sata.service - Rockpi SATA Hat
Loaded: loaded (/lib/systemd/system/rockpi-sata.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2020-11-13 21:39:09 CET; 3min 50s ago
Main PID: 7172 (python3)
Tasks: 4 (limit: 4915)
CGroup: /system.slice/rockpi-sata.service
├─7172 /usr/bin/python3 /usr/bin/rockpi-sata/main.py on
├─7200 /usr/bin/python3 /usr/bin/rockpi-sata/main.py on
├─7201 /usr/bin/python3 /usr/bin/rockpi-sata/main.py on
└─7202 /usr/bin/python3 /usr/bin/rockpi-sata/main.py on

Nov 13 21:39:11 nextpy01-aro python3[7172]: self._target(*self._args, **self._kwargs)
Nov 13 21:39:11 nextpy01-aro python3[7172]: File “/usr/bin/rockpi-sata/fan.py”, line 81, in running
Nov 13 21:39:11 nextpy01-aro python3[7172]: change_dc(get_dc())
Nov 13 21:39:11 nextpy01-aro python3[7172]: File “/usr/bin/rockpi-sata/fan.py”, line 75, in change_dc
Nov 13 21:39:11 nextpy01-aro python3[7172]: gpio.hardware_PWM(12, 25000, dc * 10000)
Nov 13 21:39:11 nextpy01-aro python3[7172]: File “/usr/lib/python3/dist-packages/pigpio.py”, line 2013, in hardware_PWM
Nov 13 21:39:11 nextpy01-aro python3[7172]: self.sl, _PI_CMD_HP, gpio, PWMfreq, 4, extents))
Nov 13 21:39:11 nextpy01-aro python3[7172]: File “/usr/lib/python3/dist-packages/pigpio.py”, line 1030, in _pigpio_command_ext
Nov 13 21:39:11 nextpy01-aro python3[7172]: sl.s.sendall(ext)
Nov 13 21:39:11 nextpy01-aro python3[7172]: AttributeError: ‘NoneType’ object has no attribute ‘sendall’

$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster

I can’t find the problem. Maybe someone has an idea.

Thanks for your help

If I start the main.py I got the following error message:

$ python3 main.py
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Can’t connect to pigpio at

Did you start the pigpio daemon? E.g. sudo pigpiod

Did you specify the correct Pi host/port in the environment
variables PIGPIO_ADDR/PIGPIO_PORT?
E.g. export PIGPIO_ADDR=soft, export PIGPIO_PORT=8888

Did you specify the correct Pi host/port in the
pigpio.pi() function? E.g. pigpio.pi(‘soft’, 8888)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Process Process-4:
Traceback (most recent call last):
File “/usr/lib/python3.7/multiprocessing/process.py”, line 297, in _bootstrap
self.run()
File “/usr/lib/python3.7/multiprocessing/process.py”, line 99, in run
self._target(*self._args, **self._kwargs)
File “/usr/bin/rockpi-sata/fan.py”, line 81, in running
change_dc(get_dc())
File “/usr/bin/rockpi-sata/fan.py”, line 75, in change_dc
gpio.hardware_PWM(12, 25000, dc * 10000)
File “/usr/lib/python3/dist-packages/pigpio.py”, line 2013, in hardware_PWM
self.sl, _PI_CMD_HP, gpio, PWMfreq, 4, extents))
File “/usr/lib/python3/dist-packages/pigpio.py”, line 1030, in _pigpio_command_ext
sl.s.sendall(ext)
AttributeError: ‘NoneType’ object has no attribute ‘sendall’

Can anyone help me with this problem?