Sending MWC status cues via Serial Port

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
mcashatt
Posts: 30
Joined: Sun Sep 30, 2012 7:04 am

Sending MWC status cues via Serial Port

Post by mcashatt »

Hi folks,

First off, I apologize if this has already been done and I failed to find it.

I have a few quads with MWC 2.1 on ATMega boards (like the Crius AIOP) and I would like to write some code (if it does't already exist) to send status messages via a free serial port (serial 1 or 3 in my case) to an Arduino nano that I will use as a lighting driver for addressable RGB LED strips on my quads.

My first thought was to go throughout the entire MWC code base and find certain events like "arming" and then set a free pin on the AIOP to high or something like that; however, the more I think of it, this is a very clumsy approach. So now I am wondering if there is a single class in the MWC code for monitoring events and if we can send bytes containing info about those events to an available serial port if the config.h is set to do so.

The types of status messages and information that I think would be useful include the following:

  • Arming status
  • Aux mode status (level, heading hold, position hold, return to home, etc)
  • Sensor readings (gyro, acc, magnetometer, barometer, etc)
  • Rx readings (Throttle position, Aileron pos, Elevator pos, etc)

My lighting project is pretty "processor intensive" given the special lighting patterns I am creating and I don't think it would be smart or even possible to run this code on the same Arduino/flight controller which is why I will run the lighting from a separate nano.

My overall thinking is that if this information was made available on a serial port, then people could create all sorts of interesting additions and mash ups without interfering with the code that actually running on the flight controller.

Thoughts?

Thanks!

Matt

mcashatt
Posts: 30
Joined: Sun Sep 30, 2012 7:04 am

Re: Sending MWC status cues via Serial Port

Post by mcashatt »

One thing I will add: I don't mind taking a stab at writing this code, but would appreciate any insight as to where best to place it and where best to get information about the events.

Thanks,

Matt

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Sending MWC status cues via Serial Port

Post by Hamburger »

What you describe is dealt with in the NewSerialProtocol already.
Other extension boards (osd and others?) use that to interact with MWii successfully.

mcashatt
Posts: 30
Joined: Sun Sep 30, 2012 7:04 am

Re: Sending MWC status cues via Serial Port

Post by mcashatt »

Hamburger wrote:What you describe is dealt with in the NewSerialProtocol already.
Other extension boards (osd and others?) use that to interact with MWii successfully.


Excellent! Thank you Hamburger!

So it looks like all of the business of sending telemetric data is handled in Serial.ino, correct? I am going to do my own due diligence here, but if you can point me towards a usage doc, tutorial, examples, etc. I would be grateful. If those things do not yet exist, I will be glad to contribute them once I get it all figured out.

Thanks again Hamburger!

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Sending MWC status cues via Serial Port

Post by Hamburger »

search for a thread here in the forums; Alex started it and keeps first posts updated. To my knowledge that is the core documentation.

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Sending MWC status cues via Serial Port

Post by Alexinparis »

You can look also in OSD code source compatible with multiwii, as all of them are also written in c.

mcashatt
Posts: 30
Joined: Sun Sep 30, 2012 7:04 am

Re: Sending MWC status cues via Serial Port

Post by mcashatt »

Alexinparis wrote:You can look also in OSD code source compatible with multiwii, as all of them are also written in c.


Thanks! Can that all be found here on the multiwii site or should I just run a google search on "multiwii OSD"? If you know of any particular OSD and can post a link I would be grateful. In the meantime, I will just do a search.

Thanks!

Matt

mcashatt
Posts: 30
Joined: Sun Sep 30, 2012 7:04 am

Re: Sending MWC status cues via Serial Port

Post by mcashatt »

I found this "Rusduino":

http://code.google.com/p/rushduino-osd/downloads/list

Not sure if that is one of the ones you (Alex) meant.

Thanks again!

Matt

itain
Posts: 75
Joined: Tue Aug 23, 2011 10:32 pm

Re: Sending MWC status cues via Serial Port

Post by itain »

New Rushduino firmware is here:
http://code.google.com/p/rush-osd-development/downloads/list

The latest released version is Rush_KV_2_1.zip. You could carefully remove everything related to Screen.ino and max7456.ino and replace the calls to displayXXX functions with your own. IMHO that would be easier than rewriting from scratch.

-- Itai

mcashatt
Posts: 30
Joined: Sun Sep 30, 2012 7:04 am

Re: Sending MWC status cues via Serial Port

Post by mcashatt »

Thanks Itai!

Post Reply