Serious PropellerIDE serial terminal problems on MacOS High Sierra
Jim_Arlow
Posts: 37
in Propeller 1
Hi all - this is my first post here,
Is anyone else having problems with the PropellerIDE serial terminal running under MacOS High Sierra? The IDE seems to open up two serial ports:
ls /dev/*usb*
/dev/cu.usbserial-A504G07R /dev/tty.usbserial-A504G07R
The terminal connects to /dev/cu.usbserial-A504G07R, and this causes everything to stop working. The terminal doesn't work, and I can no longer download code to the Propeller until I disconnect and reconnect to a different USB port. Then when I try to download, the download works, but the IDE crashes. When I start it up again, I am back to square 1 - I can download Propeller code, but any attempt to use the terminal causes everything to fail as just described.
I am not a serial comms expert, but with a little experimentation, I found that if I connect to /dev/tty.usbserial-A504G07R using the screen command then it the Parallax Serial Terminal object works as advertised. Here is the screen command I used:
screen /dev/tty.usbserial-A504G07R 115200
However, if I try to connect to the other port (the one the terminal connects to), then everything fails:
screen /dev/cu.usbserial-A504G07R 115200
I think the terminal is connecting to the wrong port... It should be connecting to /dev/tty.usbserial-A504G07R rather than /dev/cu.usbserial-A504G07R
Is anyone else having this problem, or does anyone know of a fix? It is holding me up pretty badly - I really need to get the terminal working ASAP.
Thanks for your help!
Jim
Is anyone else having problems with the PropellerIDE serial terminal running under MacOS High Sierra? The IDE seems to open up two serial ports:
ls /dev/*usb*
/dev/cu.usbserial-A504G07R /dev/tty.usbserial-A504G07R
The terminal connects to /dev/cu.usbserial-A504G07R, and this causes everything to stop working. The terminal doesn't work, and I can no longer download code to the Propeller until I disconnect and reconnect to a different USB port. Then when I try to download, the download works, but the IDE crashes. When I start it up again, I am back to square 1 - I can download Propeller code, but any attempt to use the terminal causes everything to fail as just described.
I am not a serial comms expert, but with a little experimentation, I found that if I connect to /dev/tty.usbserial-A504G07R using the screen command then it the Parallax Serial Terminal object works as advertised. Here is the screen command I used:
screen /dev/tty.usbserial-A504G07R 115200
However, if I try to connect to the other port (the one the terminal connects to), then everything fails:
screen /dev/cu.usbserial-A504G07R 115200
I think the terminal is connecting to the wrong port... It should be connecting to /dev/tty.usbserial-A504G07R rather than /dev/cu.usbserial-A504G07R
Is anyone else having this problem, or does anyone know of a fix? It is holding me up pretty badly - I really need to get the terminal working ASAP.
Thanks for your help!
Jim
Comments
But this post belongs in the P1 section. Can a moderator please move it thanks.
Thread moved to P1.
proploader also has a built-in terminal feature that can be started after a download, but I haven't tried that yet. Look at the help summary you get when you run proploader from the command line.
Thanks for your help Mike - I am just getting started with the Propeller, and so I had no idea about proploader. In fact it doesn't appear to have been installed on my system.
I am going to raise the terminal issue with technical support because I think this is the sort of thing that really needs to be working.
https://www.decisivetactics.com/products/serial/
I got your suggestions working Mike. I extracted proploader from SimpleIDE and put it in /user/local/bin. I then used proploader -P to find the serial ports, and
proploader -T -p /dev/cu.usbserial-A504G07R Blink01.binary
to load the code into RAM and automatically open a terminal. It works well, although the terminal isn't that pretty.
Thanks for your patience.
Ken Gracey
I think the real problem is why there's a tty and cu device for each port on a Mac. We've seen this before and found that the opposite was true with proploader... tty ports cased lock-up and cu ports made everything happy. At this point, I imagine that PropellerIDE is doing something different that makes the opposite true and it needs to be recompiled to filter out cu port and allow use of tty ports only.
Is this something that only started happening with High Sierra? If so, then we'd have to detect which version of macOS and filter accordingly.
Anyone know the difference between tty and cu ports and the reason for their existence? I came up empty back when we decided to filter out tty's, but I'll try Googling around again.
See the "TTY vs CU (Mac, Linux)" section.
However, at the moment I don't understand why the /cu doesn't work with PropellerIDE when it clearly works better than /tty with proploader.
https://stackoverflow.com/questions/37688257/choosing-between-dev-tty-usbserial-vs-dev-cu-usbserial?lq=1
1. Find and kill any existing proploader terminals.
2. Launch proploader with the right flags.
I suppose the only issue is that we would not have a persistent terminal, but perhaps that would be OK.
With a carefully placed "#ifdef Q_OS_MAC", the following example could be used to modify PropellerIDE's sources to only return the "cu." variant of the devices...
https://bugreports.qt.io/browse/QTBUG-38639
dgately
@Jim_Arlow - yes, persistent terminals are what would be lost. I think it's solvable using dgately's suggestion or something similar. Anyone want to try their hand at installing/configuring the right version of QT and experimenting with this?
If I had High Sierra I could probably give the QT suggestion above a try but I have Yosemite and I'll be sticking to it for now.
Here is the relevant part:
"TTY vs CU (Mac, Linux)
In Unix and Linux environments, each serial communication port has two parts to it, a tty.* and a cu.*. When you look at your ports in say the Arduino IDE, you’ll see both for one port.
The difference between the two is that a TTY device is used to call into a device/system, and the CU device (call-up) is used to call out of a device/system. Thus, this allows for two-way communication at the same time (full-duplex). This is more important to know if you are doing network communications through a terminal or other program, but it is still a question that comes up frequently. Just know that, for the purposes of this tutorial, always use the tty option for serial communication."
I would very much like Parallax to adopt this as an official way of running Propeller Tool on the Mac and make sure it continues to work going forward. Any chance of that? What do others think?
With the latest release of SimpleIDE for Mac, v1.1.0, there was a utility name change from "Propeller-Load" to "PropLoader". The documentation for Propeller-Load can be found at ttps://sites.google.com/site/propellergcc/documentation/propeller-loader. Does anyone know, is that still the latest documentation for PropLoader; any changes?
proploader
at a command prompt, you get a very useful man page. I am using
proploader -T -p /dev/cu.usbserial-A504G07R blink.binary
to load into RAM and open a pst compatible terminal.
proploader -P
lists all the serial ports. It is a great utility!
The Propeller Tool is an all in one IDE/compiler/downloader.
Also successful from Terminal, but It took a while to find Proploader tucked away in the bundle and to see the commands. (Control click the SimpleIDE app and choose "show package contents". PropLoader is in the osx folder. Use option -? option for usage list. Here is how it went with dragging PropLoader to the terminal window, entering the options -e -r -s, and then the binary for whack-a-mole.
THOMASs-Air:~ thomasallen$ /Applications/SimpleIDE.app/Contents/MacOS/proploader -e -r -s /Users/thomasallen/Documents/SimpleIDE/Propeller\ GCC\ Demos/QuickStart/Whack-a-mole/qswam.binary
Opening file '/Users/thomasallen/Documents/SimpleIDE/Propeller GCC Demos/QuickStart/Whack-a-mole/qswam.binary'
Downloading file to port /dev/cu.usbserial-A4009HHT
3220 bytes remaining
2196 bytes remaining
1172 bytes remaining
148 bytes remaining
3220 bytes sent
Verifying RAM
Programming EEPROM
Download successful!
It seems that wifi is the default, so -s is necessary to force the serial option. Now, to make this work from an Applescript. That should do something like your Python utility.
David, is there more documentation/links for the new PropLoader?