Home Forums EasyTransfer Library Support Forum Cominications Hub

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #1641


    I’ve used your library to communicate my homemade ROV with the surface station successfully And since both, the ROV and surface station are Arduino Mega boards with 4 serial ports I’m wondering if I could add more devices the the network and have the megas work as communication hubs.

    For example in the ROV there are two Arduinos, the mega who gathers all sensor data and controls the thrust and an arduino uno potted on a box with a set of pumps to control the articulated arm. both boards communicate by serial interface 2 of the Mega board and the serial interface 1 links with surface through the umbilical.

    Could I have independent and bidirectional comms over each COM port?




    So if I understand correctly, you want to send a packet of commands intended for the arm from the topside Mega to the ROV Mega which relays it to the arm controlling Arduino Uno?

    Independent comms over the same serial port in opposite directions is no problem. Just create 2 library objects for each direction of travel, there’s an example of that included in the library. The same goes for multiple serial port, just create separate library objects initialized for different ports. You can get tricky if two serial ports are always going to deal with the same set of data and initialize the library objects with the same struct.

    However the limitation is the library only handles one library object per direction of a serial port. So commands for the ROV mega and for the UNO arm must be in the same struct sent from the topside Mega. You could simple retransmit that struct with all commands to the Uno from another serial port on the ROV Mega and code the Uno to only deal with data in the struct that deals with the Arm. It would waste a little bit of RAM but not any CPU cycles.

    Make sense?

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.