<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.geekworm.com/index.php?action=history&amp;feed=atom&amp;title=CommentStreams%3A3168bfb7e3def494ef9e4b306d348275</id>
	<title>CommentStreams:3168bfb7e3def494ef9e4b306d348275 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.geekworm.com/index.php?action=history&amp;feed=atom&amp;title=CommentStreams%3A3168bfb7e3def494ef9e4b306d348275"/>
	<link rel="alternate" type="text/html" href="https://wiki.geekworm.com/index.php?title=CommentStreams:3168bfb7e3def494ef9e4b306d348275&amp;action=history"/>
	<updated>2026-07-27T14:59:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki.geekworm.com/index.php?title=CommentStreams:3168bfb7e3def494ef9e4b306d348275&amp;diff=32973&amp;oldid=prev</id>
		<title>89.12.232.214: Migrated comment #2983</title>
		<link rel="alternate" type="text/html" href="https://wiki.geekworm.com/index.php?title=CommentStreams:3168bfb7e3def494ef9e4b306d348275&amp;diff=32973&amp;oldid=prev"/>
		<updated>2023-01-09T22:58:50Z</updated>

		<summary type="html">&lt;p&gt;Migrated comment #2983&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;----------------------------&lt;br /&gt;
rc.local&lt;br /&gt;
----------------------------&lt;br /&gt;
  GNU nano 6.2                                                                                      /etc/rc.local&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#!/bin/sh -e&lt;br /&gt;
#&lt;br /&gt;
# rc.local&lt;br /&gt;
#&lt;br /&gt;
# This script is executed at the end of each multiuser runlevel.&lt;br /&gt;
# Make sure that the script will exit 0 on success or any other&lt;br /&gt;
# value on error.&lt;br /&gt;
#&lt;br /&gt;
# In order to enable or disable this script just change the execution&lt;br /&gt;
# bits.&lt;br /&gt;
#&lt;br /&gt;
# By default this script does nothing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/etc/x-c1-pwr.sh &amp;amp;&lt;br /&gt;
python3 /home/shanks/x-c1/fan.py &amp;amp;&lt;br /&gt;
exit 0&lt;br /&gt;
---------------------------&lt;br /&gt;
Fan.py&lt;br /&gt;
---------------------------&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
import pigpio&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
servo = 18&lt;br /&gt;
&lt;br /&gt;
pwm = pigpio.pi()&lt;br /&gt;
pwm.set_mode(servo, pigpio.OUTPUT)&lt;br /&gt;
pwm.set_PWM_frequency( servo, 25000 )&lt;br /&gt;
pwm.set_PWM_range(servo, 100)&lt;br /&gt;
while(1):&lt;br /&gt;
     #get CPU temp&lt;br /&gt;
     file = open(&amp;quot;/sys/class/thermal/thermal_zone0/temp&amp;quot;)&lt;br /&gt;
     temp = float(file.read()) / 1000.00&lt;br /&gt;
     temp = float(&amp;#039;%.2f&amp;#039; % temp)&lt;br /&gt;
     file.close()&lt;br /&gt;
     if(temp &amp;gt; 30):&lt;br /&gt;
          pwm.set_PWM_dutycycle(servo, 40)&lt;br /&gt;
     if(temp &amp;gt; 50):&lt;br /&gt;
          pwm.set_PWM_dutycycle(servo, 50)&lt;br /&gt;
     if(temp &amp;gt; 60):&lt;br /&gt;
          pwm.set_PWM_dutycycle(servo, 70)&lt;br /&gt;
     if(temp &amp;gt; 70):&lt;br /&gt;
          pwm.set_PWM_dutycycle(servo, 80)&lt;br /&gt;
     if(temp &amp;gt; 75):&lt;br /&gt;
          pwm.set_PWM_dutycycle(servo, 100)&lt;br /&gt;
     if(temp &amp;lt; 30):&lt;br /&gt;
          pwm.set_PWM_dutycycle(servo, 0)&lt;br /&gt;
     time.sleep(1)&lt;br /&gt;
---------------------------&lt;br /&gt;
rc.local is running&lt;br /&gt;
---------------------------&lt;br /&gt;
shanks@ubuntu:~/x-c1$ sudo systemctl status rc-local&lt;br /&gt;
● rc-local.service - /etc/rc.local Compatibility&lt;br /&gt;
     Loaded: loaded (/lib/systemd/system/rc-local.service; enabled-runtime; vendor preset: enabled)&lt;br /&gt;
    Drop-In: /usr/lib/systemd/system/rc-local.service.d&lt;br /&gt;
             └─debian.conf&lt;br /&gt;
     Active: active (running) since Mon 2023-01-09 15:38:09 CET; 17min ago&lt;br /&gt;
       Docs: man:systemd-rc-local-generator(8)&lt;br /&gt;
    Process: 809 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS)&lt;br /&gt;
      Tasks: 4 (limit: 2082)&lt;br /&gt;
     Memory: 5.7M&lt;br /&gt;
        CPU: 1min 8.055s&lt;br /&gt;
     CGroup: /system.slice/rc-local.service&lt;br /&gt;
             ├─  812 /bin/bash /etc/x-c1-pwr.sh&lt;br /&gt;
             ├─  813 python3 /home/shanks/x-c1/fan.py&lt;br /&gt;
             └─12725 /bin/sleep 0.2&lt;br /&gt;
&lt;br /&gt;
Jan 09 15:38:09 ubuntu systemd[1]: Starting /etc/rc.local Compatibility...&lt;br /&gt;
Jan 09 15:38:09 ubuntu rc.local[812]: Your device are shutting down...&lt;br /&gt;
Jan 09 15:38:09 ubuntu systemd[1]: Started /etc/rc.local Compatibility.&lt;br /&gt;
--------------------------------------&lt;br /&gt;
Ubuntu version:    Ubuntu 22.04.1 LTS&lt;br /&gt;
--------------------------------------&lt;br /&gt;
Python version : Python 3.10.6&lt;br /&gt;
------------------------------------&lt;br /&gt;
xoff is now working fine but the fan script is not working. &lt;br /&gt;
i tried to execute is manually but nothins happens (i did set the values to 0 to see if the commands will stop the fan but it didn&amp;#039;t)&amp;lt;!-- migrated from Comments; original IP: 89.12.232.214 --&amp;gt;&lt;/div&gt;</summary>
		<author><name>89.12.232.214</name></author>
	</entry>
</feed>