Esempio n. 1
0
async def graphics(manager, conf):
    # Frame number used for animations
    frameno = 0
    pixel_strs = {}

    while manager.any_alive:
        frameno = get_frameno()

        pixel_strs = OrderedDict()

        if not conf.args.do_single:
            for size, pix_map_normlized in conf.maps.items():
                pixel_list = direct_rainbows(pix_map_normlized, frameno)
                pixel_strs[size] = pix_array2text(*pixel_list)

        await manager.wait_for_workers_idle_async()

        for server_id, server_panel_info in conf.panels.items():
            if server_id not in manager.sessions:
                logging.debug(
                    "server id %s not found in manager coroutines: %s" % (
                        server_id,
                        manager.sessions.keys(),
                    ))
                continue
            if server_id not in manager.cmd_queues:
                logging.debug(
                    "server id %s not found in manager command queues: %s" % (
                        server_id,
                        manager.cmd_queues.keys(),
                    ))
                continue

            for panel_number, size in server_panel_info:
                if conf.args.do_single:
                    pixel_str = pix_array2text(frameno, 255, 127)
                    await manager.chunk_payload_with_linenum_async(
                        server_id, "M2603", {"Q": panel_number}, pixel_str)
                else:
                    assert size in pixel_strs, \
                        (
                            "Your panel configuration specifies a size %s but "
                            "your map configuration does not contain a "
                            "matching entry, only %s"
                        ) % (
                            size, conf.maps.keys()
                        )
                    pixel_str = pixel_strs.get(size)
                    if not pixel_str:
                        logging.warning("empty pixel_str generated: %s" %
                                        pixel_str)

                    await manager.chunk_payload_with_linenum_async(
                        server_id, "M2600", {"Q": panel_number}, pixel_str)

            logging.debug("gfx %s fn %s" % (server_id, frameno))

            await manager.chunk_payload_with_linenum_async(
                server_id, "M2610", None, None)
Esempio n. 2
0
def main():
    telecortex.graphics.IMG_SIZE = 100
    telecortex.graphics.DOT_RADIUS = 1

    conf = TeleCortexManagerConfig(
        name="session",
        description=(
            "draw a single rainbow spanning onto telecortex controllers"),
        default_config='dome_overhead')

    conf.parser.add_argument('--enable-preview',
                             default=False,
                             action='store_true')

    conf.parse_args()

    logging.debug("\n\n\nnew session at %s" % datetime.now().isoformat())

    pixel_map_cache = OrderedDict()

    pixel_map_cache['smol'] = normalize_pix_map(PIXEL_MAP_SMOL)
    pixel_map_cache['big'] = normalize_pix_map(PIXEL_MAP_BIG)

    img = get_square_canvas()

    if conf.args.enable_preview:
        cv2_setup_main_window(img)

    manager = conf.setup_manager()

    while manager:
        frameno = get_frameno()
        fill_rainbows(img, frameno)

        pixel_list_smol = interpolate_pixel_map(img, pixel_map_cache['smol'],
                                                INTERPOLATION_TYPE)
        pixel_list_big = interpolate_pixel_map(img, pixel_map_cache['big'],
                                               INTERPOLATION_TYPE)
        pixel_str_smol = pix_array2text(*pixel_list_smol)
        pixel_str_big = pix_array2text(*pixel_list_big)
        for server_id, server_panel_info in conf.panels.items():
            if not manager.sessions.get(server_id):
                continue
            for panel_number, panel_name in server_panel_info:
                if panel_name.startswith('big'):
                    pixel_str = pixel_str_big
                elif panel_name.startswith('smol'):
                    pixel_str = pixel_str_smol

                manager.sessions[server_id].chunk_payload_with_linenum(
                    "M2600", {"Q": panel_number}, pixel_str)
            manager.sessions[server_id].send_cmd_with_linenum('M2610')

        if conf.args.enable_preview:
            if cv2_show_preview(img, pixel_map_cache):
                break
