PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.17k stars 13.36k forks source link

[Bug] Cannot disable logging with config.txt #21892

Open jperez-droneup opened 1 year ago

jperez-droneup commented 1 year ago

Describe the bug

When running a docker image of PX4, we add a etc/config.txt with the following content: param set-default SDLOG_MODE -1 This is consistent with instructions on how to set default parameters and the parameter itself. However, when PX4 starts up, we still get logs:

INFO  [logger] logger started (mode=all)
INFO  [logger] Start file log (type: full)
INFO  [logger] [logger] ./log/2023-07-26/18_52_18.ulg
INFO  [logger] Opened full log file: ./log/2023-07-26/18_52_18.ulg

To Reproduce

Expected behavior

No logging

Screenshot / Media

No response

Flight Log

_____  __   __    ___ 
| ___ \ \ \ / /   /   |
| |_/ /  \ V /   / /| |
|  __/   /   \  / /_| |
| |     / /^\ \ \___  |
\_|     \/   \/     |_/

px4 starting.

INFO  [px4] Calling startup script: /bin/sh etc/init.d-posix/rcS 0
INFO  [init] found model autostart file as SYS_AUTOSTART=6011
INFO  [param] selected parameter default file eeprom/parameters_6011
[param] parameter file not found, creating eeprom/parameters_6011
  SYS_AUTOCONFIG: curr: 0 -> new: 1
  SYS_AUTOSTART: curr: 0 -> new: 6011
  CAL_ACC0_ID: curr: 0 -> new: 1310988
  CAL_GYRO0_ID: curr: 0 -> new: 1310988
  CAL_ACC1_ID: curr: 0 -> new: 1310996
  CAL_GYRO1_ID: curr: 0 -> new: 1310996
  CAL_ACC2_ID: curr: 0 -> new: 1311004
  CAL_GYRO2_ID: curr: 0 -> new: 1311004
* CAL_MAG0_ID: curr: 0 -> new: 197388
* CAL_MAG1_ID: curr: 0 -> new: 197644
* SENS_BOARD_X_OFF: curr: 0.0000 -> new: 0.0000
* SENS_DPRES_OFF: curr: 0.0000 -> new: 0.0010
* SYS_AUTOCONFIG: curr: 1 -> new: 0
* IMU_INTEG_RATE: curr: 200 -> new: 250
INFO  [dataman] data manager file './dataman' size is 7866640 bytes
PX4 SIM HOST: localhost
INFO  [simulator] Waiting for simulator to accept connection on TCP port 4560
INFO  [simulator] Simulator connected on TCP port 4560.
INFO  [commander] LED: open /dev/led0 failed (22)
* PWM_AUX_OUT: curr: 0 -> new: 1234
* PWM_MAIN_OUT: curr: 0 -> new: 1234
INFO  [init] Mixer: etc/mixers/hexa_x.main.mix on /dev/pwm_output0
INFO  [init] setting PWM_AUX_OUT none
INFO  [mavlink] mode: Normal, data rate: 4000000 B/s on udp port 18570 remote port 14550
INFO  [mavlink] mode: Onboard, data rate: 4000000 B/s on udp port 14580 remote port 14540
INFO  [mavlink] mode: Onboard, data rate: 4000 B/s on udp port 14280 remote port 14030
INFO  [mavlink] mode: Gimbal, data rate: 400000 B/s on udp port 13030 remote port 13280
INFO  [mavlink] mode: Onboard, data rate: 4000 B/s on udp port 14558 remote port 14530
INFO  [logger] logger started (mode=all)
INFO  [logger] Start file log (type: full)
INFO  [logger] [logger] ./log/2023-07-26/18_52_18.ulg
INFO  [logger] Opened full log file: ./log/2023-07-26/18_52_18.ulg

Software Version

Stable Release v1.13.3

Flight controller

no controller

Vehicle type

Multicopter

How are the different components wired up (including port information)

No response

Additional context

No response

akontsevich commented 1 year ago

So if we copy config.txt to PX4-Autopilot/build/px4_sitl_default/etc/:

COPY ./config.txt /PX4-Autopilot/build/px4_sitl_default/etc/config.txt

then it has no effect.

And if we copy it to /PX4-Autopilot/build/px4_sitl_default/tmp/rootfs/etc/:

COPY ./config.txt /PX4-Autopilot/build/px4_sitl_default/tmp/rootfs/etc/config.txt

it seems taken into account, but we got other error:

SITL COMMAND: "/PX4-Autopilot/build/px4_sitl_default/bin/px4" -d "/PX4-Autopilot/build/px4_sitl_default"/etc -s etc/init.d-posix/rcS -t "/PX4-Autopilot"/test_data
ERROR [px4] Error opening startup file, does not exist: etc/init.d-posix/rcS

Any workarounds?