# Get custom module to autorun

Source: https://forum.modalai.com/topic/35/get-custom-module-to-autorun
Category: Flight Core and Legacy VOXL (https://forum.modalai.com/category/9/flight-core-and-legacy-voxl)
Tags: flight-core
Posted: 2020-10-30 21:20:57 UTC by Andrew Keefe
Replies: 2 · Views: 924

## Andrew Keefe · 2020-10-30 21:20:57 UTC

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.

## Reply by modaltb (ModalAI staff) · 2020-10-30 21:50:13 UTC

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

## Reply by Andrew Keefe · 2020-10-31 17:22:49 UTC

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.