Esempio n. 3
0
def main():
    conf = TeleCortexThreadManagerConfig(
        name="parallel_jvb",
        description=
        "send f****d up rainbow circles to several telecortex controllers in parallel",
        default_config='dome_simplified')

    conf.parse_args()

    conf.parser.print_help()

    pix_map_normlized_smol = MAPS_DOME_SIMPLIFIED['smol']
    pix_map_normlized_big = MAPS_DOME_SIMPLIFIED['big']

    frameno = 0
    seed = random.random() * 50
    start_time = time_now()
    five_minutes = 60 * 5

    manager = conf.setup_manager()

    while manager.any_alive:
        frameno += 1
        if frameno > 2**16 or (start_time - time_now() > five_minutes):
            frameno = 0
            seed = random.random()

        driver = PanelDriver(pix_map_normlized_smol, pix_map_normlized_big,
                             IMG_SIZE, MAX_HUE, MAX_ANGLE)

        pixel_list_smol, pixel_list_big = driver.crazy_rainbows(frameno, seed)
        pixel_str_smol = pix_array2text(*pixel_list_smol)
        pixel_str_big = pix_array2text(*pixel_list_big)
        for server_id, server_panel_info in conf.panels.items():
            if not manager.sessions.get(server_id):
                continue
            for panel_number, map_name in server_panel_info:
                size = map_name.split('-')[0]
                if size == 'big':
                    pixel_str = pixel_str_big
                elif size == 'smol':
                    pixel_str = pixel_str_smol
                else:
                    raise UserWarning('panel size unknown')

                manager.chunk_payload_with_linenum(server_id, "M2600",
                                                   {"Q": panel_number},
                                                   pixel_str)

        manager.wait_for_workers_idle()

        for server_id in manager.sessions.keys():
            manager.chunk_payload_with_linenum(server_id, "M2610", None, None)
Esempio n. 4
0
def main():
    """
    Main.

    Enumerate serial ports
    Select board by pid/vid
    Rend some perpendicular rainbowz
    Respond to microcontroller
    """

    conf = TeleCortexManagerConfig(
        name="hams",
        description=
        "take the output of the screen and draw on several telecortex controllers",
        default_config='dome_overhead')

    conf.parser.add_argument('--enable-preview',
                             default=False,
                             action='store_true')

    conf.parse_args()

    logging.debug("\n\n\nnew session at %s" % datetime.now().isoformat())

    sct = mss()

    img = np.array(sct.grab(MON))

    if conf.args.enable_preview:
        cv2_setup_main_window(img)

    manager = conf.setup_manager()

    while any([manager.sessions.get(server_id) for server_id in conf.panels]):

        img = np.array(sct.grab(MON))

        cv2.imshow(MAIN_WINDOW, np.array(img))

        for server_id, server_panel_info in conf.panels.items():
            if not manager.sessions.get(server_id):
                continue
            for panel_number, map_name in server_panel_info:
                panel_map = conf.maps[map_name]

                pixel_list = interpolate_pixel_map(img, panel_map,
                                                   INTERPOLATION_TYPE)
                pixel_str = pix_array2text(*pixel_list)

                manager.sessions[server_id].chunk_payload_with_linenum(
                    "M2600", {"Q": panel_number}, pixel_str)
            manager.sessions[server_id].send_cmd_with_linenum('M2610')

        if conf.args.enable_preview:
            if cv2_show_preview(img, conf.maps):
                break
async def graphics(manager, conf):
    pixel_map_cache = OrderedDict()
    pixel_str_cache = OrderedDict()

    img = get_square_canvas()

    if conf.args.enable_preview:
        cv2_setup_main_window(img)

    while manager.any_alive:
        frameno = get_frameno()
        fill_rainbows(img, frameno)

        for server_id, server_panel_info in conf.panels.items():
            if server_id not in manager.sessions:
                continue
            for panel_number, map_name in server_panel_info:
                if (server_id, panel_number) not in pixel_map_cache.keys():
                    if map_name not in conf.maps:
                        raise UserWarning(
                            'Panel map_name %s not in known mappings: %s' % (
                                map_name, conf.maps.keys()
                            )
                        )
                    panel_map = conf.maps[map_name]

                    pixel_map_cache[(server_id, panel_number)] = panel_map

                panel_map = pixel_map_cache.get((server_id, panel_number))

                pixel_list = interpolate_pixel_map(
                    img, panel_map, INTERPOLATION_TYPE
                )
                pixel_str_cache[(server_id, panel_number)] = \
                    pix_array2text(*pixel_list)

        await manager.wait_for_workers_idle_async()

        for (server_id, panel_number), pixel_str in pixel_str_cache.items():
            await manager.chunk_payload_with_linenum_async(
                server_id,
                "M2600", {"Q": panel_number}, pixel_str
            )
        for server_id, server_panel_info in conf.panels.items():
            if server_id not in manager.sessions:
                continue
            await manager.chunk_payload_with_linenum_async(
                server_id, 'M2610', None, None)

        if conf.args.enable_preview:
            if cv2_show_preview(img, conf.maps):
                break
