# Unable to set manual mode via set\_mode\_manual()

**URL:** <https://discuss.bluerobotics.com/t/unable-to-set-manual-mode-via-set-mode-manual/1301>\
**Category:** Blue Robotics Software\
**Created:** [July 21, 2017, 11:03pm UTC](https://discuss.bluerobotics.com/t/unable-to-set-manual-mode-via-set-mode-manual/1301 "2017-07-21T23:03:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ru\_sub](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@ru\_sub](https://discuss.bluerobotics.com/u/ru_sub)\
**Post date:** [July 21, 2017, 11:03pm UTC](https://discuss.bluerobotics.com/t/unable-to-set-manual-mode-via-set-mode-manual/1301/1 "2017-07-21T23:03:26Z")

</div>

Hello everyone,

I am currently attempting to write a workaround for the FS\_PILOT\_TIMEOUT on the BlueROV2, which automatically disarms the ROV after a certain amount of seconds once it starts receiving ‘rc’ commands from the user. My aim is to prevent the ROV from automatically disarming itself.

The method I am using is to rapidly send MODE\_MANUAL commands to the ROV, by calling mavutil.mavfile.set\_mode\_manual() at high frequencies. Unfortunately, the Pixhawk doesn’t appear to receive the command, and MAVProxy instead raises a RuntimeError(‘no write() method supplied’), which is thrown by mavutil.mavfile.write(). After examining the stack trace for the function, I discovered that the caller for write() is send(), located in the file pymavlink/dialects/v20/ardupilotmega.py. Surprisingly enough, the send() function doesn’t appear to include any command for sending commands to the Pixhawk:

```
def send(self, mavmsg, force_mavlink1=False):
      '''send a MAVLink message'''
      buf = mavmsg.pack(self, force_mavlink1=force_mavlink1)

      self.file.write(buf) <<<<<<<<here's where mavutil.mavfile.write() is called

      self.seq = (self.seq + 1) % 256
      self.total_packets_sent += 1
      self.total_bytes_sent += len(buf)
      if self.send_callback:
          self.send_callback(mavmsg, *self.send_callback_args, **self.send_callback_kwargs)

```

The full calling pattern is:

set\_mode\_manual() → command\_long\_send() → send() → write()

Even more surprising, I actually managed to use this technique successfully just last week, and the ROV was able to follow ‘rc’ commands without disarming, even with long intervals between each command.

Any insight would be appreciated. Thank you.

---

<div class="post-metadata">

**Author:** ![jwalser](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/jwalser/32/2234_2.png) [@jwalser](https://discuss.bluerobotics.com/u/jwalser)\
**Post date:** [July 22, 2017, 3:15am UTC](https://discuss.bluerobotics.com/t/unable-to-set-manual-mode-via-set-mode-manual/1301/2 "2017-07-22T03:15:30Z")

</div>

Hello. I am sorry, but I do not understand why you are going through all of this trouble. Please correct me if I am missing something.

The ‘rc’ command is just a shortcut to send the RC\_CHANNELS\_OVERRIDE message. You simply need to send the RC\_CHANNELS\_OVERRIDE message at a regular interval. Is there a problem doing it this way?

Also, another console command you might find useful is [‘long’](https://github.com/ArduPilot/MAVProxy/blob/master/MAVProxy/modules/mavproxy_cmdlong.py#L317), which is a shortcut to send COMMAND\_LONG messages.

-Jacob

---

<div class="post-metadata">

**Author:** ![jwalser](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/jwalser/32/2234_2.png) [@jwalser](https://discuss.bluerobotics.com/u/jwalser)\
**Post date:** [July 22, 2017, 3:26am UTC](https://discuss.bluerobotics.com/t/unable-to-set-manual-mode-via-set-mode-manual/1301/3 "2017-07-22T03:26:20Z")

</div>

Another option would be to disable the failsafe via the [FS\_PILOT\_INPUT](https://www.ardusub.com/operators-manual/full-parameter-list.html#fspilotinput-pilot-input-failsafe-action) parameter.

---

<div class="post-metadata">

**Author:** ![ru\_sub](https://avatars.discourse-cdn.com/v4/letter/r/a3d4f5/32.png) [@ru\_sub](https://discuss.bluerobotics.com/u/ru_sub)\
**Post date:** [July 22, 2017, 8:47pm UTC](https://discuss.bluerobotics.com/t/unable-to-set-manual-mode-via-set-mode-manual/1301/4 "2017-07-22T20:47:14Z")

</div>

Thank you for the reply, Jacob. I had initially only set the FS\_PILOT\_INPUT parameter to disabled, but it was still disarming itself. To be safe, I ended up setting all the FS failsafe action parameters to warn only/disabled, and now it works like a charm.

Thanks again for all the help, you saved me a lot of time!
