[Python] Python - isoTP lib cannot sending consecutive frame after get flow control frame

Discussão em 'Python' iniciado por Stack, Dezembro 17, 2024.

  1. Stack

    Stack Membro Participativo

    as you see on the title I'm using python 3.13.1 with can-isotp2.0.6 and python-can 4.5.0 and USB-CAN Robotell for hardware my scrip

    def send_msg(data)
    channel = find_Robotell_port()
    paramsdata = load_setup ("setup.json")
    bus = can.interface.Bus(interface='robotell', channel=channel, bitrate=500000)
    data_byte = bytes([int(x,16) for x in data])
    addr = isotp.Address(isotp.AddressingMode.Normal_11bits, rxid=0x62C, txid=0x6AC)
    params = paramsdata["Parameters"]
    stack = isotp.CanStack(bus, address=addr, error_handler=my_error_handler, params=params)

    try:
    stack.start()
    stack.send(data = data_byte, send_timeout= 5)
    except isotp.BlockingSendFailure:
    Print('failure to send')
    finally:
    stack.stop()
    bus.shutdown()


    and here is params:

    "Parameters": {
    "stmin" : 10,
    "blocksize" : 0,
    "tx_data_length" : 8,
    "tx_data_min_length" : 8,
    "override_receiver_stmin" :1000,
    "rx_flowcontrol_timeout" : 10000,
    "rx_consecutive_frame_timeout" : 1000,
    "tx_padding": 255,
    "wftmax" : 0,
    "max_frame_size" : 4095,
    "can_fd" : false,
    "bitrate_switch" : false,
    "default_target_address_type": 0,
    "rate_limit_enable" : false,
    "rate_limit_max_bitrate" : 10000000,
    "rate_limit_window_size" : 0.2,
    "listen_mode" : false,
    "blocking_send" :true,
    "logger_name" : "CAN_TP"


    it working fine with payload under 8byte (single frame) but have problem when payload over 8byte: after sending the first frame and recv the flow control. tester doesn't send any consecutive frame and raise exception: BlockingSendFailure

    For example: i tried with data: input = ['0x67','0x03','0xec', '0x45', '0xf2', '0x63', '0xd0', '0xd8', '0xae', '0x9d', '0x2d', '0xb3', '0x23', '0x0', '0x30', '0x73', '0xc0', '0x89','0x73', '0xc0', '0x89']

    send : 10 15 67 03 EC 45 F2 63 (first frame)
    recv : 30 08 14 00 00 00 00 00 (flow control)
    send : nothing and raise exception


    so is there any idea for me to fix this problem Thanks

    fix the problem, maybe wrong setup for isotp

    Continue reading...

Compartilhe esta Página