Hi, we are using the BR Navigator with the hd camera as a tether camera and need to add a slider to cockpit for controlling the light brightness. What is the easiest way to do this? We’ve fiddled with buttons and sliders in the input widget section, but without success. We are not using a joystick. We are using a Windows tablet for running cockpit standalone and need a big’ish slider for banana fingers as this will be used on a small boat.
Hi @hendrikjvr, welcome to the forum ![]()
We don’t yet have good documentation / guides for this kind of functionality at the moment, although that is something I’m actively working on.
I’ll try to put a walkthrough here for your specific use-case, to help me write more complete documentation afterwards, and improve our interface (since the process is currently somewhat convoluted):
-
Check which Navigator pin the lights are connected to
ArduSub ≥4.5.5 moved to dedicated lights functions that are not yet programmatically controllable. While we work on adding support for controlling lights directly, the following steps can instead be followed by setting the relevant pin’s output channel function to Disabled (0), rather thanRCIN9/10(which was previously used for Lights 1/2).- If they’re already known to be controllable, you should be able to check this in the BlueOS Vehicle Setup page (in the overview and PWM tabs)
- In my case Lights 1 is configured as Channel 13:
-
Enter Edit Mode through Cockpit’s sidebar menu, then add your range input of choice to the top or bottom bar, (or in a container widget if you want it somewhere in the main view), and create a variable with a relevant name via the section in the bottom right corner
- I chose to add a slider (per your request) in a collapsible container, so you can make it wider than the default mini-widget width, and hide it away when it’s not in use
- In the interests of having a nice interface I used a 0-100 scale, which matches how the Lights (1) level is reported in the very generic indicator preset
-
Exit Edit Mode, then open
Tools / Data-lakevia the sidebar menu, and create a new compound variable (top right, “Add compound variable”), so we can convert the slider’s nice percentage input into PWM outputs the autopilot can use to control the lights- Note that Cockpit’s sliders generate decimal values, so
rounding to an integer is required for the autopilot to accept the number - Compound variable creation could be skipped if you use a Dial input with the range already matching the output values (1100-1900), but that’s likely less intuitive and more challenging to use
- Note that Cockpit’s sliders generate decimal values, so
-
Close the data lake menu, then go to
Settings / Actionsin the sidebar menu, and create a new MAVLink Message Action
-
Configure it as a
COMMAND_LONGmessage with- ID:
MAV_CMD_DO_SET_SERVOmessage - parameter 1: the pin you want to control, and
- parameter 2: the variable you want to set its value from - curly brackets essential!
- ID:
-
Set up an automatic trigger for the Action by linking it to one of the relevant variables (e.g. the slider variable or the resulting compound variable), to send a new command each time the slider gets updated
- A high update rate limit allows smoother control, but sends more messages while you’re moving the slider, which can cause performance issues (especially for more performance-heavy Actions)
-
The slider should now work to control the Lights1 level output
- If your lights pin changes, you’ll also need to update the Action
- Ideally the autopilot would figure out which pin you want automatically, but that’s not the case at the moment unless you’re using ArduSub’s lights joystick button functions, which don’t provide the fidelity of a slider (they’re just fixed percentage increment/decrement buttons, and require using the full joystick control pipeline)
- If your lights pin changes, you’ll also need to update the Action
I am assuming here that you’re running ArduSub autopilot firmware on your Navigator.
If you’re not running an autopilot then there would be alternative solutions via a BlueOS Extension like NodeRED or OpenVSCode combined with a Cockpit HTTP request Action, but the rest of the process is similar. Alternatively you could run Navigator Web Assistant and embed an external widget in Cockpit for lights control, which is a very different process with a similar result.
If the vertical height of the slider is a problem, not just its width, then you could make a custom one via a DIY widget, although that seems like a lot of effort for limited gain.
@EliotBR Thank you very much! Exactly what we were looking for. Works great.
thanks @EliotBR this looks interesting! However I can’t see where the option to add input widgets is? I assume there should be a button near the regular/mini widgets, however there isnt one I can see (image below). I am using Blue OS 1.4.2 and Ardupilot 4.5.3. What am I missing here? Any ideas?
Thanks
ah nevermind, had to update Cockpit extension.
A couple of updats, as things have shifted so these great instrucitons by Eliot no longer work exactly as published -
First - for lights, if running the latest ArduSub 4.5.7, the Servo13 Function needs to be disabled, not lights1. This does mean that setting up a slider to control lights will disable the game controller buttons that normally control the lights.
Second - when putting in the datalake variable name (in Cockpit action, Parameter 2) the entire path needs to be used. This can be copied to your clipboard via the handy button:

![]()
If you’d like a slider to control camera tilt, this can be done without impacting game controller buttons that do the same. The process is very similar, with a couple key differences:
Set the range of the slider to match the angle range you have setup on the BlueOS Vehicle Setup Camera Gimbal page (in degrees)
No compound variable is required. Setup your Action as follows - the key element is the mavlink command DO_GIMBAL_MANAGER_TILTPAN
Let us know if you have issues setting this up - the team is striving to make it easier with autocompletes coming soon!
Thank you very much, @tony-white !
Just a quick note confirming that these instructions worked great for a camera system installed underwater at the Seattle Aquarium. See a short video linked here on our DropBox to see both light and camera tilt sliders working well in Cockpit Lite.
Cheers!
Zach
It’s super cool to see new applications were Cockpit is useful. Thanks for giving the project a chance and taking the time to wire it up and get this working ![]()
A tip: from what I noticed, you prefer to have the layout as clean as possible. If you want, you can hide the bottom bar by going to the edit menu, and toggling this switch in the View configuration:













