linklayer / cantact

Drivers and Command Line Interface for CANtact tools
http://cantact.io
MIT License
46 stars 11 forks source link

send_one.py does not work #12

Closed brainstorm closed 3 years ago

brainstorm commented 3 years ago

https://github.com/linklayer/cantact/blob/master/driver/examples/send_one.py

% ./send_one.py
thread '<unnamed>' panicked at 'index out of bounds: the len is 0 but the index is 0', driver/src/python.rs:128:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "/Users/rvalls/dev/personal/can_scripts/./send_one.py", line 33, in <module>
    send_one()
  File "/Users/rvalls/dev/personal/can_scripts/./send_one.py", line 26, in send_one
    bus.send(msg)
  File "/Users/rvalls/dev/personal/can_scripts/python-can/can/interfaces/cantact.py", line 106, in send
    self.interface.send(
pyo3_runtime.PanicException: index out of bounds: the len is 0 but the index is 0
zsh: segmentation fault  ./send_one.py
brainstorm commented 3 years ago

The default can_logger.py script on python-can works fine though, so this does not look like an isolated installation issue:

% can_logger.py -i cantact -c0
Connected to CantactBus: CANtact: ch:0
Can Logger (Started on 2021-04-15 22:42:57.657496)
Timestamp:        0.000164    ID: 0cfe6cee    X Rx                DLC:  8    00 00 c0 c1 00 ff 00 ff     Channel: 0
Timestamp:        0.010056    ID: 0cfe6cee    X Rx                DLC:  8    00 00 c0 c1 00 ff 00 ff     Channel: 0
Timestamp:        0.030023    ID: 0cfe6cee    X Rx                DLC:  8    00 00 c0 c1 00 ff 00 ff     Channel: 0
Timestamp:        0.050125    ID: 0cfe6cee    X Rx                DLC:  8    00 00 c0 c1 00 ff 00 ff     Channel: 0
Timestamp:        0.070158    ID: 0cfe6cee    X Rx                DLC:  8    00 00 c0 c1 00 ff 00 ff     Channel: 0
(...)