Skip to content

fix issue of Celestron SCT focuser for aarch64#2259

Merged
knro merged 1 commit into
indilib:masterfrom
wgauvin:master
Aug 1, 2025
Merged

fix issue of Celestron SCT focuser for aarch64#2259
knro merged 1 commit into
indilib:masterfrom
wgauvin:master

Conversation

@wgauvin

@wgauvin wgauvin commented Jul 20, 2025

Copy link
Copy Markdown
Contributor

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

  • the toHexStr could cause a buffer overflow in the sprintf. Not sure why even the x86_64 architecture didn't pick it up
  • the default baud rate was set to 19200 but doing stty -a on 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 toHexStr to 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.

@knro

knro commented Aug 1, 2025

Copy link
Copy Markdown
Contributor

Did you test the 9600 baud rate on x86_64 ?

@wgauvin

wgauvin commented Aug 1, 2025

Copy link
Copy Markdown
Contributor Author

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 stty -a < /dev/ttyACM0 on my x86_64 server.

speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread clocal -crtscts
ignbrk -brkint ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon -iexten -echo -echoe echok -echonl noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc

From this the speed is 9600 baud and is 8N1 ( 8bit (from cs8), no parity (-parenb), and 1 stop bit (-cstopb)).

@knro knro merged commit 721e4c2 into indilib:master Aug 1, 2025
11 checks passed
@knro

knro commented Aug 1, 2025

Copy link
Copy Markdown
Contributor

Ok thank you! Not sure it was set to a higher baud rate before. I thought it was in Celestron's documentation, apparently not.

@wgauvin

wgauvin commented Aug 1, 2025

Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants