Possible to start logging without arming?

Hi,
I’m trying to test the sonar capabilities on the APM 2.6, and am having trouble creating log files because I have the APM as a stand-alone logger. All I have connected to it are a power supply, the sonar, and a GPS, and my goal is to compare the sonar and the barometer readings for height, using the readings in the log files. So I realize that the APM will not start logging unless it is armed, and I have tried adding in a (start_logging():wink: function call in (init_arducopter()) to get around the issue; however, when I tried to connect to afterwards to get the log files, the APM started spewing binary data at me, and would not let me access the logs.
My question is “Is there a way to get around manipulating the code in order to start logging without arming? If there is not, what is another way of manipulating the code?” Thanks!

[quote=“tedlim”]Hi,
I’m trying to test the sonar capabilities on the APM 2.6, and am having trouble creating log files because I have the APM as a stand-alone logger. All I have connected to it are a power supply, the sonar, and a GPS, and my goal is to compare the sonar and the barometer readings for height, using the readings in the log files. So I realize that the APM will not start logging unless it is armed, and I have tried adding in a (start_logging():wink: function call in (init_arducopter()) to get around the issue; however, when I tried to connect to afterwards to get the log files, the APM started spewing binary data at me, and would not let me access the logs.
My question is “Is there a way to get around manipulating the code in order to start logging without arming? If there is not, what is another way of manipulating the code?” Thanks![/quote]

github.com/priseborough/ardupil … 6528f248ce is how to do it on master… Don’t know about 3.1.2.

Yea… sadly I need to know how to do it for 3.1.2 =/ It looks like it already has that implemented in 3.1.2 but I still can’t create new logs. Unless maybe I’m going about creating a new log wrong? All I do in order to create the log is just plug the USB into my comp and connect it with mission planner, move the APM around a bit and then disconnect. I’m pretty new to this stuff, so maybe I’m getting the log creation process wrong?

Making the changes specified in the patch works for me. I loaded the code, booted into the CLI, erased all my logs, rebooted, waited for it to finish booting, repeated a few times, rebooted into the CLI, and there were multiple logs.

The changes in the patch is suggesting to simply move the block of code from ArduCopter/motors.pde to ArduCopter/ArduCopter.pde correct? (e.g. cut from “motors”; paste to “ArduCopter”) I think I’ve tampered with the original code too much, so the changes didn’t work for me at the moment, so could you remind me how do I go about updating the code to the original patch? Do i just re-download all the files again from dev.ardupilot.com/wiki/building-px4-with-make/ like how i originally got them? Thanks a bunch!

Since you have a git client installed, you can just do a git stash and it will stash all of your current changes. If you don’t care about your changes, you can do a hard reset to remotes/origin/ArduCopter-3.1.2

Git is worth learning, at least the basics.