Logging external data from Arduino over UART

Hi Navio people!

I’m trying to work out how to read incoming serial data via the UART or USB port and save it to ArduPilot’s log file.

Details:
Flavor: ArduPlane. Fixed-wing aircraft
boards: Navio+, RaspberryPi Model B+
compiler: compiling from source on Pi

Where I started:
Mr. Overington has laid some nice groundwork over at the diydrones forum, but it’s intended for SPI on an entirely different platform.
Still, I’ve been using this as a reference and created UserCode.cpp and UserVariables.h files similar to his.

Next I went to uncomment the USERHOOK defines in the APM_Config.h and thought it was a bit strange that there was nothing there. So, I tried to figure out where the userhook code resides and upon searching the repositories, it looks like userhook is only supported on Copter.

Is that true? Is there a way to add them to the Plane code? Is there a Plane equivalent?

Thanks for reading, and double-thanks if you’ve got some insight to share.

I don’t see why you couldn’t add a userhook into ArduPilot… The scheduler is identical between them both. Should be as simple as adding a scheduler in ArduPilot.cpp, define the userhook in ArduPilot.h and add a new userhook.cpp file and make the modification.

Dale

Thanks! Going to try this now.