While designing my house installation, I assumed RS485 connection between all light switches and I routed CAT5 cable between all the places where are the devices that potentially will be controlled. I wanted to build my home system based on Cayenne IoT builder. But finally figured out that MODBUS RTU is not the best way of doing it. It works for some sensor readout and remote control, but it's hard to make it working with low latency for complex installation.
The initial idea was that under every light switch there will be a relay which can overtake the manual switch function. Such solution has one advantage - in case of complete system failure, all basic light switches work. So even after serious damage caused by thunderstorm we loose all home automation, but basic functions remain intact.
So I was looking for better solution and found HAPCAN which seem to fit my needs.
The question is simple - how to combine relay and button function in the same device without using 2 processors.
I want to build a tiny device that it would accept its own button messages in the same way as external ones and control its own relay. I have quite constrained area under the light switch.
The simplest solution is using 2 MCUs + 2 CAN transceivers, but I believe one can do it simpler.
I looked at the source codes, they are written in PIC assembly which I never used. I am familiar with AVR and 8051 assembly but prefer programming in C. I found a C template but there are just bare CAN Rx/Tx functions.
Is there some more detailed description of the assembly code?
Yet another idea touches the problem of device identification. Are the ID numbers assigned at the compilation time?
I use in my devices (i.e. here
https://github.com/m-labs/sinara/wiki) unique ID chips wit EIU48 number carved in stone. It is 48bit number and I'd like to use it instead of manually assigned ID numbers. I know CAN uses 29bit addresses, but anyway first MSBs of these 48bits are fixed. This involves readout of the I2C memory but it is trivial.