KumarRobotics / ublox

A driver for ublox gps
BSD 3-Clause "New" or "Revised" License
440 stars 386 forks source link

Could not configure serial baud rate #32

Open new-in-ros opened 6 years ago

new-in-ros commented 6 years ago

Hello, sometimes I get an error, if I want to connect the rover with my Rasperry Pi. The base and the rover are connected to difference Raspberry Pi. I can start the base without an error. But if I start the rover launch file, it works just every third time.

robot@igel01:~/catkin_ws/src/ublox/ublox_gps/config$ roslaunch ublox_gps ublox_device.launch node_name:=rover param_file_name:=c94_m8p_rover ... logging to /home/robot/.ros/log/bb634996-58d2-11e8-a299-b827eb0b48c0/roslaunch-igel01-5419.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://igel01:35856/

SUMMARY

CLEAR PARAMETERS

PARAMETERS

NODES / rover (ublox_gps/ublox_gps)

ROS_MASTER_URI=http://localhost:11311

process[rover-1]: started with pid [5438] [ INFO] [1526454535.202589825]: U-Blox: Opened serial port /dev/ttyACM0 [DEBUG] [1526454535.203817069]: Configuring UART1 baud rate: 19200, In/Out Protocol: 32 / 0 terminate called after throwing an instance of 'std::runtime_error' what(): Could not configure serial baud rate [rover-1] process has died [pid 5438, exit code -6, cmd /home/robot/catkin_ws/devel/lib/ublox_gps/ublox_gps name:=rover log:=/home/robot/.ros/log/bb634996-58d2-11e8-a299-b827eb0b48c0/rover-1.log]. log file: /home/robot/.ros/log/bb634996-58d2-11e8-a299-b827eb0b48c0/rover-1*.log

p-ansatz commented 6 years ago

Hi! I get the same error with this configuration parameters:

PARAMETERS

I'm using http://ardupilot.org/copter/docs/common-installing-3dr-ublox-gps-compass-module.html connected via USB to Raspberry PI; the u-blox model is: LEA 6H.

kartikmohta commented 6 years ago

Can you put some debug messages before the line https://github.com/KumarRobotics/ublox/blob/694268c3b42434eb9a9102eaaa17f57bc444a310/ublox_gps/src/gps.cpp#L157 to see which condition in the if statement is failing?

MrBanannaMan commented 6 years ago

Hello, I am stuck with the exact same issue unfortunately. I put some debug messages in gps.cpp to indicate which condition may be failing, here are the results:

NODES / ublox_gps (ublox_gps/ublox_gps)

auto-starting new master process[master]: started with pid [5459] ROS_MASTER_URI=http://localhost:11311

setting /run_id to 310c1418-6e52-11e8-9ef4-00044b8d23cf process[rosout-1]: started with pid [5472] started core service [/rosout] process[ublox_gps-2]: started with pid [5490] [ INFO] [1528815993.545636866]: U-Blox: Opened serial port /dev/ttyACM0 [DEBUG] [1528815993.546132785]: Configuration State: 0 [DEBUG] [1528815993.546186354]: Current Baudrate: 9600 [DEBUG] [1528815993.546222835]: Argument Baudrate: 9600 [DEBUG] [1528815993.546263061]: Configuring UART1 baud rate: 9600, In/Out Protocol: 7 / 1 terminate called after throwing an instance of 'std::runtime_error' what(): Could not configure serial baud rate [ublox_gps-2] process has died [pid 5490, exit code -6, cmd /home/nvidia/catkin_ws/devel/lib/ublox_gps/ublox_gps __name:=ublox_gps __log:=/home/nvidia/.ros/log/310c1418-6e52-11e8-9ef4-00044b8d23cf/ublox_gps-2.log]. log file: /home/nvidia/.ros/log/310c1418-6e52-11e8-9ef4-00044b8d23cf/ublox_gps-2*.log

