Giter VIP home page Giter VIP logo

Comments (14)

KLelkov avatar KLelkov commented on May 29, 2024 1

I had this one with NEO-M8P:
U-Blox ASIO input buffer read error: End of file, 0

Solved it by changing lines 419-421 in node.cpp to
if (false) {
gps.configUsb(usb_tx_, usb_in_, usb_out_);
}

It seems like my node was trying to connect to the device by uart and usb simultaneously. And it was failing since I didn't specify any usb connection parameters in the config file.
Anyway, this is how I fixed it.

P.S.
If it doesn't help - you may also try to remove the corresponding lines in gps.configUsb() function itself. It is located in gps.cpp.

from ublox.

kartikmohta avatar kartikmohta commented on May 29, 2024

Try adding the following block on line 118 (i.e. after the serial port is opened) in ublox_gps/src/gps.cpp:

{
  // Wait for at least one char on serial port before returning from read.
  // Sadly Boost doesn't provide any way to set this.
  int fd = serial_port->native_handle();
  struct termios tio;
  tcgetattr(fd, &tio);
  tio.c_cc[VTIME] = 0;
  tio.c_cc[VMIN] = 1;
  tcflush(fd, TCIFLUSH);
  tcsetattr(fd, TCSANOW, &tio);
}

from ublox.

innavalieva avatar innavalieva commented on May 29, 2024

Thank you for your suggestion Kartik!
I have added the block on line 118 in ublox_gps/src/gps.cpp as you suggestaed:

` // open serial port
try {
serial->open(port);
} catch (std::runtime_error& e) {
throw std::runtime_error("U-Blox: Could not open serial port :"
+ port + " " + e.what());
}

ROS_INFO("U-Blox: Opened serial port %s", port.c_str());

//ADDED ON LINE 118 TO FIX ASIO input problem
{
// Wait for at least one char on serial port before returning from read.
// Sadly Boost doesn't provide any way to set this.
int fd = serial_port->native_handle();
struct termios tio;
tcgetattr(fd, &tio);
tio.c_cc[VTIME] = 0;
tio.c_cc[VMIN] = 1;
tcflush(fd, TCIFLUSH);
tcsetattr(fd, TCSANOW, &tio);
}
// End of added ON LINE 118 TO FIX ASIO input problem

// Set the I/O worker
if (worker_) return;
setWorker(boost::shared_ptr(
new AsyncWorkerboost::asio::serial_port(serial, io_service)));

` // open serial port
try {
serial->open(port);
} catch (std::runtime_error& e) {
throw std::runtime_error("U-Blox: Could not open serial port :"
+ port + " " + e.what());
}

ROS_INFO("U-Blox: Opened serial port %s", port.c_str());
//ADDED ON LINE 118 TO FIX ASIO input problem
{
// Wait for at least one char on serial port before returning from read.
// Sadly Boost doesn't provide any way to set this.
int fd = serial_port->native_handle();
struct termios tio;
tcgetattr(fd, &tio);
tio.c_cc[VTIME] = 0;
tio.c_cc[VMIN] = 1;
tcflush(fd, TCIFLUSH);
tcsetattr(fd, TCSANOW, &tio);
}
// End of added ON LINE 118 TO FIX ASIO input problem

