I want to combine the Ryanteck RTk.GPIO uk.pi-supply.com/products/ryan with the Raspberry Pi Power Monitor project github.com/David00/rpi-power-m for use with a server (not a pi)

While the two boards physically fit, I didn't realise that the Power Monitor HAT uses SPI rather than GPIO.

Is there a way for me to alter the rpi-power-monitor python code to work with the RTk.GPIO board?

I don't know anything about SPI, but my searches talk about bitbanging via the GPIO?!

Hints welcome :)
#python #raspberrypi

Tagging @intrbiz and @alex as I'm sure you two know something about this sort of thing :)

@bigcalm @alex based on a quick look, the RTK.GPIO is just using a microprocessor (STM32) on the 3nd of a USB interface. To Linux sends USB commands to STM32 to twiddle the pin states. You don't want to bit bang SPI unless you really have to, especially from userspace in Linux. The power monitor board will be using SPI to be able to poll the ADC relatively fast, making bit banging SPI via emulated GPIO poor.

Follow

@bigcalm @alex the STM32 will almost certainly have a SPI controller. However that will require writing custom firmware. Probably better off looking for a USB SPI dongle. Or just using the power monitor board with a PI Zero or similar. Or building a custom SPI interface.

@intrbiz @alex thanks :)
I was hoping to use the server that is already running next to the distribution board.
I'll look at usb spi devices next.

Thankfully the rtk.gpio board was cheap (I got 2 just in case I could use it in 2 setups), so no great loss.

@intrbiz I love open source projects.

github.com/david00/rpi-power-m

It is feasible to wire in a USB to SPI adaptor on the documented pins.

Might punt a few more quid to finding a suitable adaptor to see if I can get it to work.

If that fails, it'll be a case of sticking with the Pi and using external SSD storage for the near constant data writing.
Could even boot from the USB SSD for more reliability.

Sign in to participate in the conversation
Mastodon

Time for a cuppa... Earl Grey please!