Flightlevel: testbed
Note
This section explains:
How a testbed is configured.
How a testbed instance is configured.
Tests always run against a specific testbed. See: Implementation.
This secion is about specifying such a testbed_showcase.
Specification of the testbed
Supported FUTS
File: src/testbed_showcase/constants.py
1class EnumFut(enum.StrEnum):
2 FUT_MCU_ONLY = enum.auto()
3 FUT_I2C = enum.auto()
4 FUT_UART = enum.auto()
5 FUT_ONEWIRE = enum.auto()
6 FUT_TIMER = enum.auto()
Tentacle Types
File: src/testbed_showcase/constants.py
1class TentacleType(enum.StrEnum):
2 TENTACLE_MCU = enum.auto()
3 TENTACLE_DEVICE_POTPOURRY = enum.auto()
4 TENTACLE_DAQ_SALEAE = enum.auto()
Configure the tentacles
File: src/testbed_showcase/tentacles_spec.py
1@dataclasses.dataclass
2class McuConfig:
3 trig1: str
4 trig2: str
5 data1: str
6 data2: str
7 i2c: str
8 onewire: str
The micropython code running on the MCUs differs from device to device - for example which GPIO to be used. See the use of this class in Flightlevel: micropython.
File: src/testbed_showcase/tentacle_specs.py
1tentacle_spec_mcu_rpi_pico2 = TentacleSpec(
2 tentacle_type=TentacleType.TENTACLE_MCU,
3 futs=[
4 EnumFut.FUT_MCU_ONLY,
5 EnumFut.FUT_I2C,
6 EnumFut.FUT_UART,
7 EnumFut.FUT_ONEWIRE,
8 EnumFut.FUT_TIMER,
9 ],
10 category="MicroPython Board",
11 label="pico2",
12 doc=DOC_TENTACLE_RPI_PICO2,
13 mcu_usb_id=util_mcu_pico.RPI_PICO2_USB_ID,
14 tags="boards=RPI_PICO2:RPI_PICO2-RISCV,mcu=rp2,programmer=picotool",
15 relays_closed={
16 EnumFut.FUT_MCU_ONLY: [],
17 EnumFut.FUT_I2C: [2, 3, 4, 5],
18 EnumFut.FUT_ONEWIRE: [2, 3, 4],
19 },
20 mcu_config=McuConfig(
21 trig1="GP20",
22 trig2="GP21",
23 data1="GP19",
24 data2="GP18",
25 i2c="i2c = I2C(1, scl=Pin('GP19'), sda=Pin('GP18'), freq=100_000)",
26 onewire="GP14",
27 ),
28)
Line 2: It is a TENCALE_MCU
Line 3: These FUTS are supported: MCU_ONLY, I2C, UART, ONEWIRE and TIMER.
Line 14: boards=RPI_PICO2:RPI_PICO2-RISCV: Two firmware variants are supported RPI_PICO2 and RPI_PICO2-RISCV
Line 14: mcu=rp2 the processor helps octoprobe to find the corresponding USB manufacturer/device id.
Line 14: programmer=picotool specifies the programmer to be used.
Line 17: EnumFut.FUT_I2C: [2, 3, 4, 5],: When a test specifies to test I2C, then octoprobe will close the relais [2, 3, 4, 5]. This information corresponds to the schematics of the tentacle.
Line 21: trig1=”GP20”,: This fragment will be injected into micropython code. See Flightlevel: micropython.
Configure of the testbed-instance
A testbed is the specification of how the tentacles are populated and wired and how to test the different FUT.
Testbed/Tentacle specification
src/testbed_showcase/tentacle_spec_mcuconfig.py
src/testbed_showcase/tentacles_spec.py
A testbed may be instanciated (pysically assembled and soldered) serveral times: The same testbed may run in Switzerland with MCUs Pico and pyboard and also in Australia using MCUs Esp32, esp8266 and Arduino Portenta C33.
Tentacles inventory
1from octoprobe.usb_tentacle.usb_constants import HwVersion
2from octoprobe.util_baseclasses import TentaclesCollector
3
4from testbed_showcase.constants import TESTBED_NAME
5
6from . import tentacle_specs
7
8TENTACLES_INVENTORY = (
9 TentaclesCollector(testbed_name=TESTBED_NAME)
10 .add_testbed_instance(
11 testbed_instance="ch_hans_1",
12 tentacles=[
13 ("e46340474b17-4429", HwVersion.V03, "v1.0", tentacle_specs.MCU_PYBV11),
14 ("e46340474b4e-1831", HwVersion.V03, "v1.1", tentacle_specs.MCU_RPI_PICO2),
15 ("e46340474b4c-1331", HwVersion.V03, "v1.0", tentacle_specs.DAQ_SALEAE),
16 (
17 "e46340474b4c-3f31",
18 HwVersion.V03,
19 "v1.0",
20 tentacle_specs.DEVICE_POTPOURRY,
21 ),
22 (
23 "de646cc20b92-5425",
24 HwVersion.V03,
25 "v1.0",
26 tentacle_specs.MCU_RPI_PICO_W,
27 ), # Tentacle v0.4
28 ],
29 )
30 .add_testbed_instance(
31 testbed_instance="ch_hans_2",
32 tentacles=[
33 ("e46340474b4c-2731", HwVersion.V03, "v1.1", tentacle_specs.MCU_RPI_PICO2),
34 ("e46340474b28-3623", HwVersion.V03, "v1.0", tentacle_specs.DAQ_SALEAE),
35 (
36 "e46340474b0c-3523",
37 HwVersion.V03,
38 "v1.0",
39 tentacle_specs.DEVICE_POTPOURRY,
40 ),
41 ],
42 )
43 .add_testbed_instance(
44 testbed_instance="ch_greenliff_1",
45 tentacles=[
46 ("e46340474b55-1722", HwVersion.V03, "v1.0", tentacle_specs.MCU_RPI_PICO),
47 ("e46340474b16-4d29", HwVersion.V03, "v1.0", tentacle_specs.DAQ_SALEAE),
48 (
49 "e46340474b57-4722",
50 HwVersion.V03,
51 "v1.0",
52 tentacle_specs.DEVICE_POTPOURRY,
53 ),
54 ],
55 )
56 .add_testbed_instance(
57 testbed_instance="au_damien_1",
58 tentacles=[
59 ("e46340474b14-1c29", HwVersion.V03, "v1.1", tentacle_specs.MCU_RPI_PICO2),
60 ("e46340474b12-1931", HwVersion.V03, "v1.0", tentacle_specs.DAQ_SALEAE),
61 (
62 "e46340474b56-3b21",
63 HwVersion.V03,
64 "v1.0",
65 tentacle_specs.DEVICE_POTPOURRY,
66 ),
67 ],
68 )
69).inventory