Servers by jDrones

Tank empty alert

I have digital fuel sensor which is been places to the bottom of the tank, It will change the logic level 0 or 1 depends on the presence of water.

Can I use any of the AUX pin to read this input and display a mavlink msg or buzzer sound?

I using AUX pin 6, so

BTN_Enable=1;
BTN_PIN1=55;
BTN_REPORT_SEND=1;

The problem is I can’t able to observe any changes in Mission Planner(I checked at Messages and Status Tabs to observe changes), where do I see the parameter BTN_PIN1 changes ?

There should be BUTTON_CHANGE Mavlink messages going to the gcs, but I doubt they’re integrated into the UI so not sure how they’re presented.

do you know anything about integrating it into UI (custom mission planner build) ?

You can write a simple plugin for checking BUTTON_CHANGE mavlink message and display a warning. Plugins are independent from Mission Planner builds, so you can keep using standard MP builds.

yes that sounds really good, if only I had software development knowledge. I am surprised that mission planner doesn’t have a way to display that message. I found it only in the mavlink inspector window but that s about it

Not in yet but button binding are coming to lua scripting on board. The example does basically what you want.

edit: forgot the link https://github.com/ArduPilot/ardupilot/pull/12887

OK, here is a quick plugin which intercepts BUTTON_CHANGE messages and put a notification to the “Messages” tab in Mission Planner.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MissionPlanner.Utilities;
using System.IO;
using System.Windows.Forms;
using System.Diagnostics;
using MissionPlanner;

namespace Shortcuts
{
    public class Plugin : MissionPlanner.Plugin.Plugin
    {
        public override string Name
        {
            get { return "Button change"; }
        }
        public override string Version
        {
            get { return "0.1"; }
        }
        public override string Author
        {
            get { return "EOSBandi"; }
        }
        //[DebuggerHidden]
        public override bool Init()
        {
            return true;
        }
        public override bool Loaded()
        {
            Host.comPort.OnPacketReceived += MavOnOnPacketReceivedHandler;
            return true;
        }
        public override bool Loop()
        {
            return true;
        }
        public override bool Exit()
        {
            return true;
        }

        private void MavOnOnPacketReceivedHandler(object o, MAVLink.MAVLinkMessage linkMessage)
        {

            if ((MAVLink.MAVLINK_MSG_ID)linkMessage.msgid == MAVLink.MAVLINK_MSG_ID.BUTTON_CHANGE)
            {
                //Button change message received
                //Check and display message
                Host.cs.messages.Add((DateTime.Now, "BUTTON CHANGE message received"));
            }
        }
    }
}
1 Like

Thanks for that, interesting! I will try it next week and I will get back to you!

Servers by jDrones