Esempio n. 6
0
def graphics(manager, conf):

    sct = mss()

    img = np.array(sct.grab(MON))

    if conf.args.enable_preview:
        cv2_setup_main_window(img)

    pixel_map_cache = OrderedDict()

    while manager.any_alive:

        img = np.array(sct.grab(MON))

        cv2.imshow(MAIN_WINDOW, np.array(img))

        for server_id, server_panel_info in conf.panels.items():
            if not manager.sessions.get(server_id):
                continue
            for panel_number, map_name in server_panel_info:
                if (server_id, panel_number) not in pixel_map_cache.keys():
                    if map_name not in conf.maps:
                        raise UserWarning(
                            'Panel map_name %s not in known mappings: %s' %
                            (map_name, conf.maps.keys()))
                    panel_map = conf.maps[map_name]

                    pixel_map_cache[(server_id, panel_number)] = panel_map
                else:
                    panel_map = pixel_map_cache[(server_id, panel_number)]

                pixel_list = interpolate_pixel_map(img, panel_map,
                                                   INTERPOLATION_TYPE)
                pixel_str = pix_array2text(*pixel_list)

                manager.chunk_payload_with_linenum(server_id, "M2600",
                                                   {"Q": panel_number},
                                                   pixel_str)

        manager.wait_for_workers_idle()

        for server_id in manager.sessions.keys():
            manager.chunk_payload_with_linenum(server_id, "M2610", None, None)

        if conf.args.enable_preview:
            if cv2_show_preview(img, pixel_map_cache):
                break
def main():
    telecortex.graphics.IMG_SIZE = 256

    logging.debug("\n\n\nnew session at %s" % datetime.now().isoformat())

    conf = TeleCortexManagerConfig(
        name="touch_dome",
        description=("Display the output from the touch dome on the panels"),
        default_config='dome_overhead')
    conf.parser.add_argument('--enable-preview',
                             default=False,
                             action='store_true')

    conf.parse_args()

    manager = conf.setup_manager()

    logging.debug("\n\n\nnew session at %s" % datetime.now().isoformat())

    img = get_square_canvas()

    if conf.args.enable_preview:
        cv2_setup_main_window(img)

    while manager.any_alive:
        frameno = get_frameno()
        fill_rainbows(img, frameno)

        for server_id, server_panel_info in conf.panels.items():
            if not manager.sessions.get(server_id):
                continue
            for panel_number, map_name in server_panel_info:
                panel_map = conf.maps[map_name]

                pixel_list = interpolate_pixel_map(img, panel_map,
                                                   INTERPOLATION_TYPE)
                pixel_str = pix_array2text(*pixel_list)

                manager.sessions[server_id].chunk_payload_with_linenum(
                    "M2600", {"Q": panel_number}, pixel_str)
            # import pudb; pudb.set_trace()
            manager.sessions[server_id].send_cmd_with_linenum('M2610')

        if conf.args.enable_preview:
            if cv2_show_preview(img, pixel_map_cache):
                break
