Trying to understand your code right now π€ Hard to fully fix it on my end since I don't have a device to test with but lets see hyaaa...
General tip reading your code btw, make more smaller functions in order to not end up in nesting hell where you're currently like 9 layers deep or something, and make those functions return a Result<T> that you can instead error handle once instead of all over your code, and make use of the ? syntax to raise the error, and use syntaxes like if let Ok(value) = something() {} in any cases where you don't care about the error/none states. Just some general tips that will help with code quality and readability because this code is getting a bit hard to follow π
The Current Issue you have in the Issues.md looks like it's just related to that serial_buf gets dropped in the context where you made it, so you either have to move it (will probably complain about that I'm guessing) by removing the & or .clone() it so that it can escape the context, or have stored_buffer be extended by the contents in serial_buf instead so the serial_buf is safe to drop
As a general note on BufReader, it's possible it loses data according to its docs if the same stream is used multiple times, seeing as you've defined things in a loop that may be the reason why data is sometimes incomplete, not sure, hard to follow the code π
Also it doesn't convert from bytes to anything, it receives bytes, it only creates strings when you run .lines() on it (like you do), but since it is a potentially failing function the way you've written your code it's supposed to error out when it e.g. lacks some bytes to construct proper utf-8 strings (note ascii, Rust loves utf-8)