ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Get custom module to autorun

    Flight Core
    2
    3
    266
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Andrew KeefeA
      Andrew Keefe
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • modaltbM
        modaltb ModalAI Team
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • Andrew KeefeA
          Andrew Keefe
          last edited by

          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.

          1 Reply Last reply Reply Quote 1
          • First post
            Last post
          Powered by NodeBB | Contributors