SPI or I2C buses are not really suitable for long distances data transfer. We know this, so we designed a module called MCP2515-CAN that communicates via CAN bus.
The small module is equipped with all the necessary circuitry for fast communication and even faster development of your project.
On one side of the module there is a two pin connector for the CAN bus connection, on the other side there is an SPI pin or 2.54mm (unmounted) pin for output to the microcontroller on your board. It doesn't matter if it's ESP32, Raspberry Pi or Arduino. Just make sure the logic voltage is 3.3V.
Example codes are available on this link https://github.com/LaskaKit/MCP2515-CAN/tree/main/SW/CAN_read