-
Notifications
You must be signed in to change notification settings - Fork 1
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
Does not work in MacOS stock bash. Requires macports or brew. #1
Comments
It's working for me on Monterey. But I see now that if I force it to use the bash that ships with osx, it doesn't work. Please try installing bash from macports. In the mean time I'll see if it's possible to make it work with the stock bash. It's old but not that old. I didn't think I was relying on any bash 4.x features, but this thing is a tour-de-force of fancy bash tricks, so, yeah it could be some gimmicky parts are a bit too gimmicky ;) I was thinking it sounded like maybe permissions/security settings, but when I forced it to use the stock bash just now I immediately hit one thing that is probably a fancy syntax problem not a security problem. The routine that tries to present a list of likely tty devices to pick from, fails to see the cu.* devices and falls back to listing all tty*. But under the stock bash, the cu.* devices are visible and listable, so it's probably something with the fancy way that routine uses globbing and brace expansions and array ops rather than permissions. The only other two potential problems will be permissions to run stty on the tty device, and mkfifo to create a file in /tmp |
I'm going to make it a todo to try to downgrade the code until it works in the stock bash, because that will make it far more handy. I might as well replace "make install" with another script too since it's a bit ridiculous to make a bash script for the purpose of having no dependencies, and then require xcode just to copy it somewhere. |
The blow-by-blow may not be exactly fascinating, but, yeah there turns out to be a lot of bash version compatibility stuff. The first thing is right off the bat, the part that detects the OS fails. It doesn't like the ",," in "${OSTYPE,,}" which converts the value to all lower case, which makes it a little simpler to test for matches. So because of that, it doesn't go into macos mode, and that causes the tty list to make a bad assumption that the tty is probably /dev/tty*something. That is the only reasonable fall-back assumption when all else failed, because it's not helpful to just list all device nodes (then again, maybe that's exactly what I should do in that case). Anyway this causes the problem that the /dev/cu.* devices are not presented in the list to choose from. So you end up selecting the equivalent tty.* device, but those are actually wrong you need to use the cu.* device because they are different interfaces. They both go the same port, but they work differently. So, when you get past that by just manually specifying the right tty on the commandline...
dooblydoo... lotta stuff... well, the stty illegal option is only because the unrecognized ${OSTYPE,,} means it didn't select the macos version of stty syntax. And the unrecognized typeset option is annoying but simple to change. At least I think this version of bash supports associative arrays even if not the typeset -A option... Initial googling failed to turn up an answer about installing macports or other packages without xcode, however it does show that you don't need to install xcode just the cli tools which is a much smaller download, and they give a simple single command to run to do it, but not something clickable in the app store. I thought there was something that worked like freebsd pkg that could install binary packages. |
Might have hit a show-stopper. I'd rather tell the user to install bash4 or greater than to call /bin/sleep ;) |
I put my current progress into a branch named bash3 so you can follow it if you want. It's not working yet but it starts up without error and gets further along. Currently it starts and the tty selection menu is correct, no stty error, several random syntax errors fixed that you never got far enough to see yet, and when I try to |
I have reproduced this issue on both
Connected to a TPDD1, with factory cable
The script starts, asks which port to use (btw auto detect also does not work), then nothing happens.
The behaviour is the same even if you don't connect anything on the serial side ( eg no : TDPP at all)
Debug 1 or 2 says nothing either.
If your CTRL-C to exit the script, the script says it was at line 524 (if that info helps maybe...)
Cable setup is OK , serial adapters work & are supported, TPDD works, and not the cause of the problems. I can talk to my TPDD with the same cables and setup using Windows 11 virtual machin under Parallels and a Windows TPDD Client.
The text was updated successfully, but these errors were encountered: