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.
Reading along? Create a free ModalAI Forum account to join in.
With an account you can reply, ask your own question, get an email when a ModalAI engineer answers, and mark the reply that solved it. Your place in each thread is saved between visits.
Questions about VOXL, Flight Core, ESCs and ModalAI drones are answered here by the engineers who build them.
Register Login