Esempio n. 8
0
def main():
    """
    Main.

    Enumerate serial ports
    Select board by pid/vid
    Rend some perpendicular rainbowz
    Respond to microcontroller
    """

    conf = TeleCortexConfig(
        name="rainbowz",
        description="send rainbows to a single telecortex controller as fast as possible",
        default_config='single'
    )
    conf.parser.add_argument('--serial-dev',)

    conf.parser.add_argument('--enable-preview', default=False,
                             action='store_true')

    conf.parse_args()

    logging.debug("\n\n\nnew session at %s" % datetime.now().isoformat())

    target_device = conf.args.serial_dev
    if target_device is None:
        target_device = find_serial_dev(TEENSY_VID)
    if not target_device:
        raise UserWarning("target device not found")
    else:
        logging.debug("target_device: %s" % target_device)
        logging.debug("baud: %s" % DEFAULT_BAUD)

    pix_map_normlized_smol = MAPS_DOME['smol']
    pix_map_normlized_big = MAPS_DOME['big']

    test_img = Image.new('RGB', (IMG_SIZE, IMG_SIZE))

    if conf.args.enable_preview:
        tk_root = tk.Tk()
        tk_img = ImageTk.PhotoImage(test_img)
        tk_panel = tk.Label(tk_root, image=tk_img)
        tk_panel.pack(side="bottom", fill="both", expand="yes")

    start_time = time_now()
    with serial.Serial(
            port=target_device, baudrate=DEFAULT_BAUD, timeout=1
    ) as ser:
        sesh = conf.setup_session(ser)

        while sesh:
            frameno = ((time_now() - start_time) * TARGET_FRAMERATE * ANIM_SPEED) % 360
            fill_rainbows(test_img, frameno)

            pixel_list_smol = interpolate_pixel_map(
                test_img, pix_map_normlized_smol, INTERPOLATION_TYPE
            )
            pixel_list_big = interpolate_pixel_map(
                test_img, pix_map_normlized_big, INTERPOLATION_TYPE
            )
            pixel_str_smol = pix_array2text(*pixel_list_smol)
            pixel_str_big = pix_array2text(*pixel_list_big)
            for panel in range(PANELS):
                if PANEL_LENGTHS[panel] == max(PANEL_LENGTHS):
                    sesh.chunk_payload_with_linenum("M2600", {"Q": panel}, pixel_str_big)
                if PANEL_LENGTHS[panel] == min(PANEL_LENGTHS):
                    sesh.chunk_payload_with_linenum("M2600", {"Q": panel}, pixel_str_smol)
            sesh.send_cmd_with_linenum("M2610")

            if conf.args.enable_preview:
                draw_map(test_img, pix_map_normlized_smol)
                draw_map(test_img, pix_map_normlized_big, outline=(255, 255, 255))
                tk_img = ImageTk.PhotoImage(test_img)
                tk_panel.configure(image=tk_img)
                tk_panel.image = tk_img
                tk_root.update()

            frameno = (frameno + 5) % MAX_HUE
def main():

    conf = TeleCortexThreadManagerConfig(
        name="parallel_video",
        description=(
            "draw a video file spanning several telecortex controllers in "
            "parallel"),
        default_config='dome_overhead')

    conf.parser.add_argument('--enable-preview',
                             default=False,
                             action='store_true')

    conf.parse_args()

    manager = conf.setup_manager()

    cap = cv2.VideoCapture(VIDEO_FILE)
    ret, img = cap.read()

    if conf.args.enable_preview:
        cv2_setup_main_window(img)

    pixel_map_cache = OrderedDict()

    start_time = time_now()

    while manager.any_alive:

        cv2.imshow(MAIN_WINDOW, np.array(img))

        for server_id, server_panel_info in conf.panels.items():
            if not manager.session_active(server_id):
                continue
            for panel_number, map_name in server_panel_info:
                if (server_id, panel_number) not in pixel_map_cache.keys():
                    if map_name not in conf.maps:
                        raise UserWarning(
                            'Panel map_name %s not in known mappings: %s' %
                            (map_name, conf.maps.keys()))
                    panel_map = conf.maps[map_name]

                    pixel_map_cache[(server_id, panel_number)] = panel_map

                if INTERLEAVE:
                    continue
                panel_map = pixel_map_cache.get((server_id, panel_number))

                pixel_list = interpolate_pixel_map(img, panel_map,
                                                   INTERPOLATION_TYPE)
                pixel_str = pix_array2text(*pixel_list)
                manager.chunk_payload_with_linenum(server_id, "M2600",
                                                   {"Q": panel_number},
                                                   pixel_str)

        if INTERLEAVE:
            for panel_number in range(PANELS_PER_CONTROLLER):
                for server_id in conf.panels.keys():
                    panel_map = pixel_map_cache.get((server_id, panel_number))
                    if not panel_map:
                        continue

                    pixel_list = interpolate_pixel_map(img, panel_map,
                                                       INTERPOLATION_TYPE)
                    pixel_str = pix_array2text(*pixel_list)

                    manager.chunk_payload_with_linenum(server_id, "M2600",
                                                       {"Q": panel_number},
                                                       pixel_str)

        manager.wait_for_workers_idle()

        for server_id in manager.sessions.keys():
            manager.chunk_payload_with_linenum(server_id, "M2610", None, None)

        if conf.args.enable_preview:
            if cv2_show_preview(img, pixel_map_cache):
                break

        ret, img = cap.read()
