User Tools

Site Tools


admin:samba

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
admin:samba [2025/04/20 16:03] rjversluisadmin:samba [2025/05/11 21:28] (current) – [Shell script] rjversluis
Line 1: Line 1:
-======Samba====== +======NASpi====== 
-{{:admin:naspi.png?480}}\\ +{{:admin:naspi:naspi-20250511.jpg?320}} {{:admin:naspi.png?480}}\\
  
  \\  \\
Line 116: Line 115:
  
  
 + \\
 +=====Fan=====
 +==== Install pigpiod====
 +<code bash>sudo apt install pigpio</code>
 +===Start daemon===
 +<code bash>sudo systemctl start pigpiod</code>
 +===Autostart deamon===
 +<code bash>sudo systemctl enable pigpiod</code>
 +
 +====Shell script====
 +Using GPIO4, header pin 7, for the 100Hz PWM.\\
 +<code bash>
 +#!/bin/bash
 +while true
 +do
 +  TEMP=$(cat /sys/class/thermal/thermal_zone0/temp)
 +  RV=$(pigs pfs 4 100)
 +  PWM=0
 +  if (( $TEMP > 45000))
 +  then
 +    PWM=75
 +  fi
 +  if (( $TEMP > 50000))
 +  then
 +    PWM=125
 +  fi
 +  if (( $TEMP > 55000))
 +  then
 +    PWM=175
 +  fi
 +  if (( $TEMP > 60000))
 +  then
 +    PWM=225
 +  fi
 +  echo temp=$TEMP pwm=$PWM
 +  pigs p 4 $PWM
 +  sleep 10
 +done
 +</code>
 +
 +====Startup at reboot====
 +crontab -e
 +<code bash>@reboot /home/pi/fan.sh&</code>
 +
 +====Connecting the Fan====
 +<code>
 +FET BS170 connection:
 +----------------------------------------
 +6 (GND) Source
 +7 (GPIO4) Gate
 +2 (+5V) Fan red wire
 +
 +Fan black wire to FET Drain
 +A resistor of 47k between GND and FET Gate will shutoff the fan in case the GPIO is in an undefined state.\\
 +</code>
 +{{:admin:naspi:naspi-fan.jpg?0x300}}{{?admin:naspi:rpi-fan.png?0x300}}\\
 +
 +
 + \\
 +=====3D====
 +====OpenSCAD====
 +SSDBox and rpi4-box:
 +  * https://gitlab.com/rocrail/rocrail3d/-/tree/master/RPi?ref_type=heads
  \\  \\
 =====Links===== =====Links=====
admin/samba.1745157802.txt.gz · Last modified: 2025/04/20 16:03 by rjversluis