Hi all,
Sorry guys for the very long absence (1year and 5 month), I come back to share with you my progress.
On the home assistant side, I played a lot with my homeassistant (on a RPI3) in order to properly understand how everything works and linked together. MQTT seems to be the road to go when people want to avoid the writing of a painfull platform driver. If the CANOpen choice is maintained, I think I will build a Canopen<->MQTT bridge.
Progree on the HW side :
- In order to save time and use HA with actual hardware, I bought and tried some of the chineese coolcam devices (motion sensor, wall switch and curtain switch). Cheap but I will definitively not use both switch as I found these VERY unpleasant to use (slow, cheap plastic plate…) and the internal design is not safe.
- I also investigated the “mysensor” open source project project as their seems to be well supported by HA and claim to have a wired (RS485) solution. I am familiar with this bus and it is a sensible choice for bus with only one master. However in my mind, home automation has to be decentralized then RS485 (and mysensors) is a no go for me.
- I had great hope with the HAPCAN project but after further investigation it is not fit to my intended use. Moreover, I don’t like the fact there is a custom application layer above the CAN protocol built just for this application. I do like well defined standards like CANOpen (or others). Indeed, in such protocol a good custom application layer is a lot of work (documentation, debugging tools, custom gateway, custom library, etc…) and reinvent the wheel is not my hobby.
- Inspired by design from https://www.openhardware.io which convert Livolo wall switch into mysensor wall switch, I ordered some VL-C701-11 with the idea to convert them to CAN. I am very pleased with the outside lookin and finish of the livolo products. However the inside power electronic do not fit my quality agreement (low cost, not even a fuse there!). So, I will only keep the outside and build my own electronic inside.
On the firmware side:
- Inspired by the HAPCAN hardware, the microcontroler PIC18F seems to be a good candidate for my application. I looked at the microchip AN945 (from 2004!) which implements a canopen stack for old PIC18F microcontroler. This code is not maintained and are not compatible with up to date PIC18F26K80, code adjustment has to be done. However I don’t really know if I can modify (and redistribute) this stack as the code is marked “All rights are reserved”. I don’t understand Microchip policy… No go.
- I was looking for open source Canopen stack and I (re)discover the CanopenNode stack was initially intended to PIC18F but is not today anymore (no more 8-bit microcontroler support). So I digged up in the old sourceforge repository for the last version (V1.10) marked as compatible with (quite old) PIC18F. It is important to notice this old canopennode stack is very basic compared to the last version but I think there is everythink I need and the last version is too big to fit in a PIC18F.
- I have to look in bigger microcontroler compatible with Canopennode (PIC32,…) to ease the dev… I am not very familiar with microchip products.
On the experimental side:
- I started to build a prototype on an experimentation board with CAN transiver and a PIC18F26K80 on it. I succed to build a project and enable a CAN communication between my computer and the microcontroler. Note : i use a CANable USB to CAN cable.
That it!
See you soon
Xavier