Mixer not loading correct file

I’ve started to add new code to mixer.h and mixer_group.cpp along with a new file that will eventually hold the new mixer type mixer_v22_osprey.cpp. I also added a rotormast_osprey.main.mix and 16002_osprey files. I’m using a Pixhawk 2.1. Here is the output from the console…

sercon: Registering CDC/ACM serial driver
sercon: Successfully registered the CDC/ACM serial driver
WARN [param] selected parameter default file /fs/mtd_params
WARN [rgbled] no RGB led on bus #2
WARN [blinkm] I2C init failed
WARN [blinkm] init failed
INFO [dataman] Power on restart, data manager file ‘/fs/microsd/dataman’ size is 47640 bytes
MS5611_SPI on SPI bus 4 at 2 (20000 KHz)
MS5611_SPI on SPI bus 1 at 3 (20000 KHz)
WARN [bst] no devices found
INFO [ver] match: PX4FMU_V2
WARN [hmc5883] no device on bus 2
WARN [lis3mdl] no device on bus 2
WARN [hmc5883] no device on bus 1
WARN [mpu6000] no device on bus 3
WARN [mpu6000] no device on bus 4
WARN [mpu6000] no device on bus 4
MPU9250 on SPI bus 4 at 1 (1000 KHz)
L3GD20 on SPI bus 4 at 4 (11000 KHz)
LSM303D on SPI bus 4 at 3 (11000 KHz)
WARN [mpu6000] no device on bus 3
WARN [mpu6000] no device on bus 4
MPU9250 on SPI bus 1 at 4 (1000 KHz)
HMC5883_SPI on SPI bus 1 at 5 (11000 KHz)
WARN [hmc5883] no device on bus 3
ERROR [meas_airspeed] no MS4525 airspeed sensor connected
ERROR [meas_airspeed] no MS4525 airspeed sensor connected
ERROR [ets_airspeed] no ETS airspeed sensor connected
ERROR [ets_airspeed] no ETS airspeed sensor connected
INFO [sensors] Mag sensor switch from #-1
WARN [commander] No RGB LED found at /dev/rgbled0
INFO [px4io] default PWM output device
INFO [mavlink] mode: Normal, data rate: 1200 B/s on /dev/ttyS1 @ 57600B
INFO [mavlink] mode: OSD, data rate: 1000 B/s on /dev/ttyS2 @ 57600B
INFO [ver] match: PX4FMU_V2
px4flow [206:100]
WARN [px4flow] scanning I2C buses for device…
INFO [mavlink] mode: Config, data rate: 800000 B/s on /dev/ttyACM0 @ 57600B
INFO [init] Mixer: /etc/mixers/rotormast_osprey.main.mix on /dev/pwm_output0
*******mixer type M
*******mixer type M
*******mixer type M
*******mixer type M
INFO [init] Mixer: /etc/mixers/pass.aux.mix on /dev/pwm_output1
INFO [lib__ecl] EKF IMU buffer length = 21
INFO [lib__ecl] EKF observation buffer length = 16

NuttShell (NSH)
nsh> e[KINFO [lib__ecl] EKF using pressure height - commencing alignment
WARN [mavlink] Disabling hardware flow control
WARN [mavlink] Disabling hardware flow control
INFO [lib__ecl] EKF alignment complete
WARN [commander_tests] Not ready to fly: Sensors not set up correctly
WARN [commander_tests] PREFLIGHT FAIL: MAG #0 UNCALIBRATED
WARN [commander_tests] PREFLIGHT FAIL: MAG #1 UNCALIBRATED
WARN [commander_tests] PREFLIGHT FAIL: MAG #2 UNCALIBRATED
WARN [commander_tests] PREFLIGHT FAIL: ACCEL #0 UNCALIBRATED
WARN [commander_tests] PREFLIGHT FAIL: ACCEL #1 UNCALIBRATED
WARN [commander_tests] PREFLIGHT FAIL: ACCEL #2 UNCALIBRATED
WARN [commander_tests] PREFLIGHT FAIL: GYRO #0 UNCALIBRATED
WARN [commander_tests] PREFLIGHT FAIL: GYRO #1 UNCALIBRATED
WARN [commander_tests] PREFLIGHT FAIL: GYRO #2 UNCALIBRATED
WARN [commander_tests] PREFLIGHT FAIL: ACCEL SENSORS INCONSISTENT - CHECK CALIBRATION

I can see where it is trying to load the correct mixer file, but it also shows my printf lines where I print the mixer type. My type was changed to “A”, but it shows that it loaded 4 “M” type mixers which is wrong. (it looks like a quad).

My mixer file only has “A:” in it.

Any clues as to what is wrong? Any help would be appreciated.

You don’t say where you’ve placed the mixer files (ROMFS or SD card?), If in ROMFS, did you check to see whether the build actually pulled the new file in?

Sorry about that. Using the console I could cat the /etc/init.d/16002_osprey file and it looked correct. I could see the mixer file in /etc/mixers directory but cat didn’t show anything in the file. I.E. I didn’t see the “A:” when I did cat. It seemed empty. If it was then how do I get mine in? Should I put my mixer file in /fd/microsd/mixers directory?

You will not get the output of PX4IO on the console and you’re loading your mixer there. Try instead px4io status and see if the outputs look configured correctly. If you want to debug mixer loading, rename your Mixer to the AUX mixer and load it there.

That’s interesting that printf doesn’t work for px4io. Is mixer_group.cpp part of that because I see printf from there. See *******mixer type M in my print out of the console above. That is why I thought it wasn’t loading correctly. How do I load and auxiliary mixer? Nsh> mixer load /dev/pwm_output0 mymixer.aux.mix?

You need to load the mixer on /dev/pwm_output1. That’s the one on the same micro controller. Output 0 is on a different MCU, which is why you don’t get any printf from it. You did interpret the order of the output incorrectly - the M output is from the 2nd mixer, not the 1st as you assumed.

Thanks. I did find that it was using my mixer after I loaded it from the SD card and used the status command you suggested. I did notice that the files in /etc/… seem to strip out comments and commands it doesn’t normally recognize. That seems to be done by make. Looks like I need to add some more commands to that so it won’t strip them out. Which program is doing that?

Thanks to everyone for the help

Never mind. I think I found it in px_romfs_pruner.py.

Thank you again everyone.