Esempio n. 10
0
def main():
    """
    Main.

    Enumerate serial ports
    Select board by pid/vid
    Rend some perpendicular rainbowz
    Respond to microcontroller
    """

    telecortex.graphics.IMG_SIZE = 64
    telecortex.graphics.DOT_RADIUS = 1

    conf = TeleCortexSessionConfig(
        name="interpolate_opencv",
        description="draw interpolated maps using opencv",
        default_config='dome_overhead')

    conf.parser.add_argument('--serial-dev', )
    conf.parser.add_argument('--serial-baud', default=DEFAULT_BAUD)
    conf.parser.add_argument('--enable-preview',
                             default=False,
                             action='store_true')

    conf.parse_args()

    logging.debug("\n\n\nnew session at %s" % datetime.now().isoformat())

    target_device = conf.args.serial_dev
    if target_device is None:
        target_device = find_serial_dev(TEENSY_VID)
    if not target_device:
        raise UserWarning("target device not found")
    else:
        logging.debug("target_device: %s" % target_device)
        logging.debug("baud: %s" % conf.args.serial_baud)

    # img = cv2.imread(
    #     '/Users/derwent/Documents/GitHub/touch_dome/Images/test_image.jpg',
    #     cv2.IMREAD_COLOR)
    img = get_square_canvas()

    if conf.args.enable_preview:
        cv2_setup_main_window(img)

    with serial.Serial(port=target_device, baudrate=DEFAULT_BAUD,
                       timeout=1) as ser:
        sesh = conf.setup_session(ser)

        while sesh:
            frameno = get_frameno()
            fill_rainbows(img, frameno)

            if conf.args.config == 'goggles':
                pixel_list_goggle = interpolate_pixel_map(
                    img, MAPS_GOGGLE['goggle'], INTERPOLATION_TYPE)
                pixel_str_goggle = pix_array2text(*pixel_list_goggle)
            else:
                pixel_list_smol = interpolate_pixel_map(
                    img, MAPS_DOME['smol'], INTERPOLATION_TYPE)
                pixel_list_big = interpolate_pixel_map(img, MAPS_DOME['big'],
                                                       INTERPOLATION_TYPE)

                pixel_str_smol = pix_array2text(*pixel_list_smol)
                pixel_str_big = pix_array2text(*pixel_list_big)
            for panel, map_name in conf.panels[0]:
                if map_name.startswith('big'):
                    pixel_str = pixel_str_big
                elif map_name.startswith('smol'):
                    pixel_str = pixel_str_smol
                elif map_name.startswith('goggle'):
                    pixel_str = pixel_str_goggle
                sesh.chunk_payload_with_linenum("M2600", {"Q": panel},
                                                pixel_str)
            sesh.send_cmd_with_linenum("M2610")

            if conf.args.enable_preview:
                if cv2_show_preview(img, MAPS_DOME):
                    break
def main():

    telecortex.graphics.DOT_RADIUS = 1

    conf = TeleCortexThreadManagerConfig(
        name="parallel_linalg",
        description=(
            "draw a single rainbow spanning several telecortex controllers in "
            "parallel"),
        default_config='dome_overhead')

    conf.parser.add_argument('--enable-preview',
                             default=False,
                             action='store_true')

    conf.parse_args()

    manager = TeleCortexCacheManager(conf.servers, 'BOKK.gcode')

    cap = cv2.VideoCapture(VIDEO_FILE)
    ret, img = cap.read()

    if conf.args.enable_preview:
        cv2_setup_main_window(img)

    pixel_map_cache = OrderedDict()

    start_time = time_now()

    while manager.any_alive:

        cv2.imshow(MAIN_WINDOW, np.array(img))

        for server_id, server_panel_info in conf.panels.items():
            if not manager.session_active(server_id):
                continue
            for panel_number, size, scale, angle, offset in server_panel_info:
                if (server_id, panel_number) not in pixel_map_cache.keys():
                    if size not in conf.maps:
                        raise UserWarning(
                            'Panel size %s not in known mappings: %s' %
                            (size, conf.maps.keys()))
                    panel_map = conf.maps[size]
                    panel_map = transform_panel_map(panel_map, size, scale,
                                                    angle, offset)

                    pixel_map_cache[(server_id, panel_number)] = panel_map

                if INTERLEAVE:
                    continue
                panel_map = pixel_map_cache.get((server_id, panel_number))

                pixel_list = interpolate_pixel_map(img, panel_map,
                                                   INTERPOLATION_TYPE)
                pixel_str = pix_array2text(*pixel_list)
                manager.chunk_payload_with_linenum(server_id, "M2600",
                                                   {"Q": panel_number},
                                                   pixel_str)

        if INTERLEAVE:
            for panel_number in range(PANELS_PER_CONTROLLER):
                for server_id in conf.panels.keys():
                    panel_map = pixel_map_cache.get((server_id, panel_number))
                    if not panel_map:
                        continue

                    pixel_list = interpolate_pixel_map(img, panel_map,
                                                       INTERPOLATION_TYPE)
                    pixel_str = pix_array2text(*pixel_list)

                    manager.chunk_payload_with_linenum(server_id, "M2600",
                                                       {"Q": panel_number},
                                                       pixel_str)

        while not manager.all_idle:
            logging.debug("waiting on queue")

        for server_id in manager.servers.keys():
            manager.chunk_payload_with_linenum(server_id, "M2610", None, None)

        if conf.args.enable_preview:
            if cv2_show_preview(img, pixel_map_cache):
                break

        ret, img = cap.read()
