101 odd behaviours - maybe interrelated


#1

My drone seems to be exhibiting many odd behaviours compared to what I’m seeing in the video tutorials.

I’m not sure if this is a set of different issues playing up, or if they’re all interrelated, so have put this all in one post in case the latter.

The main symptoms are:

  1. Motors beeping every second, twitching in time with beep
  2. Inability to calibrate ESCs / yellow lights flashing on Pixhawk
  3. Inability to upgrade sudo
  4. Inexplicitly deleting ssh and wpa_supplicant.conf files on Pixhawk micro-card
  5. [new] raspberry pi lights going off after a couple of seconds

More details:

1 - Motors beeping every second, twitching in time with beep.

This seems identical to the issue described here: Motor sound? However, pressing the safety switch does not seem to have any effect. As the yellow light is always flashing on the Pixhawk unit (after initial red & blue flash), I guess I’m not getting to the “armed” stage, which is why the beeping is perpetual.

2 - Inability to calibrate ESCs / yellow lights flashing on Pixhawk

This seems similar to Can't get ESCs to calibrate - Pixhawk fails pre-arm checks As with Mongoose I have been able to update the Pixhawk firmware (to 4.1.2), however I am unable to calibrate the ESCs (following this video https://dojofordrones.com/topic/calibrate-escs-x6b-receiver/ ) it has the following differences:

  • Motors beeping every second (only when battery plugged in)
  • Main Pixhawk light flashing twice yellow repeatedly (after initial 10x yellow, 2xred 2xblue & only when battery plugged in)
  • No beep when safety switch pressed after restart
  • No “do-do, dooo” beeps when lowering the throttle (@1:46)

I have followed the guidance on that thread and calibrated the accelerometers and the compass, and have tried it outside away from buildings to get better GPS. None of that solved the issue.

There are different behaviours when I tried the ESC calibration via Mission Planner. Steps taken were:

  • Drone unpowered, plugged in Pixhawk via USB, connect via Mission Planner (COM4-1-GENERIC as COM6 - shown in videos - was not an option)
  • Go to SETUP > Mandatory Hardware > ESC Calibration, click “Calibrate ESC” button
  • Disconnected USB (no battery in place)
  • Switched on Transmitter, moved throttle up to max
  • Plugged in battery – this time the Pixhawk continued to flash blue & red rather than yellow
  • Held down the safety switch – this time it made a buzz, like the dojofordrones video showed when calibrating ESC without Mission Planner
  • Moved the throttle on the transmitter down to the bottom, but unlike the dojofordrones video, there were no “do-do, dooo” happy beeps, and so I think the ESC calibration didn’t happen

The transmitter has been binded to the receiver, with the transmitter beeping as you would expect when the drone is unpowered (ie when connection lost)

3 - Inability to upgrade sudo:

Following this video https://www.youtube.com/watch?v=kB9YyG2V-nA (linked from here Communicating with Raspberry Pi via MAVLink) @21:30 I tried to update sudo.

Sudo apt-get update

Works like a charm :smiley:

Sudo apt-get upgrade

Breaks :frowning_face:. Each time I try this, it gets as far as

Unpacking raspberrypi-net-mods (1.3.3) over (1.3.0) …

And then nothing happens: eventually PuTTY comes up with the error message “Network error: Software caused connection abort”. I have copied down the preceding 17 pages of console print out, in case that is helpful for diagnosis.

At this point it is not possible to reconnect to the raspberry pi via wifi. When I then plug the SD card back into my computer, the ssh and wpa_supplicant.conf files have disappeared. Even when adding them back in, I am unable to reconnect via wifi.

When trying to “start from scratch” with a new image of the Raspberry Pi OS Lite, I have also tried downloaded this file again incase there was some corruption on downloading.

4 - Deleting files on Pixhawk micro-card

After the issues outlined in 3 (unable to upgrade sudo), I tried using etcher to generate a new image on the SD card and trying again with upgrading sudo. I also tried this with a reformat of the SD before running etcher.

Multiple times I would find:

  • Run etcher
  • Unplug USB and reinsert
  • ssh and wpa_supplicant.conf not present, so copy these files across to boot directory
  • eject D drive, take out USB & reinsert
  • check the ssh and wpa_supplicant.conf are still definitely there
  • eject D drive, take out USB, insert SD card into raspberry pi, plug in battery to drone
  • after quite a while, still unable to find drone on Advance IP Scanner, and unable to connect via PuTTY, unplug batter to done, take out SD card and reinsert into computer
  • The ssh and wpa_supplicant.conf files had completely disappeared!!

Often when I inserted the USB, Windows claimed there were errors with it and offered to scan and repair. Eventually I chose this option rather than ignoring the error, but even then, after scanning, Windows happily said it found no errors (rather than having repaired any).

