05-21-2022, 04:25 AM
Hi,
I'm having a issue when using Arduino to send event via usb to use the steering wheel control of my car.
So first step was identify the resistance and use it's value to map a specific command, which will trigger a usb event corresponding to a key stroke.
The code works fine, but there is a condition, i need to set manually the serial port to the Arduino, which i made it work using "Serial monitor" from the Arduino IDE itself, and using a python script, really simple like this:
this is enough to set the serial port, and raspberry starts receiving automatically the signal, the problem i'm having right now, is that i can't made it automatically, i tried to run that script from differente ways of startup boot
Tried using the rc.local way, the init.d way, in my tests i identified that the "post boot execution" works fine, but when the OpenAuto pops up, seems like every code that is running is just killed, even if my python script execute another python every 5 seconds for example, when OpenAuto pops, i'ts like a reset of every background task.
There is a way to execute my "arduino serial listener" after OpenAuto starts?
Or maybe a configuration to set the arduino static to "/dev/ttyACM0"?
Kind Regards,
Caique.
I'm having a issue when using Arduino to send event via usb to use the steering wheel control of my car.
So first step was identify the resistance and use it's value to map a specific command, which will trigger a usb event corresponding to a key stroke.
The code works fine, but there is a condition, i need to set manually the serial port to the Arduino, which i made it work using "Serial monitor" from the Arduino IDE itself, and using a python script, really simple like this:
#!/usr/bin/python3
import serial
ser = serial.Serial('/dev/ttyACM0', 9600, timeout=5)
# read from Arduino
input = ser.read()
print ("Read input " + input.decode("utf-8") + " from Arduino")
this is enough to set the serial port, and raspberry starts receiving automatically the signal, the problem i'm having right now, is that i can't made it automatically, i tried to run that script from differente ways of startup boot
Tried using the rc.local way, the init.d way, in my tests i identified that the "post boot execution" works fine, but when the OpenAuto pops up, seems like every code that is running is just killed, even if my python script execute another python every 5 seconds for example, when OpenAuto pops, i'ts like a reset of every background task.
There is a way to execute my "arduino serial listener" after OpenAuto starts?
Or maybe a configuration to set the arduino static to "/dev/ttyACM0"?
Kind Regards,
Caique.