CHERRY-PICK: Whale: Add serial server for Beaglebone USB serial control is a generalized class for Beaglebone to make a (or
multiple) serial connections. Dolphin can also use this for Plankton
board control via XMLRPC.

The control path for Dolphin Plnakton board MCU is:
DUT/NUC --(ethernet)--> Beaglebone --> Servo V3 USB HUB --
--(USB cable)--> Larvae --(PL connector)--> Plankton-Raiden(Dolphin)

In Samus, we need to control two Dolphins on each side of Larvae, run on Beaglebone as an XMLRPC server and make serial
connection to both Dolphins. is copied from factory/py/test

TEST=Manually on Beaglebone
  1. Check help string
     $ python -h
     $ python -h

  2. Start dolphin_server
     $ python -d
     Check the message Dolphins are connected on ttyUSB0 and ttyUSB1

  3. Run clients for different commands
     ex. <function> <index> [arguments]
     $ python send [0/1] usbc_action usb(check LED DS1)
     $ python send [0/1] usbc_action dp (check LED DS1)
     $ python receive [0/1] 0 (get received data)

  4. Test remote control
     On Beaglebone:
     $ iptables -A INPUT -p tcp --dport 9997 -j ACCEPT
     $ python -d --host=
     On DUT (on same domain as Beaglebone):
     Use xmlrpclib.ServerProxy('http://<BB's IP>:9997')

Change-Id: I0f9c3f3a25c259ac4a4fd6c499465dd2e7204354
Original: Change-Id: Idc2042cb51c9dd1289eef4c3f00b5fc9d46fc809
Tested-by: Pin-chih Lin <>
Reviewed-by: Dean Liao <>
Commit-Queue: Pin-chih Lin <>
4 files changed