sudo modprobe vcan
sudo ip link add vcan0 type vcan
sudo ip link set vcan0 up
candump -L vcan0
cansend vcan0 012#deadbeef
In directory with requirements.txt:
virtualenv -p python3 .thingset
source .thingset/bin/activate
pip install -r requirements.txt
You can skip the first two commands, then all python packages will be added to your computer's python installation! You can leave the environment simply with
deactivate
At the moment you have to use the python shell. I script for nicer commands is on the way.
from thingset.cansocket import CANsocket
sock = CANsocket('vcan0') # or other interface
frame = sock.receive()
print(frame.data) # raw data
print(frame.cbor) # cbor decoded data
print(frame.priority)
print(frame.dataobjectID)
print(frame.source)
from thingset.cansocket import CANsocket
sock = CANsocket('vcan0') # or other interface
while(True):
frame = sock.receive()
Assuming the trace file ist called "trace123.csv":
from thingset.parser import playback
playback('trace123.csv")
cansend vcan0 014#8000FA3FF33333
cansend vcan0 014#8000820C16
cansend vcan0 014#8000C48221196AB3
cansend vcan0 014#8080C48221196AB3
The output should look like this:
Message from ID 20 -> 0: 1.899999976158142
Message from ID 20 -> 0: [12, 22]
Message from ID 20 -> 0: 273.15
Error receiving package from ID 20. Error code: 0x80