0

I have recently purchased a raspberry pi 4. I have a small DC cooling fan for it, but I am limited to it being constantly on, which is annoying. I have seen (but do not need, or personally have access to) the PoE hat, which has a cooling fan built-in.

From what I have been able to tell, it has an Atmel Attiny84 that pretends to be the ID EEPROM and also controls the fan. Does anyone know where I can find the source code for this processor? (I happen to have a few of them lying around from a prior project, though I'd hope to use an Attiny85 instead, if possible)

I'd like to reverse-engineer (or just duplicate, assuming it doesn't cause weird behavior) the code to one of my own chips so that I can rig up a fan controller that doesn't require a userspace Python script that polls and requires reinstallation every time I flash the box.

I've found the kernel-side driver here: https://github.com/raspberrypi/linux/blob/rpi-4.19.y/drivers/hwmon/rpi-poe-fan.c

I can't read the above code (my C knowledge is nowhere near that good), but perhaps it would help to start looking?

  • You don't need any code to control a fan - code is included in the kernel. You do need hardware. – Milliways Nov 25 '19 at 02:29
  • (1) https://raspberrypi.stackexchange.com/questions/104196/how-to-remotely-turn-off-the-cooling-fan-of-an-already-software-shut-down-rpi, (2) https://raspberrypi.stackexchange.com/questions/104350/rpi-gpio-pins-2n2222-to-independently-drive-two-dc12v-fans – tlfong01 Nov 25 '19 at 02:30
  • The code burned into the Atmel chip on the POE hat is proprietary. The RPF/RPTL folks have no need to disclose it to you. There's no way to answer this impossible question. – Dougie Nov 25 '19 at 10:07
  • Drat. I was hoping that they had open-sourced that, but that I could not find it. @Milliways I refer to the software running on the microcontroller that handles the fan control in the PoE hat. Thus, there is still software. –  Nov 25 '19 at 16:46
  • I don't suppose anyone is able to help me reverse-engineer the protocol from the Pi side of things? Although I'd still need to figure out the wiring and how to actually activate that driver in the first place... –  Nov 25 '19 at 16:59

0 Answers0