@pneves Please do not take my reply as me trying to convince you that there is nothing wrong, it is just my thought process .
My point was that there is definitely something unstandard going on and we do not fully understand what it is. We need to get to the bottom of this and make sure that we add some protection from letting it happen again.
Please try a fresh image and APM and to restore the data from the corrupted SD card and post back.
Sorry to be reviving the post, but we have some preliminary conclusions as to why the behavior that caused the crash happened. It seems that it is due to some USB functionality problems.
When we have just the USB Wifi connected, nothing important happens in Nlon and MaxT parameters and the logs are good. On the other hand when we plug an Arduino dongle and have it communicate with Ardupilot in harmless ways bad things happen in the NLon and MaxT as described in the initial logs.
We have confirmed that it is not the communication per se that causes a problem because we flew with the same communications workloads through the ttyAMA0(UART) and everything is normal. Just when we have the exact same communication happening through USB(ttyUSB0) things are bad.
I am open to opinions or additional information requests.
One question, can pigpiod cause bad timings in combination with the recent AP which is not using pipiod anymore.
On my old Pi1 pigpio is eating 25% cpu time, even if not used.
As weird as it sounds in the Ground (no props) we never get to see the bad MaxT behaviour with the USB, only flying. It is true that the ground tests we do are much shorter than a full flight, but in the real flight with the USB dongle you can clearly see something is wrong.
When we connect the dongle directly to the ttyAMA0 everything is normal
The logs include RPMs field because I am running a slightly modified custom code to add support for RPM measurement. Even so this behavior occurs with the stock ArduCopter 3.3RC11 firmware provided by Emlid.
@pneves
Have you actually ensured the pigpiod is disabled? It runs as standard (I think) in the image.
Second thing you can try is to power the usb dongle externally by a usb hub.
This is actually what I do. Bigger dongles donāt work reliably on the RPi.
I used a USB hub removed the shell and soldered JST (I think) connectors on it.
Never had any problems so far with this solution.
I my opinion the pipiod issue should be declared in the docs, as it is relatively dangerous.
Youāre running a 3.3-rc11 and youāre absolutely positive that pigpiod gets launched? Itās very unlikely actually because itās been removed for a while now. Is there a chance it is run during the boot (/etc/rc.local might have mentioned it)?
The issue is quite simple! pigpio and the new code that handles PPM conflict. Thereās no way they could work together because as itās been said above they use the same resources.
Oh it seems that indeed pigpio was indeed running. But we installed from the previous Raspbian image. Hopefully this will work to eliminate the problem.
I can confirm that the pigpiod is not launched if RC11 is launched, which makes this problem unrelated to pigpiod. We just canāt trust the USB bus not being strange, it seems.
One interesting point is that the *dwc_otg processes seem to always consume around 12% of processor each even if no USB devices are connected. I know that the network card is internally connected through USB but I have 3 dwc_otg processes. I suppose that are relate to USB On the Go.
@george.staroselskiy Do you need any additional feedback on this problem? I have several clients and new products stuck for a Navio launch (we develop on the Navio) that are asking when is the USB problem solved.
Thank you for your attention
Paulo Neves
Airborne Projects Lda
It is really hard to tell much, we will need more info. My initial guess is that USB dongle starts consuming too much power in flight as it gets further from the base and takes too much from the processor, so that it has to start throttling. Power consumption increase associated with increased distance would explain why it happens in flight only.
On my small copter I have no problem with a tiny USB dongle.
However, for my bigger copter I use a USB Hub which is powering more demanding hardware.
This circumvents voltage drops. I donāt really think that something else then a voltage drop @the Piās end can cause this problem.
Maybe you can try to reproduce this problem with an external powered USB Hubs and your problem dongle.
In general, powering a USB dongle is a very old problem from the times of the RPi1. Often such dongles cause timeouts and reconnect to the network again ā¦
I am not sure what happens on the Pi under such conditions. Maybe the Pi2 is more sensitive or maybe not.
I was not really trying to find out.