Hello,
I have successfully integrated the Raspberry Pi with a CAN hat to the HAPCAN network.
In summary, I have developed C code to make it work as a HAPCAN Ethernet Interface and also as a "MQTT to HAPCAN" gateway.
It means that when I run a HAPCAN Programmer on my PC, it can connect to the Raspberry Pi and program the modules. Also, I can add Items to OpenHAB so it can control the HAPCAN modules and read their status using MQTT.
Mind you, the Software is written in C code for a headless Raspberry Pi (no monitor, no keyboards, no mouse). So, there is nothing fancy implemented, and no user interface. At the moment the translation between MQTT and HAPCAN is very basic.
For the HW setup, I have used two power supplies: a 24V supply for the HAPCAN modules, and a 5V supply for the Raspberry Pi. The grounds (outputs) are connected together.
For the CAN Bus HAT, I have tried two options, and both work:
https://www.waveshare.com/rs485-can-hat.htm
https://www.elektor.com/pican-2-duo-can ... rry-pi-2-3
For the integration, I have used the Raspberry Pi 3. Its ethernet port is connected to my network. For connecting the HAPCAN Bus cable to the Raspberry Pi, I only used the CANH and CANL wires.
My goal is to upload all I have to github in the next weeks, together with a step-by-step guide for setting up the Raspberry Pi.
After my tests, I really believe that the development of a “HAPCAN Hat” for the Raspberry Pi should be at least considered. It would enhance the capabilities of the Ethernet Interface without increasing the power consumption too much. Please, tell me what you think.
Thank you.