(╯°□°)╯︵ ┻┻ DeskPi Pro Active Cooling and Front USB ports

Flip on your Desk Pi Pro Active Cooling
image

image

This is an addon for DeskPi Pro in Home Assistant. It’s essentially a script that runs in a docker container. It enables and automates the DeskPi Active Cooling System with your specifications.

Installation

Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.
Within Home Assistant, click Supervisor-> Add-on Store → … button (in top left)-> Repositories. Add this repository.

Click DeskPi Pro Active Cooling Addon and install!

Configuration

image

Celcius values

"CorF": "C"
"LowRange": 35
"MediumRange": 45
"HighRange": 50
"QuietProfile": "true"

Celcius or Farenheit

Choose Celcius or Farenheit.

  • CorF - Configures Celcius or Fahrenheit.

Temperature Ranges

image

Set your fan ranges appropriately.

  • LowRange Minimum Temperature to turn on 33%. Temperatures less than this value will turn the fan off.
  • MediumRange to be the temperature divider between 33 and 66%.
  • HighRange to be the maximum temperature before 100% fan.

Quiet Profile

When Quiet Profile is turned on the duty cycle of the fan is reduced to a dB-based system instead of ramping based on duty cycle. The duty cycle is set to 20%, 40% and 100% instead of 33%, 66% and 100%. These values are estimated to be a steady ramp-up in sound level instead of duty cycle as 33%, 66% and 100% are fairly similar in noise production.

  • QuietProfile set to “true” for quiet fan mode. Set to “false” to turn off. The only accepted value is “true”, not on or 1.

Enable Serial Port and Host Mode USB

In order to enable Serial, you must add dtoverlay=dwc2,dr_mode=host to your config.txt. You can do this from a computer, a terminal addon, or from the hassio main terminal. I recommend using The Easy Way, it’s fast and works well.

The Easy Way

Use this addon to setup serial, then reboot and uninstall the addon.
image

Edit config.txt method

plug your sdcard or memory stick into a computer and modify the config.txt file.

dtoverlay=dwc2,dr_mode=host

Terminal Addon method

If you have a terminal addon, you can disable protection mode mount /dev/ then run the following.

Built-in hard drive

echo 'dtoverlay=dwc2,dr_mode=host' >> /mnt/config.txt

SDCard

echo 'dtoverlay=dwc2,dr_mode=host' >> /mnt/config.txt

Hassio Main Terminal

Login to the main terminal, then at the ha> prompt, type “login”.

echo 'dtoverlay=dwc2,dr_mode=host' >> /mnt/boot/config.txt
2 Likes

Security rating bumped to level 6

1 Like

Hey @adamoutler, I just set this up after using the “HassOS Serial Configurator”, but I don’t get any output except for the following, and the text is black, did I miss something?

image

1 Like

Hello,

I get a message in my system logs that ask to inform you, so here goes:

Add-on have full device access, and selective device access in the configuration. Please report this to the maintainer of DeskPi Pro Active Cooling

I run Hassio supervised 2022.4.2 on a raspberry pi 4 in a Deskpi pro of course!
Need any other info?

Is the message anything to worry about?

2 Likes

I also get this Warning. How do we get rid of the message? It seems like a security loophole!

Hi, when I start the add-in I get this in the logs:

s6-overlay-suexec: fatal: can only run as pid 1

Can you help please? thanks

Looks like this might be related to a recent HA update …
S6-Overlay 3.x update on our docker base images | Home Assistant Developer Docs (home-assistant.io)

Hi, Is this forum still active or is there somewhere better to ask for support? thanks

The Addon no longer works and instead returns:
s6-overlay-suexec: fatal: can only run as pid 1

It needs updated to work with the new S6-Overlay update that HomeAssistant has put out .
(link in ben’s post).

All DeskPi Pro case fans will not turn on until the internal config of this AddOn has been updated or someone has forked / made a replacement AddOn (beyond my skill level atm).

