I've just started a new project to build an electronic timer for use in an electric freeflight model aircraft.
My current plot is to use an RPi model B fitted with a 3.5" TFT display as the control box and a PICAXE 14m2 chip as the timer, which means it needs to read a set of switches and to emit pwm pulse trains to drive the ESC (motor control) and an RC servo (other flight functions, e.g a dethermaliser, which is a device to bring the model down when the timer says the flight should end).
The reason for using the RPi is because I can and because I hope that doing so it will teach me about fitting TFT displays and using GTK to handle them.
The control box will be used to configure the timer which is connected to via an AXE027 USB serial cable. This is working: I currently have the PICAXE compiler up and running under jessie and talking to the PICAXE over an AXE027 cable.
The next step is to port SerialPort, a daemon I wrote some time back to give Java programs access to serial ports, to the RPi. It is a daemon written in C that drives serial ports in response to commands sent by a client program over a socket connection. The application on the RPi will be a C program using GTK to interact with the user and the SerialPort daemon to send configuration data to the PICAXE. For completeness, I'd also like to be able to run this setup on any of my Fedora boxes.
So, two questions:
1) The AXE027 cable needs the Debian ftdi_sio kernel module. This is present and working on my RPi, but dnf on a Fedora box has never heard of it. Do any of you know what the equivalent Fedora module is called?2) Each time the RPi is booted, its necessary to run the following commands as root:
modprobe ftdi_sio chmod 777 /sys/bus/usb-serial/drivers/ftdi_sio/new_id echo "0403 bd90" > /sys/bus/usb-serial/drivers/ftdi_sio/new_id which creates and initialises a new device, /dev/ttyUSB0
I know how to set up a start script for SYSVinit to do this and then start the SerialPort daemon, but I'd appreciate and pointers for doing the same under systemd without cheating by using a sysVinit script.
In particular: can I put everything into a serialport.service or it be better to declare that it wants /dev/ttyUSB0 and, by doing so, trigger a .device unit configuration file to set it up?
The /dev/ttyUSB0 device needs to be created each time the RPi is booted, though this can be done just before trying to do anything to the PICAXE, but it only needs to be created once no matter how often programs use it.