Networked of microcontrollers
Hello everyone.
Could you please guide me to the best practice for connecting 1 computer running ROS and a number of networked microcontrollers ~40? I am connecting a number of Arduino (MicroPro) controllers via ENC28J60 to a network. Each controller needs to receive a task from the computer and return feedback values for that task.(Task example are, operate a servo, activate a relay, or something similar to this).
My approach to this would be to have a node for every uC on the main computer. Each node would subscribe to topic to receive a task and send this task to a specific IP, it would also receive feedback from same IP and publish it to a new topic. Should there just be two topics and all nodes use them together or should there be separate topics for each node(one published and one subscribed topic for each node)?
Is there a better way of doing this? Is ros or ros2 better for this?
Thanks for any help and constructive criticism in advance.
Micro-ROS will not fit in the 8bit uC. As @duck-development suggested, MQTT may be a good idea