fix issue of Celestron SCT focuser for aarch64#2259
Conversation
|
Did you test the 9600 baud rate on x86_64 ? |
|
Yeah I did, and just did it again to confirm. I was able to connect at 9600 and perform a changing of the focus position. The following is what I get when I run From this the speed is 9600 baud and is 8N1 ( 8bit (from cs8), no parity (-parenb), and 1 stop bit (-cstopb)). |
|
Ok thank you! Not sure it was set to a higher baud rate before. I thought it was in Celestron's documentation, apparently not. |
|
Thanks for getting this merged before the next version. I know 3 yrs ago it worked and about a year ago it stopped but I wasn't very active with astro and thought it was my focuser had died. I only just got back into astro and by chance saw a message about others having an issue. Glad to help out getting it sorted, even though I doubt i would use my SCT for any decent imaging of late. My gut feeling we're up against some changes (or combination thereof), gcc version and/or kernel causing the higher baud rate not working on the aarch. but anyway there was definitely buffer overruns happening. |
This is a continuation of work done in commit 83030d4 (see #2252) which fixed issue on an x86_64 but the issue stil existed on the aarch64.
I've found 2 issues that were causing issues on the aarch64
toHexStrcould cause a buffer overflow in thesprintf. Not sure why even the x86_64 architecture didn't pick it upstty -aon the serial device said it was 9600. On my x86_64 server it would happily handle 19200 but on my ODROID N2+ it would crash the whole xhci/USB and I would have to completely power cycle my ODROID.I've changed the
toHexStrto avoid the buffer overflow and I've set the default baud rate to 9600.If there is a clean way to warn users know about the baud rate, then I'm happy to make the change but would need to know where to make the changes.
I've been able to test this fix on both x86_64 and aarch64 machines so I'm confident that this should be the last issue of the Celestron SCT focuser for now.