Esempio n. 12
0
def main():
    """
    Main.

    Enumerate serial ports
    Select board by pid/vid
    Rend some HSV rainbowz
    Respond to microcontroller
    """
    conf = TeleCortexSessionConfig(
        name="rainbowz",
        description=(
            "send rainbows to a single telecortex "
            "controller as fast as possible"
        ),
        default_config='single'
    )
    conf.parser.add_argument(
        '--do-single', default=False, action='store_true',
        help=(
            "if true, send a single colour to the board, "
            "otherwise send a rainbow string"
        )
    )
    # conv.parser.add_argument(
    #     '--virtual', default=False, action='store_true',
    #     help="use virtual sessions (when debugging without access to device)"
    # )
    conf.parser.add_argument('--serial-dev',)
    conf.parser.add_argument('--serial-baud', default=DEFAULT_BAUD)

    conf.parse_args()

    logging.debug("\n\n\nnew session at %s" % datetime.now().isoformat())

    target_device = conf.args.serial_dev
    if target_device is None:
        target_device = find_serial_dev(TEENSY_VID)
    if not target_device:
        raise UserWarning("target device not found")
    else:
        logging.debug("target_device: %s" % target_device)
        logging.debug("baud: %s" % conf.args.serial_baud)
    # Frame number used for animations
    frameno = 0
    # Connect to serial
    with serial.Serial(
        port=target_device, baudrate=conf.args.serial_baud, timeout=1
    ) as ser:
        # logging.debug("serial settings: %s" % pformat(ser.get_settings()))
        # Create session object from config and serial connection
        sesh = conf.setup_session(ser)
        while sesh:
            # H = frameno, S = 255 (0xff), V = 127 (0x7f)
            logging.debug("Drawing frame %s" % frameno)
            for panel, map_name in conf.panels[0]:
                if conf.args.do_single:
                    # Send the M2603 command "set entire strip to this HSV"
                    pixel_str = pix_array2text(
                        frameno, 255, 127
                    )
                    sesh.send_cmd_with_linenum(
                        "M2603", {"Q": panel, "V": pixel_str})
                else:
                    # Send the M2601 command "set strip to this string"
                    panel_length = len(conf.maps[map_name])
                    logging.debug(
                        "panel: %s; panel_length: %s" % (panel, panel_length)
                    )
                    # start off with a list of 3 item long lists (H, S, V)
                    pixel_list = [
                        [(frameno + pixel) % 256, 255, 127]
                        for pixel in range(panel_length)
                    ]
                    logging.debug("pixel_list: %s" % pformat(pixel_list))
                    # List gets flattened into M2601 format
                    pixel_list = list(itertools.chain(*pixel_list))
                    pixel_str = pix_array2text(*pixel_list)
                    # Send the pixel data through the session
                    sesh.chunk_payload_with_linenum(
                        "M2601", {"Q": panel}, pixel_str)

                # Wait if session is still sending the data
                while not sesh.ready:
                    logging.debug("waiting on queue")
            # M2610 causes strip to display the pixels that have been sent
            sesh.send_cmd_with_linenum("M2610")
            # increment frame number
            frameno = (frameno + 1) % 255