####################################################### ##################### 1st Chapter ##################### ####################################################### ##################### Preparation ##################### 1. download/install the "Raspberry Pi Imager" from the web page for your operating system (MS-Win or macOS) https://www.raspberrypi.com/software/ 2. open the "Raspi Imager" and choose under the operating system Raspberry Pi OS Lite (64-bit) Bullseye Published: 2023-02-21 0.3 GB 3. under the settings (cogwheel) i would enter the following --> these are only examples and you please choose your own! - the hostname (umbrel-test.local) - use SSH (active) and password for authentication - username (umbrel) password (what you prefer) - for now no wfi - set language setting, timezone and keyboard layout - then flash the SD card with it ##################### Start ##################### 4.0. start Raspi und open SSH connection - insert your SD card with the flashed PI OS Lite (Bullseye) into the Rasverry Pi slot and turn on information: with my constellation, the fan has now immediately started to run. Should it not be the same for you, don't panic. - open the SSH connection to the Raspi, i use putty (MS-Windows) https://www.putty.org/ ##################### check/set timezone/time ##################### 5. check or set timezone and time - timedatectl - sudo timedatectl set-tizum beispielmezone Europe/Berlin (for example) ##################### observe temperature ##################### 6. i am watching in a new putty window the temperature with - while endless=0; do echo `date +%T` Uhr: `vcgencmd measure_temp`; sleep 5; done ##################### check Debian Version ##################### 7. which Debian version is currently used? remember, since we are now updating - hostnamectl ##################### upgrade OS ##################### 8. upgrade Debian OS - sudo apt update - sudo apt upgrade - sudo reboot check again after reboot - hostnamectl ##################### install/check tools ##################### 9.0. install "Git" run the following command - sudo apt-get install git -- installs 003 archives and requires about 37.7 MB of SD card space (selected for small SD cards) - sudo apt-get install git-all -- installs 280 archives and requires about 564.0 MB of SD card space --> verify - git version (git version 2.30.2) 9.1. Install "Modul Python Serial" - sudo apt-get install python3 - sudo apt install python3-pip - sudo pip3 install pyserial -->verify - python3 -m pip show pyserial answer .. Name: pyserial, Version: 3.5, Summary: Python Serial Port Extension, Home-page: https://github.com/pyserial/pyserial Author: Chris Liechti, Author-email: cliechti@gmx.net, License: BSD, Location: /usr/local/lib/python3.9/dist-packages Requires:, Required-by: - sudo reboot ##################### install/check DeskPi-fan ##################### 10.0 Install "DeskPi-fan" For 64 bit Raspberry Pi OS (aarm64) - cd ~ - git clone https://github.com/DeskPi-Team/deskpi.git - cd ~/deskpi/ - chmod +x install-raspios-64bit.sh - sudo ./install-raspios-64bit.sh - sudo reboot after the reboot the fan goes off and we start with the configuration. do not forget to observe the temperature in a second putty window. temperatures below 70° Celsius (158° F) are ok and the CPU will not suffer -->> Information: in case of installation problems or ERRORS execute - cd ~/deskpi/ - chmod +x install-raspios-64bit.sh - sudo ./uninstall-raspios-64bit.sh 10.1 configuration - deskpi-config select number 6 and enter your desired values, such as 25°-25%, 30°-50%, 45°-75%, 55°-100% the fan runs for 15 min. and then it goes off, no panik. to verify - sudo systemctl status deskpi.service - sudo systemctl start deskpi.service - sudo systemctl stop deskpi.service ##################### Use Python File for DeskPi Service ##################### 11.0. Destination directory - ls -l /lib/systemd/system/deskpi.service needs root rights read/write/execute - ls -l /usr/bin/ needs root rights read/write/execute - ls -l /home/umbrel/deskpi/drivers/python/ needs user rights read/write/execute 11.1. Create new python file "pwmControlFan-v0.py" Information: the following adjustments must now be made. change directory - cd /home/umbrel/deskpi/drivers/python/ create file "pwmControlFan-v0.py" from file "pwmControlFan.py" - cp pwmControlFan.py pwmControlFan-v0.py or copy file to directory - cp pwmControlFan.py /home/umbrel/deskpi/drivers/python/pwmControlFan-v0.py 11.2. change file content and save - sudo nano pwmControlFan-v0.py Copy this script from the next line #!/usr/bin/env python3 ############################################################################################################## # The line above defines the format and must not be changed and must be the first line in the file # Before you import the library, you need to install pyserial library. # via "pip3 install pyserial" in Python3.x or "pip install pyserial" in Python2.x # origi. file name : pwmControlFan-mcb04.py # my file name : pwmControlFan-v0.py # Description : Control the fan on the Deskpi Pro # Author : Deskpi Team, modified by Mike Bartlet # modification Mike : 18/3/2022 # version Mike : "1.4" ############################################################################################################## import serial import time cpuTemp_config = [] #Read the deskpi.conf file which contains temperature thresholds and fanspeeds. Assign default values if it doesn't exist. try: with open("/etc/deskpi.conf") as deskpiConf: configVals = deskpiConf.read().split() for c in range(0,8,2): #Odd values are temperature thresholds. Even values are fan speed cpuTemp_config.append((int(configVals[c]), int(configVals[c+1]))) #Rearrange them into 4 tuples of temperature, fanspeed except: cpuTemp_config = [('40', '50'), ('50', '75'), ('55', '100'), ('60', '100')] #Format is (temperature, fanspeed) def openSerPort(): try: serPort = serial.Serial("/dev/ttyUSB0", 9600, timeout=30) #Open the serial port (ttyUSB0). Deskpi uses it to communicate with the Deskpi Pro fan. except Exception as errDetail: #If there is a problem opening the serial port deskpiError = f"{time.asctime()} - Unable to open serial port ttyUSB0. Error:{errDetail}\n" deskpiLog = open("/home/pi/Python/MyCode/MyProdCode/deskpi.log", "a") #Open the error log for append. deskpiLog.write(deskpiError) deskpiLog.close() serPort = "ttyUSB0 Error" return serPort def readCPU_temp(): with open("/sys/class/thermal/thermal_zone0/temp") as cpu_temp_file: cpu_temp = round(int(cpu_temp_file.read())/1000) return cpu_temp serPort = openSerPort() if serPort != "ttyUSB0 Error": while True: if serPort.isOpen(): cpu_temp = readCPU_temp() if cpu_temp < cpuTemp_config[0][0]: fan = "Off" writeVal = bytearray("pwm_000", "utf-8") #Turn fan off if temp is below temp1 elif cpu_temp >= cpuTemp_config[0][0] and cpu_temp < cpuTemp_config[1][0]: fan = f"{cpuTemp_config[0][1]}%" writeVal = bytearray(f"pwm_{cpuTemp_config[0][1]:0>3}", "utf-8") #If temp is at or above temp1 but below temp2, set fan speed to speed1 elif cpu_temp >= cpuTemp_config[1][0] and cpu_temp < cpuTemp_config[2][0]: fan = f"{cpuTemp_config[1][1]}%" writeVal = bytearray(f"pwm_{cpuTemp_config[1][1]:0>3}", "utf-8") #If temp is at or above temp2 but below temp3, set fan speed to speed2 elif cpu_temp >= cpuTemp_config[2][0] and cpu_temp < cpuTemp_config[3][0]: fan = f"{cpuTemp_config[2][1]}%" writeVal = bytearray(f"pwm_{cpuTemp_config[2][1]:0>3}", "utf-8") #If temp is at or above temp3 but below temp4, set fan speed to speed3 elif cpu_temp >= cpuTemp_config[3][0]: fan = f"{cpuTemp_config[3][1]}%" writeVal = bytearray(f"pwm_{cpuTemp_config[3][1]:0>3}", "utf-8") #If temp is at or above temp4, set fan speed to speed4 serPort.write(writeVal) else: serPort = openSerPort() time.sleep(5) 11.3. insert into important directory (required) - sudo cp pwmControlFan-v0.py /usr/bin/pwmControlFan-v0.py 11.4. change directory and set rights - cd /usr/bin/ - sudo chmod 755 /usr/bin/pwmControlFan-v0.py 11.5. Copy "deskpi.service" file change directory - cd /lib/systemd/system/ copy file - sudo cp deskpi.service deskpi-Original.service or copy file to directory - sudo cp deskpi.service /lib/systemd/system/deskpi-Original.service 11.6. Change "deskpi.service" file content and save it Important information: in the file the Python filename must be used and make sure that the write permissions are set correctly as described above! - sudo nano deskpi.service Copy this script from the next line [Unit] Description=DeskPi Fan Control Service After=multi-user.target [Service] Type=simple RemainAfterExit=no ExecStart=/usr/bin/pwmControlFan-v0.py & [Install] WantedBy=multi-user.target 11.7. reboot and to verify - sudo systemctl status deskpi.service - sudo systemctl start deskpi.service - sudo systemctl stop deskpi.service Here is the original link to the implementation --> https://bytemeta.vip/repo/DeskPi-Team/deskpi/issues/81?page=5 ####################################################### ##################### 2nd Chapter ##################### ####################################################### ##################### check, format, mount SSD Drive ##################### Information: this is the preparation and installtion of umbrel and be careful if you use a SSD device that should NOT be deleted! 12.0. Check internal/external SSD - blkid -o list >> all mounted storage media - lsblk >> all recognized storage media and checking the Partitions - lsblk -f >> list containing file system information 12.1. Make Patition for internal/external SSD Make Patition with fdisk - sudo fdisk /dev/sda - m >> type m for help (overview) - F >> type F list free unpartitioned space (note the start (e.g. 65535) and the end (e.g. 1953525134) of the sector size Explanation: The blockchain is very big, with a 1T SSD I recommend to use the whole SSD and not to create another patition! - n >> type n add a new partition - 1 >> with 1 the first patition is set - 65535 >> set start Sector number e.g. 65535 or click enter for default - 1953525134 >> set end Sector number e.g. 1953525134 or click enter for default - N >> Don't remove the signature - m >> type m for help (overview) - p >> type p for patition overview - v >> type v for verity the patition table - w >> type w write table to disk and exit (IMPORTANT) 12.2. Formatting Disk Partition with ext4 File System Important information: Caution: we delete data NOW on the SSD device! - sudo mkfs -t ext4 /dev/sda1 >> mkfs [options] [-t type fs-options] device [size] Wait now 1-2 minutes until the formatting is finished depending on the size of the SSD 12.3. Check AGAIN internal/external SSD - lsblk -f >> list containing file system information Now the patition "sda1" with the formatting "ext4" is displayed 12.4. Optional --- Set Label name "umbrel_ssd" (choose your own SSD label name) - sudo e2label /dev/sda1 "umbrel_ssd" >> set Label Name - sudo e2label /dev/sda1 >> read Label Name CHECK IT - lsblk -f 12.5. Create a directory for mount point by entering Information: Don't forget "umbrel" is my user or directory in this tutorial and you have to insert yours! - sudo mkdir -p /mnt/data/umbrel >> creates a directory "umbrel" to mount the SSD there - sudo mount -t auto /dev/sda1 /mnt/data/umbrel >> SSD will be connected (mount -t(type) ext4(das Format)) to this directory CHECK IT - lsblk -f Information: Now the whole information of the SSD is displayed, this includes Patition, formatting, label of the SSD, UUID will be needed later, remaining size in GB and percent of the SSD and the mount point directory. Information: for umount SSD use >> sudo umount /mnt/data/umbrel ##################### Update fstab ##################### Information: We want the SSD drive to auto-mount itself after each reboot. This usually means editing /etc/fstab. Firstly, it's always best to use the drives UUID. 13.0.To find the drive's UUID type - ls -al /dev/disk/by-uuid/ or type lsblk -f 13.1. Now View - cat /etc/fstab 13.2. Make a BackUp - sudo cp /etc/fstab /etc/fstab.bac 13.3. Open fstab to edit - sudo nano /etc/fstab Information: The content of "enter your username here as an information note" and "UUID=number" must be edited. Remember, with the commands above at "Firstly" you got the UUID. Don't forget "umbrel" is my user or directory in this tutorial and you have to insert yours! These two lines must be inserted and edited at the end of fstab. # Hard Drive for BitcoinBlockchain Data (by "enter your usernames here as an information note") UUID=number /mnt/data/umbrel ext4 defaults 0 0 OR try this # Hard Drive for BitcoinBlockchain Data (by "enter your usernames here as an information note") /dev/sda1 /mnt/data/umbrel ext4 defaults 0 0 Save fstab - STRG + X >> close file fstab - Yes >> save file fstab - enter key >> File Name to Write /etc/tstab 13.4 Test fstab - findmnt --verify >> warnings are no problems 13.5. Now View again and look at the last two lines. You will recognize your entry in fstab. - cat /etc/fstab ##################### Permission to hard drive ##################### Information: We still need to set the permissions for the directory we created in point 12.5. Make sure that your username is set with the command. In this tutorial the user is called "umbrel". Replace this!!! 14.0. Set User permissions for the directory - sudo chown -R umbrel /mnt/data/umbrel 14.1. It's time for a reboot - sudo reboot ##################### Checking Settings ##################### Let's check if the last settings after the reboot are available. Don't forget "umbrel" is my user or directory in this tutorial and you have to insert yours! 15.0. quick check commands - cat /etc/fstab - lsblk -f - blkid -o list - cd /mnt/data/umbrel >> dont't use sudo back to - cd ~ ##################### install umbrel ##################### Information: To install umbrel, we need only one command line. The rest is done by the installation. Don't forget "umbrel" is my user or directory in this tutorial and you have to insert yours! 15.0. install umbrel now (finally) - curl -L https://umbrel.sh | bash -s -- --install-path /mnt/data/umbrel Information: If you get an error message with the content: alreda contains files Check the files in the folder and move or delete them. The folder must be empty! e.g. a folder with the name "lost+found" was in the directory "umbrel" I have deleted this with - cd /mnt/data/umbrel - dir - rm -r lost+found - cd ~ let's try again - curl -L https://umbrel.sh | bash -s -- --install-path /mnt/data/umbrel --->>> AND NOW YOU WAIT FOR AN umbrel FULLNODE On my Raspi with 8GB memory and a fast SSD the installation was done after 3 min. and the installtiom was finished with the following lines: Umbrel is now accessible at http://umbrel.local http:// IP address was displayed Skipping status update when not on Umbrel OS Umbrel has been sucessfully installed! ##################### Start umbrel in Browser ##################### Start your browser, paste the URL or IP address, click enter and start the umbrel configuration. Note that your username and password do not have to be the same as the console user's username and password. But it makes the maintenance of the raspin easier. The password should be powerful! Hack the Planet, see ya B