# Running code on Raspberry Pi

**URL:** <https://discuss.bluerobotics.com/t/running-code-on-raspberry-pi/21656>\
**Category:** BlueOS\
**Tags:** blueos\
**Created:** [September 24, 2025, 3:57pm UTC](https://discuss.bluerobotics.com/t/running-code-on-raspberry-pi/21656 "2025-09-24T15:57:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![erkamtb](https://avatars.discourse-cdn.com/v4/letter/e/3da27b/32.png) [@erkamtb](https://discuss.bluerobotics.com/u/erkamtb)\
**Post date:** [September 24, 2025, 3:57pm UTC](https://discuss.bluerobotics.com/t/running-code-on-raspberry-pi/21656/1 "2025-09-24T15:57:19Z")

</div>

Hi. I would like to run code on Rpi when using BlueOS. Where i write the codes and execute?

---

<div class="post-metadata">

**Author:** ![tony-white](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/tony-white/32/18385_2.png) [@tony-white](https://discuss.bluerobotics.com/u/tony-white)\
**Post date:** [September 24, 2025, 5:44pm UTC](https://discuss.bluerobotics.com/t/running-code-on-raspberry-pi/21656/2 "2025-09-24T17:44:56Z")

</div>

Hi @erkamtb -

You can either develop an [extension](https://blueos.cloud/docs/latest/development/extensions/), or take the red-pill and run code directly as the root user, or use the visualStudio or jupyter notebook extensions. It would be helpful to know more about what you want your code to accomplish!

---

<div class="post-metadata">

**Author:** ![erkamtb](https://avatars.discourse-cdn.com/v4/letter/e/3da27b/32.png) [@erkamtb](https://discuss.bluerobotics.com/u/erkamtb)\
**Post date:** [September 24, 2025, 6:06pm UTC](https://discuss.bluerobotics.com/t/running-code-on-raspberry-pi/21656/3 "2025-09-24T18:06:37Z")

</div>

It is for autopilot and for doing some servo movements when some sensor inputs change.

---

<div class="post-metadata">

**Author:** ![tony-white](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/tony-white/32/18385_2.png) [@tony-white](https://discuss.bluerobotics.com/u/tony-white)\
**Post date:** [September 24, 2025, 6:41pm UTC](https://discuss.bluerobotics.com/t/running-code-on-raspberry-pi/21656/4 "2025-09-24T18:41:59Z")

</div>

Hi @erkamtb -

Writing a lua script to accomplish your goals may be far faster and easier! There are some relevant threads [here](https://discuss.bluerobotics.com/t/using-joystick-buttons-in-lua-scripts/14727) on the [forum](https://discuss.bluerobotics.com/t/controlling-external-devices-with-lua-scripts-on-ardurover-blueboat-winch/17134), and I’ve been keeping useful scripts [here](https://github.com/vshie/luascript_library_BlueRobotics/tree/main). The official [examples](https://github.com/ArduPilot/ardupilot/tree/master/libraries/AP_Scripting/examples) are also helpful!

Basically this code lives in a specific place, and is run fresh with every autopilot restart. It can read values the autopilot has access too, and log things, control outputs, and react to user control of the vehicle, or take [actions in some scenarios.](https://discuss.bluerobotics.com/t/make-your-blueboat-self-righting-with-a-t500/17456)

---

<div class="post-metadata">

**Author:** ![erkamtb](https://avatars.discourse-cdn.com/v4/letter/e/3da27b/32.png) [@erkamtb](https://discuss.bluerobotics.com/u/erkamtb)\
**Post date:** [September 24, 2025, 7:04pm UTC](https://discuss.bluerobotics.com/t/running-code-on-raspberry-pi/21656/5 "2025-09-24T19:04:50Z")

</div>

Thank you so much. I’ll look at those. Do you have any thing other for my other post?
