I am using the Raspberry Pi with the socketcan implementation. Everything is working fine with fix values. To get my simulation more realistic I would like to generate random CAN messages to i.e. simulate various speeds due to traffic on the highway.
After importing all the necessary libaries and bringing my network up my code looks like this:
I get the following error: ValueError: string must be of size 1. Has anyone got an idea how I can get random hex values without running over that error?