GPS not working
-
@Eric-Katzfey said in GPS not working:
@andremoura Is the LED on top of the unit (multicolor LED) coming on?
Yes, every time
voxl-px4
is running. -
@andremoura Okay, good. Holybro changed some of the components in their unit at one point and if that LED wasn't coming on it could indicate that it was one of the older units. But since it is on that indicates to me that it is the correct version of the Holybro unit.
-
@Eric-Katzfey Ok, new find! It seems that when
voxl-px4
runs, the GPS service isn't able to start immediately, but if we wait a for a bit and start it manually, it works.Seems like something isn't ready to start immediately after
voxl-px4
. -
@andremoura Interesting! Okay, how do you accomplish that? Do you mean you are stopping the service and then starting voxl-px4 later manually or you are leaving voxl-px4 service enabled but commenting out the gps start line in
/etc/modalai/voxl-px4.config
? -
@Eric-Katzfey We are stopping the GPS service manually (
qshell gps stop
) and then starting it later manually (qshell gps start
), not thevoxl-px4
.Do you want us to do the same test with commenting the gps start line in
/etc/modalai/voxl-px4.config
? -
@andremoura Actually, can you try removing the
-d 7 -b 115200
from the gps start line in/etc/modalai/voxl-px4.config
and see if that changes anything? Thanks for trying all this stuff out! -
@Eric-Katzfey Hello, today I tested removing
-d 7 -b 115200
from/etc/modalai/voxl-px4.config
and it seems like the GPS service is working correctly on startup. I'm still going to test if I can get more fixed satellites and GPS lock on a new location with more open space and then get back to this post with more information. -
@Eric-Katzfey On the new location, we were able to get GPS lock after fixing 12 satellites, which allowed for take-off. During flight we reached 19 satellites at one point. Getting GPS lock with this sensor is a bit challenging, our previous location didn't have that many obstructions, but everything seems to be working.
-
@Andre-Moura Thanks for all of the testing! We really appreciate it, this is all great feedback! It seems that Holybro may have changed the default configuration of the units and that could be why it wasn't coming up properly.
-
@Andre-Moura We have same issue here but we try to remove -d 7 -b 115200 from /etc/modalai/voxl-px4.config is still not working. Did you modify thr code like this?
Removing the 115200 baud rate is still not see GPS log.
-
@daniel I think that's all I did, but here is my
/etc/modalai/voxl-px4.config
, in case you want to look for any differences:#!/bin/sh # PX4 commands need the 'px4-' prefix in bash. # (px4-alias.sh is expected to be in the PATH) . px4-alias.sh # Figure out what platform we are running on. # Eventually there will be a utility called voxl-platform that will # return the platform tag or an error code. This utility is not yet # ubiquitous so it may be that it isn't available. Trying to call a # non existent program will generate an error code by the OS. If the # program exists and doesn't return an error code then use the results. PLATFORM=`/usr/bin/voxl-platform 2> /dev/null` RETURNCODE=$? if [ $RETURNCODE -ne 0 ]; then # If we couldn't get the platform from the voxl-platform utility then check # /etc/version to see if there is an M0052 substring in the version string. If so, # then we assume that we are on M0052. Otherwise assume M0054. VERSIONSTRING=$(</etc/version) M0052SUBSTRING="M0052" if [[ "$VERSIONSTRING" == *"$M0052SUBSTRING"* ]]; then PLATFORM="M0052" else PLATFORM="M0054" fi fi # We can only run on M0052 or M0054 so exit with error if that is not the case if [ $PLATFORM = "M0052" ]; then /bin/echo "Running on M0052" if [ "$RC" == "CRSF" ]; then /bin/echo "Error, crossfire not supported on M0052!" exit 0 fi elif [ $PLATFORM = "M0054" ]; then /bin/echo "Running on M0054" else /bin/echo "Error, cannot determine platform!" exit 0 fi uorb start muorb start # In order to just exit after starting the uorb / muorb modules define # the environment variable MINIMAL_PX4. (e.g. export MINIMAL_PX4=1) # This is useful for testing / debug where you may want to start drivers # and modules manually from the px4 command shell if [ ! -z $MINIMAL_PX4 ]; then /bin/echo "Running minimal script" exit 0 fi # Sleep a little here. A lot happens when the uorb and muorb start # and we need to make sure that it all completes successfully to avoid # any possible race conditions. /bin/sleep 1 # IMU (accelerometer / gyroscope) # Start this first because it gets the high rate interrupts coming in to the # DSP. Without this the DSP will oversleep and miss critical timeouts. # TODO: Why is that the case? if [ "$IMU" == "ROTATE_IMU_YAW_180" ]; then /bin/echo "Starting IMU driver with yaw 180 rotation" qshell icm42688p start -s -R 4 else qshell icm42688p start -s fi /bin/sleep 1 # Load in all of the parameters that have been saved in the file param load # Start logging and use timestamps for log files when possible. # Add the "-e" option to start logging immediately. Default is # to log only when armed logger start -t # We do not change the value of SYS_AUTOCONFIG but if it does not # show up as used then it is not reported to QGC and we get a # missing parameter error. param touch SYS_AUTOCONFIG # Start all of the device drivers on DSP # Magnetometer if [ "$GPS" == "MATEK" ]; then # Use this line for the magnetometer in the Matek Systems M8Q-5883 module /bin/echo "Starting Mateksys M8Q-5883 magnetometer" qshell qmc5883l start -R 10 -X -b 1 elif [ "$GPS" == "HERE3" ]; then # Use this line for the magnetometer in the Here3 GPS module /bin/echo "Starting Here3 ak09916 magnetometer" qshell ak09916 start -R 2 -X else # Use this line for the magnetometer in the Holybro GPS module /bin/echo "Starting Holybro magnetometer" qshell ist8310 start -R 10 -X -b 1 fi # LED driver for the Pixhawk 4 GPS module # Older units have i2c address 0x39 (57) and newer ones 0x38 (56) # M0054 only supports the newer one. M0052 can support either. if [ $PLATFORM = "M0052" ]; then qshell rgbled_ncp5623c start -X -b 1 -f 400 -a 57 fi if [ "$GPS" == "HOLYBRO" ]; then /bin/echo "Starting Holybro LED driver" qshell rgbled_ncp5623c start -X -b 1 -f 400 -a 56 elif [ "$GPS" == "HERE3" ]; then # Use this line for the Here3 GPS module LED controller /bin/echo "Starting Here3 LED" qshell rgbled start -X -f 400 fi # Barometer qshell icp10100 start -I -b 5 # ESC driver # We start this even if there is a PX4IO module. If there is # a PX4IO (M0065) module it will be plugged into the RC port # and so this driver will output commands on an empty port. qshell modalai_esc start qshell mixer load /dev/uart_esc quad_x.main.mix # APM power monitor qshell voxlpm start -X -b 2 # On M0052 the GPS and RC drivers run on the apps processor if [ $PLATFORM = "M0052" ]; then # Pixhawk 4 GPS module gps start -d /dev/ttyHS2 # RC input may be coming via either an external M0065 (aka px4io) module # or a directly attached Spektrum receiver. First see if the M0065 is detected. px4io detect PX4IO_STATUS=$? /bin/echo "PX4IO detect returned value $PX4IO_STATUS" if [ $PX4IO_STATUS -eq 0 ]; then /bin/echo "Found M0065, starting px4io" # On M0052 px4io only supports RC input, not PWM output px4io start else /bin/echo "M0065 not detected, starting Spektrum RC driver" spektrum_rc start -d /dev/ttyHS1 fi # On M0054 the GPS and RC drivers run on SLPI DSP else if [ "$GPS" == "MATEK" ]; then # Use this gps start line instead for Matek Systems M8Q-5883 module /bin/echo "Starting Mateksys M8Q-5883 GPS" qshell gps start elif [ "$GPS" == "HERE3" ]; then # Use this line for the Here3 GPS module /bin/echo "Starting Here3 GPS" qshell gps start else # Only the newer Holybro unit is supported on M0054 /bin/echo "Starting Holybro GPS" qshell gps start fi # If RC is TBS Crossfire then start its driver. # Otherwise, it could be either a directly connected Spektrum receiver # or an external M0065 (aka px4io) module. if [ "$RC" == "CRSF_MAV" ]; then /bin/echo "Starting TBS crossfire RC - MAV Mode" qshell tbs_crossfire start -m -p 7 -b 115200 elif [ "$RC" == "CRSF_RAW" ]; then /bin/echo "Starting TBS crossfire RC - CRSF Mode" qshell tbs_crossfire start -c -p 7 -b 250000 else qshell px4io detect PX4IO_STATUS=$? if [ $PX4IO_STATUS -eq 0 ]; then /bin/echo "Found M0065, starting px4io" # On M0054 we also support PWM output from M0065 (aka PX4IO) # If there are no pwm escs then that connector will be empty. qshell px4io start qshell px4io recovery qshell mixer load /dev/px4io quad_x_io.main.mix sleep 1 qshell pwm rate -c 1234 -r 400 qshell pwm disarmed -c 1234 -p 900 qshell pwm min -c 1234 -p 1060 qshell pwm max -c 1234 -p 2000 qshell pwm failsafe -c 1234 -p -1 -d /dev/px4io else /bin/echo "M0065 not detected, starting Spektrum RC driver" qshell spektrum_rc start -d 8 fi fi fi /bin/sleep 1 # Start all of the processing modules on DSP qshell sensors start qshell ekf2 start qshell mc_pos_control start qshell mc_att_control start qshell mc_rate_control start qshell mc_hover_thrust_estimator start qshell land_detector start multicopter /bin/sleep 1 # Start all of the processing modules on the applications processor rc_update start dataman start navigator start commander start commander mode manual # This is needed for altitude and position hold modes flight_mode_manager start # Start our service to update system time from GPS modalai_gps_timer start # As of 1.4.11 mavlink configuration has been changed!!! All communications are # now done via the mavlink server and voxl-vision-px4!!! param set MAV_BROADCAST 0 if [ "$RC" == "CRSF_MAV" ]; then # Slow everything way down if we are using TBS Crossfire mavlink start -a -x -u 14556 -o 14557 -r 10000 -n lo -m minimal /bin/sleep 1 else mavlink start -x -u 14556 -o 14557 -r 100000 -n lo -m onboard /bin/sleep 1 # slow down some of the fastest streams in onboard mode mavlink stream -u 14556 -s HIGHRES_IMU -r 10 mavlink stream -u 14556 -s ATTITUDE -r 10 mavlink stream -u 14556 -s ATTITUDE_QUATERNION -r 10 # speed up rc_channels mavlink stream -u 14556 -s RC_CHANNELS -r 50 /bin/sleep 1 fi if [ $PLATFORM = "M0052" ]; then # Start up the IMU server to support VIO. This is done differently on M0054 imu_server start fi mavlink boot_complete # For now we use a mavlink bridge for TBS Crossfire support if [ "$RC" == "CRSF_MAV" ]; then mavlink_bridge start fi # Optional MSP OSD driver for DJI goggles # This is only supported on M0054 (with M0125 accessory board) if [ $PLATFORM = "M0054" ]; then if [ "$OSD" == "OSD" ]; then /bin/echo "Starting OSD driver" msp_osd start -d /dev/ttyHS1 fi fi
If your config is like this and it still doesn't work, maybe @Eric-Katzfey can help you better.
-
@Andre-Moura Thank You! We fixed our GPS setting problem.
-
@daniel what ended up being your fix? I was seeing the same issues yesterday with our Sentinel trying to do GPS only outdoor flights. It wouldn't ARM due to the GPS Speed Accuracy. Flashing blue for a minute or two and then turning green after what i assumed was VIO getting healthy.
@Eric-Katzfey I don't want to use the Sentinel VIO so was hoping there was a GPS Only No VIO params file. It seems like the one posted on the git is still looking at VIO.
-
you will likely want to configure px4 params to suit your exact use case, e.g. some people will want it to arm without a gps lock, some won't. As a starting point we have "helper" files that can be loaded through QGC that set up the handful of relevant PX4 params for indoor vs outdoor flight
Here is the outdoor helper for px4 1.12:
https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-px4-params/-/blob/master/params/v1.12/ekf2_outdoor_gps_mag.paramsAnd the helpers for PX4 1.14:
https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-px4-params/-/tree/master/params/v1.14/EKF2_helpers -
@James-Strawson Awesome, thanks I am going to load the outdoor params. Just didn't know if someone had already blessed us all with a known good config.
-
@James-Strawson If i stop and disable the VIO server will that still allow GPS to pass through? I am getting good satellite and HDOP but the GPS never transitions from flashing blue to green with the ekf2_outdoor_gps_baro params. it is causing the platform to not allow me to put it in POSCTL. I do not intend to do GPS denied flights at this time and am trying to focus on outdoor 5G flights for a while to build confidence in our GCS software interactions with VOXL.
-
@JustinDev23 These parameter settings won't affect the ability of the GPS receiver to get a lock. It is an independent unit and not affected by VIO in any way.
-
@Eric-Katzfey, thanks for the response and clarifying.
I had a 3D Fix but wasnt able to switch from Manual to Position. I have worked on other projects with Ardupilot mission planner and it could blend or use best from different sources. I wasnt sure exactly how your implementation of GPS and VIO were working together on feeding positional data to the PX4 autopilot.
-
@JustinDev23 You can have GPS fix and not have GPS lock on the PX4. Have you checked the number of satellites on QGC? From my experience, GPS lock (required to switch to Position mode) is achieved with 12 satellites or more.
Maybe test the drone on a new location with more open space, that did the trick for me. -
@Andre-Moura sat and hdop have not been an issue on QGC. ekf2_req_nsats is set to 6 and i have had no obstructions and in open space.
GPS Horizontal Pos Error too high with 9 sats and 1.4 hdop