// Set the I/O worker
if (worker_) return;
setWorker(boost::shared_ptr(
new AsyncWorkerboost::asio::serial_port(serial, io_service)));
`
However the error still exists.

Best regards,
screenshot from 2017-08-11 10-31-54

Inna

from ublox.

kartikmohta avatar kartikmohta commented on May 29, 2024

Did you recompile after adding that code? In its current form, it would give you compile errors. You have to change serial_port->native_handle(); to serial->native_handle(); and the recompile.

from ublox.

pkess avatar pkess commented on May 29, 2024

Hi there,
i got the same issue on a raspberry pi with a ros image installed (http://www.german-robot.com/2016/05/26/raspberry-pi-sd-card-image/)

Did anyone solve this?

Additionally i found out that the usb-device disconnects when the code tried to set dtr/rts signals:
dmesg:

[ 1361.535370] usb 1-1.2: USB disconnect, device number 28
[ 1361.535543] cdc_acm 1-1.2:1.0: failed to set dtr/rts

from ublox.

weisongwen avatar weisongwen commented on May 29, 2024

Hi, @pkess @kartikmohta
Have you solved this problem, I also get this issue when I use this driver to get data from EVK-M8T. But I can get the data when i use the u-center in windows 10.

Thanks

from ublox.

pkess avatar pkess commented on May 29, 2024

Hi there,
Unfortunately I could not solve this issue, so I decided to start again with a clean raspbian Jessy image and compiled Ros from source. Then tge error was gone.
Took about one day to get all dependencies compiled

from ublox.

weisongwen avatar weisongwen commented on May 29, 2024

Hi, @pkess
Thanks for your reply. you mean that this is a problem casued by some dependencies needed?

from ublox.

weisongwen avatar weisongwen commented on May 29, 2024

Hi, @innavalieva
Have you solved this problem, I also get this issue when I use this driver to get data from EVK-M8T. But I can get the data when i use the u-center in windows 10.

from ublox.

billyjov avatar billyjov commented on May 29, 2024

does someone got this driver working on any device?

from ublox.

kartikmohta avatar kartikmohta commented on May 29, 2024

Can you try with the latest commit? That should help with the end of file issue.
There are still some issues with devices with timing features such as the M8T which need to be looked at.

from ublox.

billyjov avatar billyjov commented on May 29, 2024

yeah i will try it in a few hours and give a feedback.

BTW i use the GPS U-blox NEO-6M .

from ublox.

weisongwen avatar weisongwen commented on May 29, 2024

Hi @kartikmohta
I still cannot get data from M8T with driver. just as you said, this driver is not available for M8T by now,

Best
Welson

from ublox.

siddharthcb avatar siddharthcb commented on May 29, 2024

Thank you for your suggestion Kartik!
I have added the block on line 118 in ublox_gps/src/gps.cpp as you suggestaed:

` // open serial port
try {
serial->open(port);
} catch (std::runtime_error& e) {
throw std::runtime_error("U-Blox: Could not open serial port :"

  • port + " " + e.what());
    }

ROS_INFO("U-Blox: Opened serial port %s", port.c_str());

//ADDED ON LINE 118 TO FIX ASIO input problem
{
// Wait for at least one char on serial port before returning from read.
// Sadly Boost doesn't provide any way to set this.
int fd = serial_port->native_handle();
struct termios tio;
tcgetattr(fd, &tio);
tio.c_cc[VTIME] = 0;
tio.c_cc[VMIN] = 1;
tcflush(fd, TCIFLUSH);
tcsetattr(fd, TCSANOW, &tio);
}
// End of added ON LINE 118 TO FIX ASIO input problem

// Set the I/O worker
if (worker_) return;
setWorker(boost::shared_ptr(
new AsyncWorkerboost::asio::serial_port(serial, io_service)));

` // open serial port
try {
serial->open(port);
} catch (std::runtime_error& e) {
throw std::runtime_error("U-Blox: Could not open serial port :"

  • port + " " + e.what());
    }

ROS_INFO("U-Blox: Opened serial port %s", port.c_str());
//ADDED ON LINE 118 TO FIX ASIO input problem
{
// Wait for at least one char on serial port before returning from read.
// Sadly Boost doesn't provide any way to set this.
int fd = serial_port->native_handle();
struct termios tio;
tcgetattr(fd, &tio);
tio.c_cc[VTIME] = 0;
tio.c_cc[VMIN] = 1;
tcflush(fd, TCIFLUSH);
tcsetattr(fd, TCSANOW, &tio);
}
// End of added ON LINE 118 TO FIX ASIO input problem

// Set the I/O worker
if (worker_) return;
setWorker(boost::shared_ptr(
new AsyncWorkerboost::asio::serial_port(serial, io_service)));
`
However the error still exists.

Best regards,
screenshot from 2017-08-11 10-31-54

Inna

had the same error when connected through serial on raspi 4.. Solved it by changing to USB connection. Works well now

from ublox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.