Skip to content

Commit

Permalink
fix(api): change Flex front USB port number to 9 to disambiguate (#12923
Browse files Browse the repository at this point in the history
)

* change Flex front USB port number to 9 to disabiguate

* updates for simulation and emulation
  • Loading branch information
pmoegenburg committed Jul 10, 2023
1 parent f3b14eb commit 96c4dcf
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 14 deletions.
4 changes: 2 additions & 2 deletions api/src/opentrons/drivers/rpi_drivers/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def find_hub(
if (board_revision == BoardRevision.FLEX_B2) and (
hub == FLEX_B2_USB_PORT_GROUP_FRONT
):
port = 1
port = 9
hub_port = int(port_info[2])
else:
port = int(port_info[2])
Expand All @@ -120,7 +120,7 @@ def find_hub(
if board_revision == BoardRevision.FLEX_B2:
port_info = port_nodes[0].split(".")
hub = int(port_info[1])
port = 1
port = 9
hub_port = None
name = port_nodes[0]
else:
Expand Down
4 changes: 2 additions & 2 deletions api/src/opentrons/hardware_control/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from opentrons import types as top_types
from opentrons.config import robot_configs
from opentrons.config.types import RobotConfig, OT3Config
from opentrons.drivers.rpi_drivers.types import USBPort
from opentrons.drivers.rpi_drivers.types import USBPort, PortGroup

from .util import use_or_initialize_loop, check_motion_bounds
from .instruments.ot2.pipette import (
Expand Down Expand Up @@ -1117,7 +1117,7 @@ async def create_simulating_module(

return await self._backend.module_controls.build_module(
port="",
usb_port=USBPort(name="", port_number=0),
usb_port=USBPort(name="", port_number=1, port_group=PortGroup.MAIN),
type=modules.ModuleType.from_model(model),
sim_model=model.value,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ def _next_index() -> int:
ModuleAtPort(
port=c.url,
name=c.module_type,
usb_port=USBPort(
name=c.identifier, port_number=0, hub=True, hub_port=_next_index()
),
usb_port=USBPort(name=c.identifier, port_number=_next_index()),
)
for c in message.connections
]
Expand Down
4 changes: 2 additions & 2 deletions api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
CapacitivePassSettings,
LiquidProbeSettings,
)
from opentrons.drivers.rpi_drivers.types import USBPort
from opentrons.drivers.rpi_drivers.types import USBPort, PortGroup
from opentrons_hardware.hardware_control.motion_planning import (
Move,
MoveManager,
Expand Down Expand Up @@ -485,7 +485,7 @@ async def create_simulating_module(

return await self._backend.module_controls.build_module(
port="",
usb_port=USBPort(name="", port_number=0),
usb_port=USBPort(name="", port_number=1, port_group=PortGroup.LEFT),
type=modules.ModuleType.from_model(model),
sim_model=model.value,
)
Expand Down
4 changes: 2 additions & 2 deletions api/tests/opentrons/drivers/rpi_drivers/test_usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def test_modify_module_list(revision: BoardRevision, usb_bus: USBBus):
expected_name = "1-1.7"
assert updated_list[0].usb_port == USBPort(
name=expected_name,
port_number=1,
port_number=9,
port_group=PortGroup.FRONT,
device_path="1.0/tty/ttyACM4/dev",
hub=False,
Expand All @@ -188,7 +188,7 @@ def test_modify_module_list(revision: BoardRevision, usb_bus: USBBus):
expected_name = "1-1.7.4"
assert updated_list[0].usb_port == USBPort(
name=expected_name,
port_number=1,
port_number=9,
port_group=PortGroup.FRONT,
device_path="1.0/tty/ttyACM5/dev",
hub=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ def modules_at_port() -> List[ModuleAtPort]:
ModuleAtPort(
port=f"url{i}",
name=f"module_type{i}",
usb_port=USBPort(
name=f"identifier{i}", port_number=0, hub=True, hub_port=i + 1
),
usb_port=USBPort(name=f"identifier{i}", port_number=i + 1),
)
for i in range(5)
]
Expand Down

0 comments on commit 96c4dcf

Please sign in to comment.