When I reformatted the SD card, I used the device default options - these were:

  • Capacity: 256 MB (this was the only option, but the SD card says it’s 16GB
  • File system: FAT 32
  • Allocation unit size: 512 bytes
  • Volume label: boot

After reformatting, when I go to properties on the SD card, it says 48 MB used space out of 252 MB capacity, vs 16GB labelled on the side of the card.

5 - Raspberry pi lights going off after a couple of seconds

This is a new one for today… (no symptoms of this before today, no action I can think of that would have caused this overnight). When plugging the battery into the drone:

  • Makes usual beeps (plus the motor beeping)
  • Raspberry pi red light goes on, yellow flickers a bit, then both red and yellow lights go off and stay off, and I cannot connect via wifi
  • Receiver, telemetry, and Pixhawk lights all stay on / flash as before

At least with the Raspberry pi no longer working, it no longer deletes the ssh and wpa_supplicant.conf files from the SD card….

Apologies for all the extraneous information – big problem is that I just don’t know which bits are extraneous.

Apart from that: Everything. Is. Fine. :neutral_face:


#2

Ok let’s see here -

1] Don’t worry about the beeps. I had the same issue and apparently some motor/esc combinations do this.

2] The yellow flashing is due to pre-arm failure [https://ardupilot.org/copter/docs/common-leds-pixhawk.html], probably because your transmitter was not on. Run through the MP esc calibration again just powered by the battery. It is recommended to do this without props on. The fact that you got blue/red indicates it was calibrated though. Then try the MP Motor Test or just arm the drone by moving the stick down to the right. (Disarm by down/left.) Verify that your ESCs are wired correctly to the PDB and each ESC signal wire is in the proper location in the Pixhawk servo outputs with the GND wire up (some FCs however, such as the Holybro Pixhawk 4 mini, the GND is down).

3/4/5] Some SD cards won’t work well with this application. Make sure you are using a good quality SD card with fast read/write specs such as the SanDisk ultra. Not sure why you are having WiFi connection issues, but try re-writing the card image with the RPi Imager [https://www.raspberrypi.com/software/].
image
Tip: Use “Shift-Ctrl-X” to enter wifi informaiton before you write to the card.
Use Advanced IP Scanner to check it’s connected. If not, then it might be a hardware issue or your wifi signal strength is low.


#3

Thanks so much!! Lots there for me to work with.

Run through the MP esc calibration again just powered by the battery

I loaded a new USB driver (via your post here, Need help with telemetry to connect to mission planner CP210x Universal Windows Driver v11.0.0), and now have MP connecting via radio telemetry :partying_face:. I ran through the MP esc calibration just using battery power & telemetry, and although it avoided the yellow flashing lights again, it still does not make the “do-do, dooo” happy beeps to say the esc has been calibrated.

Each time I now power up the drone:

  • If the transmitter is already switched on with the throttle on max – lights flash blue-read
  • If the transmitter is already switched on with the throttle down on zero – lights flash double yellow
  • If the transmitter is switched off at point battery plugged in– lights flash double yellow

All of those light setting remain if the transmitter setting is changed after battery is plugged in (eg moving throttle up/down)

arm the drone by moving the stick down to the right. (Disarm by down/left.)

Sadly moving the stick down, down-right, or down-left all seem to have no effect (incl on the motor beeping, which I think stops once armed). This is whether or not the transmitter was switched on before or after the battery was plugged in; & whether the throttle was on max/top or zero/bottom when the battery was plugged in (each combination tried multiple times)

Then try the MP Motor Test

Every motor test option (each individual or Test-all), failed, with the error “Command was denied by autopilot

Verify that your ESCs are wired correctly to the PDB and each ESC signal wire is in the proper location in the Pixhawk servo outputs with the GND wire up

The ESCs visually look like they are soldered onto the PDB securely, and each motor is beeping and twitching, so it seems like each is getting power (via the escs). I’ve checked the ESC signal wires are all per the dojofordrones video (ie ground up, MAIN OUT plugs 1-4, which is aprox half was along the rail)

Some SD cards won’t work well with this application. Make sure you are using a good quality SD card

I’m using the one provided by Caleb as part of the purchased dojofordrones kit, so all the hardware should be OK. It’s Gigastone Full HD Video 16GB UHS-I

try re-writing the card image with the RPi Imager

I’ve used the RPi imager, and added in the ssh and wpa_supplicant.conf files. Unfortunately, issue #5 (Raspberry pi lights go off 2-3 seconds after powering on) still happens and it all seems to be completely dead after that. I’ve plugged the battery in with no SD card, so see if the symptoms are the same -to test if it could be due to a poor SD card connection- but the symptoms there are completely different (red and yellow lights stay on), so we can rule out poor physical connection.

Use Advanced IP Scanner to check it’s connected.

It’s not – also doesn’t work on PuTTY using pi@raspberrypi.local on port 22

If not, then it might be a hardware issue or your wifi signal strength is low.

I’ve been doing all of this about 2 feet away from our wifi router, just in case that had been the problem, unfortunately not. Hardware was all from Caleb, so unless damaged in the post, it should be OK (box did not appear damaged).


#4

Assuming everything else has been calibrated, you might actually have the ESC calibrated, but just struggling with the pre-arm check. Try powering up again, turn on your transmitter with the stick down. Connect to MP to watch the Messages tab to see what’s going on. Wait 1-5 minutes for the blue/green flashing LED to turn blinking green - this indicates you have “GPS: 3D Fixlock”. If this doesn’t happen you might be in a GPS shadow, so get clear of walls, etc. After you have that you can then try arming and the motors will spin. Always ensure the batteries have sufficient power to push the motors.

Note the “PreArm: Throttle below Failsafe” message which will prevent arming. The MP ARMING_CHECK paramater will allow you to make some adjustments, eg, no GPS.


Regarding the Motor Test, you will get this message sometimes because the %Throttle level to activate the motor was too low. Raise it up to around 10-12 and see if it works.
image
If your RPi does not show any continuous red or blinking green LEDs, then it could be a problem with the SD card, or more rarely, with the board itself. I would first try a fresh SD card.


#5

Thanks - again super helpful.

The following errors were showing on the MP messages:

01/01/2022 09:47:24 : PreArm: Compass 2 not Found
01/01/2022 09:47:24 : PreArm: Compass 2 not Found
01/01/2022 09:47:24 : PreArm: Check firmware or FRAME_CLASS

For the first two I’ve gone into the setup, as you showed, and removed the compass as a requirement for pre-arming checks:

image

Hopefully that won’t cause any issues later on. For the 3rd error, had already checked the Pixhawk had the latest firmware, so went to Setup in MP and set the frametype to “X”. That immediately changed the drone’s yellow flashing lights to blue, and the motor beeps became near continuous. I was then able to follow the esc calibration using MP, and did get the happy beeps.

After this, when connecting the battery and pressing the safety switch, I get the green flashing LED for the first time, and the motors have stopped beeping at me, so I think the esc calibration worked!

The motors still do not react to the transmitter, ie when I press the throttle, they do not spin. There are no error messages coming through on MP. Any ideas, now that I have armed the drone, what else I need to get the motors to spin?

I’ve ordered a new SD card, but it won’t arrive before I need to leave for work so I won’t be able to check that part for a while.


#6

Ah, I thought the frame was already setup, so good you fixed it. You do not want to remove the compass from the pre-arm check. In this case, just uncheck Compass 2 if not used.
image
Did you perform the radio calibration? All the bars moving?
What values do you see for this parameter?
image
If not, is the transmitter setup correctly?
Did you perform the Motor Test?
Is the battery optimal?
We are getting close.


#7

Got it mostly working!!! thanks!

I thought, when there were no other errors, pressing the safety switch armed the drone. Now I understand that pressing the safety switch is just a necessary condition to pass pre-arm checks, and that then you still need to move the throttle to the bottom right to arm.

Once it was armed by doing the bottom right motion, it behaved as expected.

The only thing remaining out of the 5 is the last one: the raspberry pi switches itself off 2 seconds after the battery is plugged in. I have tried a different SD card: no change.

I have also tried to reset the system using the Raspbery Pi Imager > Misc Utility Images > Bootloader > SD Card Boot, and although when this was on the SD card it didn’t turn off after 2 seconds, when that SD card was removed and the usual SD card with Raspberry Pi OD Lite (32-bit) was put in, it turned off after 2 seconds again.

I have found that if I power the Raspberry Pi with the USB-C port rather than the battery via Pixhawk, the Raspberry Pi stays on and behaves as it should. I have double checked the connections between the Pixhawk and the Raspberry Pi, but they all seem fine. They battery is near fully charged, and has enough power the fly the drone.

I was wondering - are there any settings on the Pixhawk (controllable via MP) that could effect this? EG if it thought I was using a 4 cell rather than 3 cell battery, would it reduce the voltage to the Raspberry pi to 3/4 of the level it should be?


#8

Glad to see you got it going. There aren’t any MP settings that I am aware of. I fly with drones using RPi zeroW, RPi 3+ and RPi 4 and haven’t had any power issues. You might want to poke around with a VOM meter to confirm the voltage going to the pins. Otherwise I’m afraid you are going to have to search for answers - then let me know!


#9

Finally got it all working by using Caleberg’s suggestion here: Raspberry Pi Power

I used a voltmeter and found the voltage coming out of the Pixhawk was 3.3V, online a few places mention the Raspberry Pi needs between 4.75 and 5.25V. I then checked, and the ESCs were outputting 5V as expected, so I used one of the 3 unused ESC red wires to power the Raspberry Pi.

I think that’s all 5 out of 5 issues now resolved :+1:

thanks all.


#10

Nice. Or just take it out of the rail like Caleb mentions. The thread was long and assumed we covered that, or it was with Mongoose. Happy flying.