I'm begining a new IT project and need to connect one or more Arduino MEGA to a Raspberry Pi 3.
Pi will be the master, sending commands to slave Arduino that will trigger some relay and other electronical components according to the orders received from PI.
I started testing a lot of communication solutions (serial cable, CAN bus, I2C, 433Mhz, USB, ESP8266, ...) and would like to get your feedbacks about the best solutions ???
My requirements are : getting a stable and reliable connection (got some trouble with 433Mhz RF com) to ensure 100% of orders sent got received, avoiding cables if possible and getting a quite reasonable speed of communication.
Which protocol, solution would you advise me to use ?
I have had great success with Can Bus, it also implements a few other layers when compared to RS 485 and you can use standard Linux tools to send, receive and debug messages... or grab some Python can bus library if you are failiar with the language.
Different from RS 485, Can Bus tskes care of message Priority, error checking, Crc.. and if a message is transmitted but not acknowledge by at least another other node in the Bus, you will know that.
Yes I think that CAN bus is also a very good alternative to my project.
I already worked with during my hobby time: model train railroad layouts. It is quite good documented with good libraiires. My Project main programming language is Python, so!
The only issue is that's not a Wireless solution and I prefer to avoid cabling for my project purpose.
So I will try HC-12 Wireless serial shields first before going on CAN or RS485.