Closed brandonros closed 1 year ago
I would guess it isn't u-blox if it didn't show up this way on System Information.... is it... a knockoff? How can I find out exactly which chip it is?
It sort of works with PyGPSClient which probably rules out the hardware being funky/non-complaint
I'll try to get serial TX/RX logs if that'll help us.
Thanks for the report! It definitely seems like this is a bug in the crate. In particular, a bug here: https://github.com/ublox-rs/ublox/blob/master/ublox/src/ubx_packets/packets.rs#L3032
That function is what decides whether the packet is "valid" or not. I'm able to reproduce the bug in a playground here, which points to the issue: the .any(|c| !is_cstr_valid(c))
will return true if any of the extensions aren't valid, so we need to actually do:
fn is_valid(payload: &[u8]) -> bool {
payload.len() % 30 == 0 && !payload.chunks(30).any(|c| !is_cstr_valid(c))
}
I think?
I'm not sure how I never caught this. Maybe my hardware has a non-UTF8-decodable extension, and I never noticed (the original HW I developed this crate with was, in fact, somewhat less than genuine).
thank you so much! @lkolbly do you need anything else from me to make a fix? would love to try again
@brandonros Can you try the lkolbly/mon-ver-fix
branch?
There is also this PR https://github.com/ublox-rs/ublox/pull/47 ,
in particular it changes is_valid
to:
fn is_valid(payload: &[u8]) -> bool {
payload.len() % 30 == 0 && payload.chunks(30).all(|c| is_cstr_valid(c))
}
Oh yeah, that's a much better fix.
Thanks for merging. Not sure if you want to trigger a full new tag bump + release. Thank you!
$ cargo run --bin ublox_cli -- --port /dev/cu.usbmodem1301
Finished dev [unoptimized + debuginfo] target(s) in 0.03s
Running `target/debug/ublox_cli --port /dev/cu.usbmodem1301`
Opened u-blox device, waiting for solutions...
SW version: ROM CORE 3.01 (107888) HW version: 00080000
MonVer { software_version: "ROM CORE 3.01 (107888)", hardware_version: "00080000", extension: MonVerExtensionIter { data: [70, 87, 86, 69, 82, 61, 83, 80, 71, 32, 51, 46, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 82, 79, 84, 86, 69, 82, 61, 49, 56, 46, 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71, 80, 83, 59, 71, 76, 79, 59, 71, 65, 76, 59, 66, 68, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 66, 65, 83, 59, 73, 77, 69, 83, 59, 81, 90, 83, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], offset: 0 } }
Hardware: Geekstory USB GPS Module Antenna Supports GPS+GLONASS Beidou Built-in Flash for Arduino Pixhawk IPEX Compatible, Better Than VK-162 https://www.amazon.com/gp/product/B07ZR8R17Q/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
There's a support document on the Amazon product page https://m.media-amazon.com/images/I/91+EnzD0qpL.pdf that mentions u-block u-center (M9 and below)
Still trying to identify which u-blox product it is...?
Edit: found it u-blox M8 (ProductID = 0x01A8, VendorID = 0x1546)