Where, Configuration State = configured_ Current Baudrate = current_baudrate.value() Argument Baudrate = baudrate I am using the default configuration parameters for debug purposes

MrBanannaMan commented 6 years ago

I'd like to note that I was able to fix this issue by using /dev/ttyACM1 (I forgot that I had another sensor attached to /dev/ttyACM0) and most importantly I am using the M8T timing device which is not currently supported by this repo. I was able to find and successfully use this user's repo: https://github.com/flynneva/ublox which supports M8T devices

aviogit commented 6 years ago

I'm also facing this issue:

SUMMARY

CLEAR PARAMETERS

PARAMETERS

NODES / drotek_ublox_m8n_and_compass (ublox_gps/ublox_gps)

ROS_MASTER_URI=http://localhost:11311

process[drotek_ublox_m8n_and_compass-1]: started with pid [5866] log4cxx: Could not read configuration file [/mnt/data/workspace/ros/rosconsole.config]. [ INFO] [1537454500.185254699]: U-Blox: Opened serial port /dev/ttyUSB0 [DEBUG] [1537454500.186333861]: Configuring UART1 baud rate: 9600, In/Out Protocol: 7 / 1 terminate called after throwing an instance of 'std::runtime_error' what(): Could not configure serial baud rate

Timple commented 6 years ago

I can workaround this issue with a powercycle and a very minimalistic config file. The node respawns a couple of times but then comes into a running state: https://pastebin.com/DthC6tvL

neo_m8p_base.yaml

debug: 3
device: /dev/ttyUSB0
tmode3: 0
aviogit commented 6 years ago

Totally agree with you, this has been my solution as well:

#> cat ~/script/usb-power-cut-raspberry-pi-3.sh 
#/bin/bash

ID=`id -u`

if [ $ID -ne 0 ]
then
    echo "You must be root to run this script. Exiting..."
    exit 1
fi

echo 0 > /sys/devices/platform/soc/3f980000.usb/buspower
sleep 5
echo 1 > /sys/devices/platform/soc/3f980000.usb/buspower

exit 0

And the behavior is the same, a few unhandled U-Blox ASIO input buffer read error: Operation canceled, 0, a few respawns and eventually the node runs quite deterministically. At the end of the story, this node is usable and the information it gives is valuable. Thanks to its creators!

Timple commented 6 years ago

Did you also find a way to set UART1 settings?

I need the chip to report RTCM messages. So

uart1:
  out: 32 # RTCM 3

But every uart1 setting fails on setting baudrate. (Which I am not trying to change actually)

aviogit commented 6 years ago

Actually no, and I also made a few modifications to make it "more tolerant" with the hardware (or itself, I don't know precisely who is the culprit of all these errors). So I don't know if UART1 is actually configured with 7/1 In/Out (what are these, bits?) and used at all. My output is currently this one:

[DEBUG] [1537781641.996569510]: Configuring UART1 baud rate: 9600, In/Out Protocol: 7 / 1
[ERROR] [1537781642.055959744]: Could not configure serial baud rate, trying to go on anyway...
[DEBUG] [1537781642.354757889]: EXT CORE 3.01 (107900), HW VER: 00080000
[DEBUG] [1537781642.354918149]: ROM BASE 3.01 (107888)
[DEBUG] [1537781642.355113774]: FWVER=SPG 3.01
[DEBUG] [1537781642.355199555]: PROTVER=18.00
[DEBUG] [1537781642.355299398]: MOD=NEO-M8N-0
[DEBUG] [1537781642.355387471]: FIS=0xEF4015 (100111)
[DEBUG] [1537781642.355487002]: GPS;GLO;GAL;BDS
[DEBUG] [1537781642.355561689]: SBAS;IMES;QZSS
[ INFO] [1537781642.355774605]: U-Blox Firmware Version: 8
[DEBUG] [1537781642.860813940]: Configuring measurement rate to 250 and nav rate to 1
[DEBUG] [1537781642.899638977]: Configuring SBAS: usage 0, max_sbas 0
[DEBUG] [1537781642.940639476]: Disabling PPP
[FATAL] [1537781643.001157676]: Error configuring u-blox: Failed to disable PPP.
[DEBUG] [1537781643.001426946]: Configuring measurement rate to 250 and nav rate to 1
[DEBUG] [1537781643.044075461]: Configuring SBAS: usage 0, max_sbas 0
[DEBUG] [1537781643.086330279]: Disabling PPP
[DEBUG] [1537781643.154911683]: Setting dynamic model to 0
[DEBUG] [1537781643.224793500]: Setting fix mode to 3
[DEBUG] [1537781643.293313394]: Setting DR Limit to 1
[DEBUG] [1537781643.464708805]: Read GNSS config.
[DEBUG] [1537781643.465151928]: Num. tracking channels in hardware: 32
[DEBUG] [1537781643.465524896]: Num. tracking channels to use: 32
[DEBUG] [1537781643.465911614]: QZSS Configuration is different 1, 0
[DEBUG] [1537781643.466273592]: QZSS Configuration: 83951617
[DEBUG] [1537781643.466615049]: QZSS Configuration: 83951616
[DEBUG] [1537781643.466999683]: Re-configuring GNSS.
[ WARN] [1537781643.474294504]: GNSS re-configured, cold resetting device.
[ WARN] [1537781643.474763097]: Resetting u-blox. If device address changes, node must be relaunched.
[ERROR] [1537781644.532057662]: U-Blox ASIO input buffer read error: Operation canceled, 0
[ INFO] [1537781659.544523027]: U-Blox: Reset serial port /dev/ttyUSB0
[DEBUG] [1537781659.604801642]: Saving the u-blox configuration, mask 3103, device 4
[ INFO] [1537781659.646546565]: U-Blox configured successfully.
[DEBUG] [1537781659.646727398]: Subscribing to U-Blox messages
[DEBUG] [1537781661.000221904]: Configuring INF messages
[ERROR] [1537781661.068905285]: U-blox: received NACK: 0x06 / 0x01

BTW, my Drotek GPS should also have a compass in it and it would be nice to find it and use it, but I think I have no chance to complete this task with the limited amount of time I have to work on this now.

trixr4kdz commented 5 years ago

Hello, I am having the same problem after killing my node and then re-launching it again. It seems like the device isn't properly released by the node because I don't see a "Closed connection to " ROS_INFO that's supposed to be logged after calling shutdown() in node.cpp.

EDIT: I have the ublox m8n running on ROS Kinetic/Ubuntu 16.04

r7vme commented 5 years ago

There is also param <param name="config_on_startup" value="false"/> , which allows to skip configuration. This allows node to start from first try, but i seems uses default config (from device), which is not the case for many people.

darshb34 commented 4 years ago

Solved it by changing the baud rate in the yaml file to 115200.

It means something like instead of trying all the baud rate which the launch automatically does we have to put the right baud rate which was set before using U center.

So basically I set a baud rate on the m8t using u center and then put that particular baud rate into the yaml file.

KrabasChuliganas commented 4 years ago

I have also same an issue with a Ublox m8n gps on ros. It always gives me error: what(): Could not configure serial baud. I double checked port and baud rate. Did you guys find out a solution to this problem? If so, can you share config file?

EDIT: just use http://wiki.ros.org/nmea_navsat_driver. It works with ublox m8n

Farhan996 commented 3 years ago

Changing the baud rate in yaml file is not helping. Has anyone found any solution?

PanKarfa commented 1 year ago

I would get similar behaviour with this package, a Ublox ZED F9R for the simplest case that the USB cable was connected on the POWER+XBEE interface instead of the POWER+GPS. By the way the interface for GPS should be /dev/ttyACM0 and not /dev/ttyUSB0 as in my case was for Xbee. This can vary depending on the Ublox module of course.

rugvedAnfanger commented 10 months ago

Solved it by changing the baud rate in the yaml file to 115200.

It means something like instead of trying all the baud rate which the launch automatically does we have to put the right baud rate which was set before using U center.

So basically I set a baud rate on the m8t using u center and then put that particular baud rate into the yaml file.

I set it to 38400 using u center and also in the .yaml. My device is ZED F9P. It still doesn't work. Has anyone found a fix?

NehalNevle commented 10 months ago

I am facing the same

chrissunny94 commented 7 months ago

I have two ublox devices one is working and the other not .(C100 F9K)

WORKING ON LOG

[ublox_gps_node-1] [INFO] [1708510514.215307805] [ublox_gps_node]: U-Blox: Opened serial port /dev/ttyACM0
[ublox_gps_node-1] [DEBUG] [1708510514.716463636] [ublox_gps_node]: U-Blox: Set ASIO baudrate to 9600
[ublox_gps_node-1] [DEBUG] [1708510515.216869716] [ublox_gps_node]: U-Blox: Set ASIO baudrate to 19200
[ublox_gps_node-1] [DEBUG] [1708510515.216974237] [ublox_gps_node]: Configuring UART1 baud rate: 19200, In/Out Protocol: 32 / 0
[ublox_gps_node-1] [INFO] [1708510515.219213117] [ublox_gps_node]: EXT CORE 1.00 (344bdb), HW VER: 00190000
[ublox_gps_node-1] [DEBUG] [1708510515.219312719] [ublox_gps_node]: ROM BASE 0x118B2060
[ublox_gps_node-1] [DEBUG] [1708510515.219355317] [ublox_gps_node]: FWVER=LAP 1.01
[ublox_gps_node-1] [DEBUG] [1708510515.219374314] [ublox_gps_node]: PROTVER=30.00
[ublox_gps_node-1] [DEBUG] [1708510515.219391124] [ublox_gps_node]: MOD=ZED-F9K
[ublox_gps_node-1] [DEBUG] [1708510515.219408183] [ublox_gps_node]: GPS;GLO;GAL;BDS
[ublox_gps_node-1] [DEBUG] [1708510515.219425404] [ublox_gps_node]: QZSS
[ublox_gps_node-1] [INFO] [1708510515.227610110] [ublox_gps_node]: U-Blox Firmware Version: 9
[ublox_gps_node-1] [WARN] [1708510515.227726438] [ublox_gps_node]: Product category LAP  from MonVER message not recognized options are HPG REF, HPG ROV, HPG #.#, TIM, ADR, UDR, FTS, HPS
[ublox_gps_node-1] [DEBUG] [1708510515.228513224] [ublox_gps_node]: Configuring measurement rate to 250 ms and nav rate to 4 cycles
[ublox_gps_node-1] [DEBUG] [1708510515.229064045] [ublox_gps_node]: Disabling PPP
[ublox_gps_node-1] [DEBUG] [1708510515.229535504] [ublox_gps_node]: Setting dynamic model to 7
[ublox_gps_node-1] [DEBUG] [1708510515.229996858] [ublox_gps_node]: Setting fix mode to 3
[ublox_gps_node-1] [DEBUG] [1708510515.230356829] [ublox_gps_node]: Setting DR Limit to 0
[ublox_gps_node-1] [DEBUG] [1708510515.231525266] [ublox_gps_node]: Read GNSS config.
[ublox_gps_node-1] [DEBUG] [1708510515.231555806] [ublox_gps_node]: Num. tracking channels in hardware: 60
[ublox_gps_node-1] [DEBUG] [1708510515.231571840] [ublox_gps_node]: Num. tracking channels to use: 60
[ublox_gps_node-1] [DEBUG] [1708510515.231726613] [ublox_gps_node]: Ready to configure
[ublox_gps_node-1] [DEBUG] [1708510515.231814492] [ublox_gps_node]: Saving the u-blox configuration, mask 3103, device 4
[ublox_gps_node-1] [ERROR] [1708510515.232315880] [ublox_gps_node]: U-blox: received NACK: 0x06 / 0x8a
[ublox_gps_node-1] [INFO] [1708510515.232461509] [ublox_gps_node]: U-Blox configured successfully.
[ublox_gps_node-1] [DEBUG] [1708510515.232488040] [ublox_gps_node]: Subscribing to U-Blox messages
[ublox_gps_node-1] [ERROR] [1708510515.238003086] [ublox_gps_node]: U-blox: received NACK: 0x06 / 0x01
[ublox_gps_node-1] [ERROR] [1708510515.238355262] [ublox_gps_node]: U-blox: received NACK: 0x06 / 0x01
[ublox_gps_node-1] [DEBUG] [1708510515.242442013] [ublox_gps_node]: Configuring INF messages
[ublox_gps_node-1] [ERROR] [1708510515.917064340] [ublox_gps_node]: INF: txbuf alloc

NON-WORKING ONE

[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [ublox_gps_node-1]: process started with pid [2541730]
[ublox_gps_node-1] [INFO] [1708510588.003342509] [ublox_gps_node]: U-Blox: Opened serial port /dev/ttyACM0
[ublox_gps_node-1] [DEBUG] [1708510588.504495758] [ublox_gps_node]: U-Blox: Set ASIO baudrate to 9600
[ublox_gps_node-1] [DEBUG] [1708510589.004938621] [ublox_gps_node]: U-Blox: Set ASIO baudrate to 19200
[ublox_gps_node-1] [DEBUG] [1708510589.005043414] [ublox_gps_node]: Configuring UART1 baud rate: 19200, In/Out Protocol: 32 / 0
[ublox_gps_node-1] [INFO] [1708510589.007285125] [ublox_gps_node]: EXT CORE 1.00 (71c984), HW VER: 00190000
[ublox_gps_node-1] [DEBUG] [1708510589.007380503] [ublox_gps_node]: ROM BASE 0x118B2060
[ublox_gps_node-1] [DEBUG] [1708510589.007421434] [ublox_gps_node]: FWVER=LAPL1L2L5 1.30
[ublox_gps_node-1] [DEBUG] [1708510589.007439273] [ublox_gps_node]: PROTVER=30.30
[ublox_gps_node-1] [DEBUG] [1708510589.007457118] [ublox_gps_node]: MOD=ZED-F9K
[ublox_gps_node-1] [DEBUG] [1708510589.007473019] [ublox_gps_node]: GPS;GLO;GAL;BDS
[ublox_gps_node-1] [DEBUG] [1708510589.007489504] [ublox_gps_node]: SBAS;QZSS
[ublox_gps_node-1] [INFO] [1708510589.015599795] [ublox_gps_node]: U-Blox Firmware Version: 9
[ublox_gps_node-1] [WARN] [1708510589.015716225] [ublox_gps_node]: Product category LAP 5 1.30 from MonVER message not recognized options are HPG REF, HPG ROV, HPG #.#, TIM, ADR, UDR, FTS, HPS
[ublox_gps_node-1] [DEBUG] [1708510589.016473335] [ublox_gps_node]: Configuring measurement rate to 250 ms and nav rate to 4 cycles
[ublox_gps_node-1] [ERROR] [1708510589.016986399] [ublox_gps_node]: U-blox: received NACK: 0x06 / 0x08
[ublox_gps_node-1] [FATAL] [1708510589.017325851] [ublox_gps_node]: Error configuring u-blox: Failed to set measurement rate to 250ms and navigation rate to 4
Bmoradi93 commented 6 months ago

Use U-Center app and see what baud rate is being used. Then set the same baud rate in your .yaml file.

In my case:

debug: 1

device: /dev/ttyUSB0 frame_id: gps

uart1: baudrate: 230400

publish: all: true nav: all: true relposned: true posllh: true posecef: true