Can't create serial port (MacOS) [SOLVED]


#41

So I modified tinyprog/init.py get_ports() to just dump everything usb.core.find() can give out, and it did not list 1d50:6130 at all.

I plugged in a FTDI board I had and it’s product ID did show up after I disconnected the tiny bx. Also, the FTDI board shows up as device class 0x0 (Unspecified).

Does osx need a kext/driver for this board in order to do anything with it as a “Communications Device”? I have never programmed anything for USB before so I certainly don’t know.


#42

You’re close, but that’s not quite the issue. Modify the following lines from tinyprog/__init__.py:

    # MacOS is not playing nicely with the serial drivers for the bootloader
    if platform.system() != "Darwin":
        # get serial ports first
        ports += [SerialPort(p[0]) for p in comports() if device_id in p[2].lower()]

Change it to:

    # MacOS is not playing nicely with the serial drivers for the bootloader
    if True:
        # get serial ports first
        ports += [SerialPort(p[0]) for p in comports() if device_id in p[2].lower()]

There’s a specific version of MacOS that changed this behavior. Earlier versions attach the correct driver, later versions refuse to attach the driver. I need to track down the exact version and automatically do this.


#43

So what versions MacOS do work with tinyprog? El Capitan (10.11.6) doesn’t seem to work with tinyprog 1.0.17 either. I was able to use Vmware+Windows7+tinyprog and that does work, but is very slow on my 10+ year old iMac.


#44

If it doesn’t work without any command line options then use the —pyserial option. I’m still trying to figure out exactly which versions of MacOS require pyserial and which ones require libusb.


#45

So I tried getting some debug info out of libusb with:

export LIBUSB_DEBUG=4
tinyprog -l

And there was much debug output. The interesting line was:

[73049344.000000] [00000a0b] libusb: warning [darwin_cache_device_descriptor] could not retrieve device descriptor 1d50:6130: transaction timed out (e0004051). skipping device

After some googling, e0004051 looks like it’s a “Bulk Read Error”.

Is there any other suggestions on getting tinyprog to see the BX board under OSX El Capitan?


#46

Did you try running with “tinyprog -l —pyserial”?


#47

That --pyserial doesn’t work either.

The only thing that worked was using Windows 7 instead. The board shows up right away and it can be programmed, so I do have a work around.


#48

Hi @lukevalenty. Using libusb is a great idea, but I prefer to solve serial interface issues in MacOS because there are other boards also using serial interfaces.

I found this installer for MacOS: https://github.com/adrianmihalko/ch340g-ch34g-ch34x-mac-os-x-driver. @eglinz could you try installing this driver and executing “tinyprog -l --pyserial”? The Arduino community uses this installer to setup serial drivers on https://github.com/adrianmihalko/ch340g-ch34g-ch34x-mac-os-x-driver/blob/master/CH34x_Install_V1.3.pkg. If this works for you I’ll include it in the apio drivers command. Thanks.

Update: also found https://github.com/mgp25/USB-Serial-Drivers-macOS