Page 1 of 1

setup aux command from code not gui

Posted: Thu Jul 23, 2020 10:32 pm
by Archit
Hi guys, I am using a custom made board with atmega328p and want to use a ublox neo 6m gps serial module.
Since I don't want to use and I2C lcd for configuring and GUI can't access serial with serial_gps I want to know how can I set gps_hold to be activated at AUX2=2000 .I am using Arduino ide .I want to just upload the code whilst preset for aux2 to activate gps hold. :!:

Re: setup aux command from code not gui

Posted: Fri Jul 24, 2020 12:21 pm
by PatrikE
At boot the code will check if the gps is connected otherwise it will be setup as a regular serial port.
So you can connect the ftdi and configure the settings in the Gui.
Then plug the GPS and reboot for flight.

Otherwise you need to find where gps hold is activated by AUX in mwii.cpp.
You will also need to set Alt hold and Mag hold boxes too.

/PatrikE

Re: setup aux command from code not gui

Posted: Fri Jul 24, 2020 8:16 pm
by Archit
PatrikE wrote:
Fri Jul 24, 2020 12:21 pm
At boot the code will check if the gps is connected otherwise it will be setup as a regular serial port.
So you can connect the ftdi and configure the settings in the Gui.
Then plug the GPS and reboot for flight.
/PatrikE
Atfirst I also thought the same but sadly it doesn't work that way, once gps_serial is defined config won't work . :roll:
PatrikE wrote:
Fri Jul 24, 2020 12:21 pm
Otherwise you need to find where gps hold is activated by AUX in mwii.cpp.
You will also need to set Alt hold and Mag hold boxes too.
I tried that but its too much stuff hence i thought someone may be knowing how that gets done like the developers.
Thanks anyways (I thought no one will reply as multiwii is old and no more developed so no one on forum)

Re: setup aux command from code not gui

Posted: Mon Jul 27, 2020 11:50 am
by Hamburger
if it was configurable via the desktop gui in the aux* section, you could also add something like this to your config.h

Code: Select all

    for(uint8_t i=0;i<CHECKBOXITEMS;i++) {conf.activate[i] = 0;}
    conf.activate[BOXHORIZON]  = 0x05; // aux1 Low oder high
    conf.activate[BOXVARIO]    = 0x02<<((4-1)*3); // aux4 M +
    conf.activate[BOXBEEPERON] = 0x04<<((4-1)*3); // aux4 H
    conf.activate[BOXBARO] = 0x04<<((2-1)*3); // high aux2
not your actual code but you get the idea