Forum Rule: Always post complete source code & details to reproduce any issue!
Page 5 of 5 FirstFirst ... 3 4 5
Results 101 to 106 of 106

Thread: uBlox Library

  1. #101
    Junior Member
    Join Date
    Mar 2019
    Posts
    14
    @brtaylor-


    I want to give you a link to the question I raised on the Arduino forum.

    http://forum.arduino.cc/index.php?topic=604991.0

    All persist in insisting that the UBLOX library does not provide work in the mode of continuous long data reception. I disagree with them! But no one was able to explain the patterns observed by me with exceeding 240 bytes and with always successful first parsing after CPU reset. Maybe you will be interested. I believe that everything is connected with a buffer overflow between two parsing and I suggest to clear it with each failed parsing (when the PVT package is not identified). Approximately as I was advised on the forum:
    Code:
    bool UBLOX::_parse(uint8_t msg_class,uint8_t msg_id,uint16_t msg_length)
    {
    	// read a byte from the serial port
    	while (_bus->available()) {
    		_byte = _bus->read();
    		// identify the packet header
    		if (_parserState < 2) {
    			if (_byte == _ubxHeader[_parserState]) {
    				_parserState++;
    			} else {
    				_parserState = 0;
    //************ clean serial buffer ***************
    
     while(Serial.available()) Serial.read();
    
    //*******************************************
    			}
    		} else {
    			if ((_parserState - 2) < msg_length) {
    				*((uint8_t *) &_tempPacket + _parserState - 2) = _byte;
    			}
    			_parserState++;
    			// compute checksum
    			if ((_parserState - 2) == msg_length) {
    				_calcChecksum(_checksum,((uint8_t *) &_tempPacket),msg_length);
    			} else if ((_parserState - 2) == (msg_length + 1)) {
    				if (_byte != _checksum[0]) {
    					_parserState = 0;
    				}
    			} else if ((_parserState - 2) == (msg_length + 2)) {
    				_parserState = 0;
    				if (_byte == _checksum[1]) {
    					memcpy(&_validPacket,&_tempPacket,sizeof(_validPacket));
    					return true;
    				}
    			} else if (_parserState > (msg_length + 4) ) {
    				_parserState = 0;
    			}
    		}
    	}
    	return false;
    }
    Do you think my proposal is correct?

  2. #102
    Member
    Join Date
    Jan 2016
    Location
    USA
    Posts
    41
    Hi Brian,
    I'd been successfully using another UBLOX parser, but saw that you'd updated yours and so .....
    Using the Master library with UBLOX8.h and UBLOX8.cpp, the included example needs some work. It loads UBLOX.h which of course isn't there.
    By any chance have you uodated the example somewhere to agree with your code improvements?

    best regards,

    john

    PS: I found another iteration of your library which works fine. In my earlier use of another parser, I Ublox meant I could only read lat/lon. Was that incorrect?
    Last edited by jferguson; 05-11-2019 at 02:36 PM.

  3. #103
    Senior Member brtaylor's Avatar
    Join Date
    Mar 2016
    Location
    Portland, OR
    Posts
    509
    Quote Originally Posted by jferguson View Post
    Hi Brian,
    I'd been successfully using another UBLOX parser, but saw that you'd updated yours and so .....
    Using the Master library with UBLOX8.h and UBLOX8.cpp, the included example needs some work. It loads UBLOX.h which of course isn't there.
    By any chance have you uodated the example somewhere to agree with your code improvements?

    best regards,

    john

    PS: I found another iteration of your library which works fine. In my earlier use of another parser, I Ublox meant I could only read lat/lon. Was that incorrect?
    My latest and greatest is typically on GitHub, so this one should work fine:
    https://github.com/bolderflight/UBLOX

    It shows printing several values, but a full list of available methods to get data is located here:
    https://github.com/bolderflight/UBLOX#data-retrieval

  4. #104
    Member
    Join Date
    Jan 2016
    Location
    USA
    Posts
    41
    Hi Brian,

    I had thought, apparently wrongly, that the 10 Hz binary signal from an M8N could not include the clock data. Accordingly, my 2016 flight data recorder included a clock module. In addition to having time fields in each record, I used its output to name the flight-data files recorded in a micro-sd; 100101.csv for example. This would be a file created at 10:01.01 I had to do this so that on a day with 5 or 6 flights i would have discrete files which could be associated with particular flights.

    When present system is powered on, it writes a sequence of reports to SERIAL1 which is connected by removable cable to a little nano powered oled display terminal in a 3d printed box. After not-showing any killer error reports, it displays vacc, and hacc. this way I know when the GPS has settled down and a flight can commence.

    since the external clock works all the time, I can label and initialize the SD file as an early step in the SETUP. If I now depend on the clock in the gps, I will need to watch the gps output until it locks on and provides a usable clock signal, then initialize the sd file and start everything else.

    The usual clock modules do not output sub second intervals. Although I replaced the chip on one of AdaFruit's clocks with a chip that did, I foundered on modifying the code to output the 1/100s. I was getting ready to add a millis function to make my own sub-seconds, but now with your code can just read them from the gPS output. And I also can take the clock modules out of the planes.

    I realize that none of this may seem great shakes to people farther along this route than I am, but to me it's amazing that I can do this stuff and the code and equipment to do it with is so readily available.

    Cheers,

    John

  5. #105
    Member
    Join Date
    Jan 2016
    Location
    USA
    Posts
    41
    Bingo,
    After some fussing with Ublox-Center, I was able to configure my M8N to emit what your code was looking for. Works great and will allow me to clean up my data-recorder code.
    Thanks much,

    john

  6. #106
    Senior Member brtaylor's Avatar
    Join Date
    Mar 2016
    Location
    Portland, OR
    Posts
    509
    Quote Originally Posted by jferguson View Post
    Bingo,
    After some fussing with Ublox-Center, I was able to configure my M8N to emit what your code was looking for. Works great and will allow me to clean up my data-recorder code.
    Thanks much,

    john
    Good! Glad it's working well for you.

    Brian

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •