# Remote buttons on Vision-hub or MAVlink-server

Source: https://forum.modalai.com/topic/2717/remote-buttons-on-vision-hub-or-mavlink-server
Category: VOXL SDK and Software (https://forum.modalai.com/category/47/voxl-sdk-and-software)
Tags: mpa
Posted: 2023-10-04 11:10:05 UTC by Caio Licínio Vasconcelos Pantarotto
Replies: 4 · Views: 967

## Caio Licínio Vasconcelos Pantarotto · 2023-10-04 11:10:05 UTC

I want to get information from the remote controller for the state of each channel (the idea is to trigger some functionalities when a certain button is pressed) I managed to get some data from the MPA "mavlink_to_gcs".. But I believe this is probably low frequency.. I wonder if vision-hub outputs this kind of data or do I have to connect directly to mavlink-server? (the documentation says to avoid connecting to mavlink-server directly) Maybe via "mavlink_onboard" or "mavlink_sys_status"

Thank You

## Reply by Eric Katzfey (ModalAI staff) · 2023-10-04 15:39:25 UTC

@Caio-Licínio-Vasconcelos-Pantarotto What kind of remote controller are you using? What platform are you on (e.g. Which drone or development board)? What software release are you using on that platform?

## Reply by Caio Licínio Vasconcelos Pantarotto · 2023-10-04 16:37:16 UTC (in reply to Eric Katzfey)

@Eric-Katzfey Hi I have an out of the box Starling.. voxl2(up-to-date), ELRS 915MHz. I was currently trying to subscribe to "mavlink_onboard".. following the Portal Header source code I managed to get 		

if (msg->msgid == MAVLINK_MSG_ID_HEARTBEAT){
bool armed = (mavlink_msg_heartbeat_get_base_mode(msg) & MAV_MODE_FLAG_SAFETY_ARMED);
uint8_t main_mode = (mavlink_msg_heartbeat_get_custom_mode(msg) & 0x00FF0000) >> 16;
uint32_t sub_mode = (mavlink_msg_heartbeat_get_custom_mode(msg) & 0xFF000000) >> 24;

sub_mode its always 0.. I don't know what sub_mode is supposed to be.. but I would like for example to when I press the right button I wanna trigger something like snapshot. I also wonder if the best way to do this is to use the send-command hires snapshot or maybe get the camera feed directly. I want to make a client pipe that will receive the photo and some other info from other pipes, like vio, and tof.. it would be great to find a way where when I press the button all this info is captured and saved on disk.. and would be good that all of this happens at same time (or the closest as possible). Thank You for the reply.

## Reply by Eric Katzfey (ModalAI staff) · 2023-10-05 15:39:44 UTC (in reply to Caio Licínio Vasconcelos Pantarotto)

@Caio-Licínio-Vasconcelos-Pantarotto You need to look for MAVLINK_MSG_ID_RC_CHANNELS. That contains the raw channel values for all of the RC channels (including the switches, buttons, etc.)

## Reply by Caio Licínio Vasconcelos Pantarotto · 2023-10-09 12:02:24 UTC (in reply to Eric Katzfey)

@Eric-Katzfey Thank You! it worked great.
