-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot parse ATI - "ParseString" error #86
Comments
Just to get a base understanding here.
Is this due to you not having In case of the latter, this might be solvable by adding If this keeps being a problem, please report back here, and i will try to setup a small test to see if i can replicate :) |
ATE is on in this case. I actually had confused my concepts a bit - commands such as One thing I've noticed about all the other commands we're executing is their results always are single-line. ATI is unique in that it returns 3 lines before the empty line and |
Ahh, alright. In that case i think i get the issue. Do you have the option of testing of the full rx,tx in a regular terminal, and posting the full correspondance here? That way i can add a regression test to test it out, and at the same time make sure it doesn't break in the future. Something along the lines of:
One other thing to notice, is that |
I think the logs just put extra quotes around things. Here's an example correspondence with some "normal" commands as well - I don't have local echo turned on, so the commands you're seeing are the ones sent back by
|
Cool 👍 Does |
Yes it does! The struct for that is #[derive(Clone, Debug, AtatResp, Serialize)]
pub struct ManufacturerId {
#[at_arg(position = 0)]
pub id: String<consts::U64>,
} |
Okay, cool! Then i guess the string thingy is indeed a logging thing. I will try to setup a regression test on this, to see if i can figure out why What you could try in the meantime, is to attempt with the newly introduced use serde_at::CharVec;
#[derive(Clone, Debug, AtatResp)]
pub struct IdentificationInformationResponse {
pub app_ver: CharVec<consts::U32>,
} Not sure if that requires you to update atat version though? I will be away most of the coming week for easter, so i might not be able to test it out until i get back. |
I'm trying to avoid updating to 0.9.0 because of the removal of Luckily, 0.8.4 still works (almost!) with CharVec - I get back a vec of bytes, which converted to a string becomes Our use of ATI is to try and determine common factors in flaky modems - the newlines aren't important because I can pull out the revision anyway. This is a great solution for now! |
Ahh, yeah thats fair enough (Sorry for bluntly removing the log_logging, wasn't aware of anyone using it :) I would happily take a PR that adds it again, if you were to make it?) I think it should be possible to make a defmt -> log facade that kinda just acts as if it had been a regular |
@mon Just to let you know, the I would still like to investigate the |
Excellent news! I'll update to 0.10.0 next time I add more features to my project. Great to be back in line with master :) |
It will be part of 0.11.0, so you should probably update to that one instead 😉 I won't do the release until we have the heapless dependency bump merged though, unless you strictly require it with heapless 0.5.5? |
Nope! No problems there |
@mon Released 🎉 https://crates.io/crates/atat Give it a spin when you get time, and let me know if anything is not working. |
Been a few months but finally got time to get back into this - main issues are just updating the initialization boilerplate from 0.8.4 to 0.11.1, the examples appear to be out of date again. Specifically, My own extensions have broken too - pub fn get_manufacturer<A: AtatCmd<LEN>, const LEN: usize>(&mut self) -> Result<<requests::GetManufacturerId as A>::Response> {
self.send(&requests::GetManufacturerId)
} 0.11.1 broke this too due to Thanks for continuing to help out with this - it seems I still have a lot of rust to learn! |
Hi! I am sorry about the state of the documentation & examples. They do seem to be a bit out of date. Guess i should really push to have them fixed and added to the CI.
This would be the correct way 👍
This would be because pub fn get_manufacturer<A: AtatCmd<LEN> + Debug, const LEN: usize>(&mut self) -> Result<<requests::GetManufacturerId as A>::Response> {
self.send(&requests::GetManufacturerId)
}
I think this is a follow-up error on the Debug one? |
I might actually need another feature to complete this - want me to open a new issue or keep commenting on this one? So this works: pub fn get_manufacturer(&mut self) -> Result<<requests::GetManufacturerId as AtatCmd<10>>::Response> {
self.send(&requests::GetManufacturerId)
} But obviously pub fn get_manufacturer(&mut self) -> Result<<requests::GetManufacturerId as AtatCmd<{<requests::GetManufacturerId as AtatLen>::LEN}>>::Response> {
self.send(&requests::GetManufacturerId)
} ...but this is just the struct len, not the ident len as well. Would a viable solution be to provide a Edit: This appears to be something that the rust compiler could eventually support with |
In addition, it took some work but I got the fn send<A: AtatCmd<LEN, Error=atat::GenericError>, const LEN: usize>(&mut self, cmd: &A) -> Result<A::Response> {
self.client.send(cmd).map_err(|e| anyhow!("AT error: {:?}", e))
} |
Apologies, but I've had to give up trying to port my serial ingest to the new atat - I'm leaving my current company and won't be doing any more rust for the foreseeable future... Thank you for your time so far, it's been a pleasure. |
Sorry to hear you didn't manage to make it work, but hey! Congratz on the new job & best of luck! |
I'm on 0.8.4 at the moment and trying to parse the manufacturer revision information. I've tried working through serde_at/src/de/mod.rs to try and understand the failure but can't quite grok it.
The request I'm sending:
The response struct:
The raw logs:
However, the
ParseString
error is always returned. Any ideas? I get the feeling theQuectel\r\nUC20\r\n
section of the string is confusing the parser, as the modem doesn't echo back theATI
first.The text was updated successfully, but these errors were encountered: