Get custom module to autorun
-
I have a custom module that reads data off a UART and publishes through a custom message. The message is being logged and everything is working fine.
I can run the module through the command line just fine.
How do I get it to run automatically at boot up? I tried creating a /fs/microsd/etc/extras.txt file to run the module, but the extras.txt file doesn't seem to be executed. When I changed from +e to -x in the rcS file it seems to stop at the buzzer and not even get to the code for executing the extras.txt file.
Can anyone else who is building from source change rcS from +e to -x and still boot properly? Is there maybe an issue with the file? It closely matches the PX4 code.
-
Hi @Andrew-Keefe ,
Sounds like you are modifying source code ya?
If that's the case then you can start up the module by adding it here:
https://github.com/PX4/PX4-Autopilot/blob/master/boards/modalai/fc-v1/init/rc.board_sensors -
Thanks @modaltb , that worked! I had to set it to run as a background function using the &. It's running perfectly now.
I probably want to rewrite it as a task, but that example code looked tough to follow. I wish the PX4 developer manual included more step by step tutorials, like the ROS tutorials.