I am a newbie when it comes to Pixhawk, robotics and autopilots in general. The vehicle was built primarily to prove the accuracy of the custom GPS. I have a small skid steer vehicle and I want to have it navigate autonomously through a course consisting of 9 centimeter accurate markers. There is a custom GPS using UBlox M8P receiver on the vehicle that is connected a Pi4 8Gb on /dev/ttyACM0 and forwards GPS NMEA data to the Pixhawk via the UART on the Pi 4 using a simple Python script. The UART is wired to the GPS port as follows: GND to GND, TX to RX and RX to TX. The Pixhawk navigates the vehicle using a Python script through the Pi4 that controls the motors through a L298 N H bridge via a Telemetry link on TELEM2, TELEM1 has a telemetry radio connected to it. The Pixhawk saw the GPS and everything worked fine. I took the vehicle outside and started the Python script that uploads the file with the flight plan consisting of the way points the vehicle has to navigate to and loiter for 5 seconds when it reaches the way point so that I can capture an image of the marker in relation to the vehicle. The vehicle after uploading the way points turned towards the first way point on the list and started driving towards the way point. After driving a distance of about 5 meters the vehicle started driving in a circular fashion, it had lost the GPS signal. If I connect the GPS to my computer it provides valid position and NMEA data. The Pixhawk now refuses to see the GPS. When I go to serial setup under Setup the Pixhawk also gives the following message “trying to download uarts.txt from FC” I have looked at the SD card but there is no uarts.txt file anywhere on the SD card. The setup, parameters, wiring and everything else has been checked and is working. Where is the uarts.txt file and could it be recreated? Any other ideas or assistance will be greatly appreciated. Thank you
Can you provide a logfile from the sd card?
Not bad for a newbie!
I’ve also fed the GPS to Pixhawk via a serial port in a similar fashion - I was using RTKLib on the Pi to calculate the position before M8P and F9Ps were affordable - you could use an M8N with RTKLib.
One quick suggestion is to skip your Python sending NMEA and use the str2str utility from RTKLib to do it.
One advantage is the built in logging that confirms str2str is getting and sending the GPS data, and you can also expose the feed on a TCP port so you can easily monitor the feed from either RTKNavi or even U-Blox U-Center - without involving the Pixhawk at all
That would help confirm your GPS messages are still being sent to the Pixhawk even if the Pixhawk isn’t receiving - narrow down your problem solving boundaries.
Thank you
The Pixhawk was faulty and I purchased a new one, busy setting that up at the moment to test over the week end
Hi there
Thank you, appreciated. Interesting indeed.
How would I use str2str to forward the NMEA messages?
It sounds like that would solve my problem
It has been an uphill struggle never having used Pixhawk
I have just downloaded RTKLIB and will start having a look at it
Thank you again
Hi there
I have no idea where the log file is or how to access it
This is the first time using this kind of device
If you can tell me where to find it I will go look for it and send it to you
Thank you
str2str -in ntrip://yourntripserver.com:2101/MYNTRIPPOINT -out tcpsvr://:9010 -out serial://ttyACM0
No NTRIP?
str2str -in tcpcli://192.168.1.1:9001 -out serial://ttyACM0 1>/dev/null 2>&1
You’re pulling IN from either another STR2STR running on your fixed base, or from an NTRIP server.
You’re sending it OUT to your serial port. In this case, /dev/ttyACM0 for me.
Here’s my fixed base that natively sends out RTCM3.
I make it available on 9000 and 9001 (9001 is filtered for RTCM3 only, which at the moment 9000 probably is too by nature of the first param) - and I also send it to my NTRIP server.
str2str -in serial://ttyUSB0:115200#rtcm3 -t 1 -out tcpsvr://:9000 -out tcpsvr://:9001#rtcm3 -out ntrips://yourntripserver.com:2101/MYNTRIPPOINT 1>/dev/null 2>&1
I have this fire either from /etc/rc.local or from a systemd startup script.
To send NMEA - or really, anything - you can make it available with:
str2str -in serial://ttyUSB0 -out tcpsvr://:9000
Run that command.
Or set the baud rate if you’re using /dev/ttyS0 or similar.
str2str -in serial://ttyS0:57600 -out tcpsvr://:9000
If you get the right baud rate, you can then connect to your Pi on the “tcpsvr” port and watch the output.
i.e.
telnet 192.168.1.1 9000
You can also connect UBlox’s U-Center to it to watch the output.
As you see above in my examples, you can share it on multiple ports. You can also take IN data on one serial port and send it OUT on another, while exposing it on a TCP port so you can watch remotely.
It uses 2-3% of my pi4 CPU monitoring my fixed base at 115200, sending to my local NTRIP server.
Logging on str2str - if you run it from the command line, it’ll echo some statistics to the screen as it goes.
If you run it from cron, rc.local, etc it goes to syslogd. You’ll note my “1>/dev/null 2>&1” is to actually disable that logging from filling up the pi SD card.
But if you expose the traffic with the tcpsvr configuration, you can “watch” the raw data as it goes.
i.e. you can use another GPS program to monitor the traffic, and display the position and other data coming across, separate from the flight controller.
Handy to figure out if you’re sending the right kind of data in the right format.
Thank you
It is all a little Greek to me.
My setup is simple, the GPS is connected to /dev/ttyACM0 and the UART from the Pi is connected to the GPS port on the Pixhawk. GND to GND, TX to RX and RX to TX.
That is it
I want to forward the stream from /dev/ttyACM0 to /dev/serial0. The baud rate for /dev/ttyACM0 is 115200 and for /dev/serial0 57600
Logs are on the SD card
Is there any reason you can’t just connect the GPS module directly to the Pixhawk? Adding in the RPi fordwarding does make it more complex.
Thank you I will look for them, I have never used the logs
Presently I do not think they will be of any value as the vehicle has been static while I am trying to get it to work properly
Yes the GPS only has a USB connection.
The data is being forwarded using this command and I am getting a lot less errors
str2str -in serial://ttyACM0:115200 -out serial://serial0:57600str2str -in serial://ttyACM0:115200 -out serial://serial0:57600
Isn’t it possible to configure the GPS BAUD rate also to 57600?
In your case you need a large flexible ring buffer for the incoming message from the GPS as it comes with a higher Baudrate. If both serials ar on the same speed they are still not sync but the ring buffer can be relative small and you can transfer moreless bytewise your streams
Hi there Juergen
Thank you for your reply
I have changed the serial out baud rates to be the same and it is working fine
The problem appears to be the battery monitor despite the battery reporting the correct values.
I have a single 2Cell 2200 mah battery powering the Pixhawk.
It should arm but doesn’t
Soon as it arms I can test the vehicle
ArduRover V3.5.2 (16a1b5fc)
ChibiOS: 1ba712a2
fmuv2 004A0024 3036510F 31323731
Connected to Pixhawk
Uploading mission from waypoints.waypoints
Flight plan received
Mission uploaded successfully from waypoints file.
Home location set to: Lat -**., Lon **., Alt 0.0
Pre-arm checks disabled (except GPS).
Setting vehicle mode to: VehicleMode:GUIDED
Vehicle is not armable
Battery voltage: 8.32V
GPS Fix Type: 4
It is hard to say whats going wrong with out knowing your PARAMS.
Also don’t disable all Pre-arm checks as they can give some information.
And my be also a LOG-File with loging enabled all time also if not armed would also be helpful
Hall Juergen
Thank you for your assistance, my background is GPS systems and I have no or very little experience or knowledge when it comes to Pixhawk and similar devices.
I am using Firmware version 3.5.2, do you think it is fine?
I have no idea what to do with the logs, the vehicle has not driven yet and is static while I am trying to get it going. I can send you the logs if that will help
I can send you the parameter list if that would help
I set the battery monitor up with the specifications of the battery 2200mah, measured voltage 8,3, voltage pin = 3, current pin =2 and MULT = 10.1. When I exit and reenter Mission Planner the settings are missing.
The biggest problem I am facing at the moment is to get the Pixhawk to navigate the vehicle using the Pi which is connected to the motors via a L209NHbridge
I have no radio or radio control equipment connected at all.
The purpose of the exercise is just to prove the accuracy of the custom GPS for now
I would really appreciate any assistance I can get.
Maybe I must reconfigure the whole setup.
The wiring and all connections are fine and have been checked a thousand times.
The motors run perfectly when I test them with a Python script but there is no reaction when connected to the Pixhawk.
I can send you the Python script and what ever you require to assist me
Thank you in advance
Sincerely
Anton
Hello Anton,
best would be if you update first your FC to the actual stable firmware. I don’t know exactly but it is possible that the actual mission planner version you are using and the old FC firmware are not matching and therefore you have problems with parmeters.
Did you a reboot of the FC after setting parameters?
How you monitor the battery?
As said before upload the last PARAM file and a LOG file here.
Lots of missing information to help
Hello Juergen
The latest firmware does not communicate to the GPS or any GPS. I tried 2 GPS units, my own and a 3DR GPs. I am totally unsure which firmware to install. I have downloaded all the different versions I could find. If you could make a suggestion as to which version would be best I would appreciate it. Version 4.5 is communicating with the GPS and I have installed it.
I do reboot the FC after setting the parameters yes
The battery is a 2 cell 2200 mah Lipo that I monitor with the battery monitor.
2024-10-06 14-54-20.tlog (15.2 KB)
Hope this helps
Sorry I know very little about Pixhawks. I specialize in GPS devices
20240909.param (15.0 KB)
Hello Anton
I am a little confused now. You said before
now you said
So if you are running 4.5 it is fine to me
Your PARAM shows no battery monitor enabled.
The log you send is only the “Telemetrie Log”. I am looking more for the “DataFlash log” which is also on your SD-card. (ending with “.log” not with “.tlog”.
To get also a .log with pre-arm information the parameter “LOG_DISARMED” on Full Parameter List hast to be set to “1”. But this can create rather great files so let the FC only run for a few minutes.
And another the question how you physically measure the battery voltage and current with the system?
Hi Juergen
The Pixhawk froze up this morning and I battled the whole day to get it working again I loaded firmware after firmware version to the highest that would communicate with the GPS which was 4.5.0 and then I reconfigured the thing from scratch.
I have a little device that connects to the 3 pin connector that give me the voltage. I have not measured the current at all. The battery fully charged reads 8,38 Volt
This is the latest configuration file
I only have these .log files that you are looking for?
2024-10-06 18-11-28.tlog (350.4 KB)
parameters450rover.param (14.1 KB)
Thank you
Sorry I see it is a .tlog file
I looked on the SD card, there are no .log files. I only have the files on my hard drive as the one I sent you