Shop OBEX P1 Docs P2 Docs Learn Events
Serious PropellerIDE serial terminal problems on MacOS High Sierra — Parallax Forums

Serious PropellerIDE serial terminal problems on MacOS High Sierra

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
«1

Comments

  • Cluso99Cluso99 Posts: 18,066
    Yes. Seems lots of problems.

    But this post belongs in the P1 section. Can a moderator please move it thanks.
  • PublisonPublison Posts: 12,366
    edited 2018-06-02 14:31
    Welcome to the forums!

    Thread moved to P1.
  • I've had a variety of problems with downloading programs and using the built-in terminal in PropellerIDE under MacOS High Sierra. I only use PropellerIDE for editing and compiling. I keep a MacOS terminal window open and download programs using proploader. CoolTerm is a simple freeware serial terminal that I use for a terminal for Propeller applications, particularly Tachyon. It's still a 32-bit application and will have to be updated to work with the next major MacOS release, but works fine under 10.13.5.

    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 to the moderator for moving the post!

    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.
  • I think proploader is the loader/terminal program included with SimpleIDE. If you've installed SimpleIDE, control-click on the SimpleIDE icon and choose "Show Package Contents". You'll get a new finder window. Click on "Contents", then "MacOS". You'll see proploader. Do option-click to drag a copy to somewhere else like the Application folder. You should be able to execute it from a command line (like in terminal).
  • That is really helpful! I will install SimpleIDE. Thanks.
  • I did some more research on this and I found an app called Serial, which might be a decent alternative to CoolTerm if it is not updated to 64 bit. It looks very good, but it is not free:

    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.
  • I've asked Jeff Martin to look into this thread for us so we can figure out what's wrong without trying to make Jim a software developer.

    Thanks for your patience.

    Ken Gracey
  • Ken and Jeff: Would it work to simply switch to using proploader as the default downloader / terminal program for PropellerIDE?
  • I think that would be a lot of effort to make happen since PropellerIDE uses a serial manager (built to work with PropellerIDE) to handle serial connections for downloading and terminal access. Maybe I'm wrong, but my gut tells me it sounds simple and probably isn't.

    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.
  • Just found this: https://learn.sparkfun.com/tutorials/terminal-basics/tips-and-tricks

    See the "TTY vs CU (Mac, Linux)" section.
  • And this, seems to clear it up more: https://lists.apple.com/archives/darwin-dev/2009/Nov/msg00099.html

    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.
  • This may closely indicate why this is a problem with Propeller IDE as it uses a port manager object to share connections amongst parts of itself.

    https://stackoverflow.com/questions/37688257/choosing-between-dev-tty-usbserial-vs-dev-cu-usbserial?lq=1
  • The problem with PropellerIDE seemed to start with High Sierra.
  • It would be nice to fix the program, but I must admit that I like Mikes idea. Cut out all the serial and terminal stuff from PropellerIDE, and just launch proploader as a separate process. It must work, because this is effectively what we are doing at the moment, except that we have to leave PropellerIDE to do so. So just repurpose the Run and Write buttons to:

    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
  • Thanks @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? :wink:
  • roglohrogloh Posts: 5,122
    edited 2018-06-07 04:42
    I find that the persistent terminal in PropellerIDE is pretty handy. Otherwise if you need to manually fire up a new terminal application each time after you download an image for testing you can miss some initial serial output at the beginning which can be a pain. I find that is exactly what happens with BST and Linux for example as I can't get it's inbuilt terminal working reliably without lockups and have to resort to using external tools for the terminal and I have to remember to close it before each download so the port is released. Compared to all that mess, the integrated terminal in PropellerIDE is very nice indeed.

    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.
  • I'm following this with interest, and in general like using PropellerIDE 0.33.3 on macOS10.12.6 Sierra /FTDI drivers. I switch over to CoolTerm for serial port interaction, but not without the same frustrations and need for care that has been described above. I usually plug the USB into a 10-port external hub, so if one USB port disappears due to my carelessness, I can usually keep going without a full reboot by moving to the next up USB port. I wish I better understood the workings of the Mac serial ports, cu versus tty, and I wish there were a way to do a software reset of a port that has locked up.

  • Jeff posted this link (see above) which explains it pretty well: https://learn.sparkfun.com/tutorials/terminal-basics/tips-and-tricks

    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."
  • Jim_ArlowJim_Arlow Posts: 37
    edited 2018-06-08 17:08
    Here is a snippet of Python3 code that allows you to select a .binary file to work on, and then use proploader to load it to the Propeller and open a terminal. You can do this as often as you like, because the program always terminates any running proploader terminals before launching another one.
    from tkinter import *
    from tkinter import filedialog
    
    import subprocess
    
    class ProploaderGUI:
        def __init__(self, master):
            self.proc = None
    
            self.master = master
            master.title("Proploader Helper")
    
            self.binary_button = Button(master, text="Select .binary file", command=self.get_binary_file)
            self.binary_button.pack(side=TOP, fill=BOTH, expand = YES)
    
            self.load_with_terminal_button = Button(master, text="Load with terminal", command=self.run_proploader)
            self.load_with_terminal_button.pack(side=TOP, fill=BOTH, expand=YES)
    
            self.binary_filename = StringVar(value="")
            self.binary_label = Label(master, textvariable=self.binary_filename)
            self.binary_label.pack(side=TOP, fill=BOTH, expand=YES)
    
        def get_binary_file(self):
            # Get the name of the .binary file we want to load to the Propeller
            fname = filedialog.askopenfilename(title = "Select a .binary file", filetypes = [("Binary files","*.binary")])
            self.binary_filename.set(fname)
    
        def run_proploader(self):
            try:
                # Ensure there is no existing terminal open
                self.kill_proploader()
                # Launch proploader with a terminal
                self.proc = subprocess.Popen(['proploader', '-T', '-p', '/dev/cu.usbserial-A504G07R', self.binary_filename.get()], shell=False)
            except:
                pass
    
        def kill_proploader(self):
            if self.proc:
                subprocess.call(["kill", "-9", "%d" % self.proc.pid])
                self.proc = None
    
    root = Tk()
    my_gui = ProploaderGUI(root)
    root.mainloop()
    
  • Does anyone know if Propeller Tool works under Parallels?
  • YES! The Propeller Tool works under Parallels Desktop on Mac OS High Sierra. Download to RAM/EEPROM works, and even the function keys work. Parallel Serial Terminal works like a charm. Given I couldn't get any of this working at all on an old Windows 7 machine (the usual byzantine driver problems), I am as amazed as I am delighted.

    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?
  • I'd like that solution as "official", except for a couple of issues. One is that I usually use a MacBook Air for its portability, and its solid state drive would be stretched with all the overhead. Second is that the Propeller Tool, fine as it is, does not cull unused methods, so development of larger applications can suffer growing pains. Given the official official success of PropGCC and SimpleIDE, I do hope that the serial port issues with PropllerIDE can be resolved.

    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?
  • I'd like that solution as "official", except for a couple of issues. One is that I usually use a MacBook Air for its portability, and its solid state drive would be stretched with all the overhead. Second is that the Propeller Tool, fine as it is, does not cull unused methods, so development of larger applications can suffer growing pains. Given the official official success of PropGCC and SimpleIDE, I do hope that the serial port issues with PropllerIDE can be resolved.

    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 is not just propeller-load with a different name. It is a different loader entirely that can load a Propeller over wi-fi with a Parallax WX wi-fi module. It can also load over a serial link. However, it does not support XMM loading.

  • Jim_ArlowJim_Arlow Posts: 37
    edited 2018-06-13 19:18
    If you just type

    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!
  • "does not cull unused methods", isn't it the Spin compiler that creates the .binary file that does that? That's usually a compiler job rather than an IDE job. Excuse my ignorance, I'm new to Propeller, so I don't really know how it all works yet.
  • kwinnkwinn Posts: 8,697
    Jim_Arlow wrote: »
    "does not cull unused methods", isn't it the Spin compiler that creates the .binary file that does that? That's usually a compiler job rather than an IDE job. Excuse my ignorance, I'm new to Propeller, so I don't really know how it all works yet.

    The Propeller Tool is an all in one IDE/compiler/downloader.
  • I have the SimpleIDE, v1.1.0, running on the Mac, and it loads the whack-a-mole demo perfectly into a quickstart board.

    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?
Sign In or Register to comment.