Update seems to have fixed it. Thanks

1 Like

Seems to be working(?) again, thank you very much :slight_smile:

@Coolie1101 I also get this message and wonder if only seeing DeskPi Pro Active Cooling! is normal for the WebUI output, or maybe its because of the the bind failing?

You can check the temperatures of your Raspberry Pi by adding these lines to your configuration.yaml (it’ll also add a few other sensors):

sensor:
  # Raspberry Pi4 CPU Temperature
  - platform: command_line
    name: CPU Temperature
    command: "cat /sys/class/thermal/thermal_zone0/temp"
    # If errors occur, make sure configuration file is encoded as UTF-8
    unit_of_measurement: "°C"
    value_template: "{{ value | multiply(0.001) | round(1) }}"
  - platform: systemmonitor
    resources:
      - type: processor_use
      - type: processor_temperature
      - type: memory_free
      - type: disk_use_percent

There is no information on what to put in the SerialDevice* box on the Configuration page for this AddOn, so I found my serial device by looking at:
Settings > System > Hardware > (the 3 dots in top right) > All Hardware
…and searching for: Serial
ttyUSB2 had the subheading: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
…so for my system, I’d put /dev/ttyUSB2 in the SerialDevice* box (it’s DEVNAME field, if you open up the dropdown to look).

Here is a look at my logs, showing it running (even with a broken? output):
(My settings are Low=32c, Medium=38c, High=45c, QuietProfile disabled):

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
nc: bind: Address in use
Current Temperature 40 °C
Level 3 - Fan 66% (Medium)
Current Temperature 40 °C
Current Temperature 38 °C
Level 2 - Fan 33% (Low)
Current Temperature 39 °C
Level 3 - Fan 66% (Medium)
Current Temperature 39 °C
Current Temperature 39 °C
Current Temperature 38 °C
Level 2 - Fan 33% (Low)
Current Temperature 38 °C
Current Temperature 38 °C
Current Temperature 39 °C
Level 3 - Fan 66% (Medium)
Current Temperature 39 °C
Current Temperature 39 °C
Current Temperature 39 °C
Current Temperature 38 °C
Level 2 - Fan 33% (Low)
Current Temperature 39 °C
Level 3 - Fan 66% (Medium)

Looks good to me.

1 Like

What do you want to see there? I really just added the blank web page because it give you 2-extra security points on the addon home screen :smiley:

Maybe have the last temperature & fan levels from log shown there, so people know its loaded & working?

I dunno if its possible to also get the text color, so it shows properly for people with dark mode / themes enabled?

I’m having another issue now though… /dev/ttyUSB2 has disappeared on my system due to a HomeAssistant update… so the cooling addon doesn’t work again -.-

Maybe the recent update to HomeAssistant overwrote the config.txt & dtoverlay=dwc2,dr_mode=host needs added back in again?

“Strangely”, the add-on half-works with the SerialDevice* set to /dev/ttyAMA0… but I get the following failure:

s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
nc: bind: Address in use
Current Temperature 34 °C
Level 2 - Fan 33% (Low)
/run.sh: line 85: /dev/ttyAMA0: Operation not permitted
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
punt!```

Managed to fix the missing /dev/ttyUSB2 by installing & running HassOS Serial Configurator again.

It complained that the entry already existed, so it had done nothing… but after a hard reset, /dev/ttyUSB2 was back again… and the cooling add-on was working again :slight_smile:

1 Like

This is a great add-in! Super easy to setup and configure with the DeskPi Pro. Works as exactly as expected. Thank you!

Is there any way to control the fan outside of the AddIn using automations? I think it would be nice to run the fan manually for testing or even just to toggle the quiet mode during times when I’m less likely to be around the device.

There would not be a good way to do that without increasing processing power and requiring loading of binaries continuously. I would not have a problem doing that in a second addon. If someone wants to submit a patch I’d be happy to support it. I have several projects I’m working on though.