Author Topic: DigisparkCDC: Unable to access serial with Mac OS X 10.11.3  (Read 7305 times)

StronglyWordedTOS

  • Newbie
  • *
  • Posts: 7
DigisparkCDC: Unable to access serial with Mac OS X 10.11.3
« on: March 18, 2016, 05:31:21 pm »
I've been trying to get my new digispark up and running on my Mac but having issues. I've been able to program it with the Arduino IDE on a 10.11.3 machine and can confirm many of the examples work. However, I can't get the DigisparkCDC examples working, specifically when I try to connect to the virtual serial port with Mac OS X 10.11.2 El Capitan. Any help would be appreciated.

Here's the basic setup:
  • I program the digispark with the CDC_LED program (unmodified, Model A so pin #1 is the LED). No issues or errors when programming.
  • I unplug the digispark and plug it back in.
  • The arduino shows a new serial port, '/dev/cu.usbmodemXXXXXX' and '/dev/tty.usbmodemXXXXXX' (last X's seem to depend on machine I plug it into)
When I search for the devices in the terminal, they show up in /dev/:
Code: [Select]
ls -la /dev/*.usbmodem*
crw-rw-rw-  1 root  wheel   17,  23 Mar 18 16:43 /dev/cu.usbmodemXXXXXX
crw-rw-rw-  1 root  wheel   17,  22 Mar 18 16:43 /dev/tty.usbmodemXXXXXX

Every time I try to access the Serial Monitor in the Arduino IDE, I get the following error:
Quote
Error opening serial port '/dev/cu.usbmodemXXXXXX'. (Port busy)

When I try to access the port with CoolTerm, I get the following error:
Quote
An Error Occurred while attempting to open the port. 100: Access Denied

If I try to connect with "screen /dev/cu.usbmodemXXXXXX 19200" I get:
Quote
Cannot open line '/dev/cu.usbmodemXXXXXX' for R/W: Resource busy 
Sorry, could not find a PTY.

"lsof | grep usbserial" returns nothing, so the port doesn't appear to be in use.

I've also tried the following (which did not change any of the above):
Code: [Select]
sudo mkdir /var/lock
sudo chmod 777 /var/lock

Any ideas??? My Google-fu has turned up nothing and I've spent far too much time trying to figure this out... I'm not sure if it's an issue with the DigiCDC or my El Cap machines. NOTE: the serial monitor works with the exact same digispark on a Mac OS X 10.8 machine with CoolTerm, but still does not work with 10.11.3.
« Last Edit: March 18, 2016, 07:07:38 pm by StronglyWordedTOS »

StronglyWordedTOS

  • Newbie
  • *
  • Posts: 7
Re: DigisparkCDC: Unable to access serial with Mac OS X 10.11.3
« Reply #1 on: March 28, 2016, 03:01:38 pm »
Just wanted to follow up that I've had no difficulties with the [edit]CDC USB[/edit] examples and can communicate back/forth with the digispark using Python. Still no luck with the USB serial though...
« Last Edit: June 08, 2016, 10:09:09 am by StronglyWordedTOS »

gerardwr

  • Newbie
  • *
  • Posts: 2
Re: DigisparkCDC: Unable to access serial with Mac OS X 10.11.3
« Reply #2 on: June 05, 2016, 05:16:30 am »
I experience the same problem as @StronglyWordedTOS.

The Digispark examples DigiSparkCDC/CDC-LED and DigiSparkCDC/Print worked fine under Mac OS X Yosemite/Mavericks, but fail under El Capitan.

Same behaviour here: upload of sketches to Digispark work fine, but the Arduino Serial Monitor reports: "/dev/cu.usbmodem3A21" (Port busy)

As far as my research goes the problems seem to be caused by the Apple USB stack that was rewritten in El Capitan. I read many posts in forums about problems with CDC equipment, but no solutions.

Anyone with updated information on a solution, or a workaround?

Thanks.


StronglyWordedTOS

  • Newbie
  • *
  • Posts: 7
Re: DigisparkCDC: Unable to access serial with Mac OS X 10.11.3
« Reply #3 on: June 08, 2016, 10:28:50 am »
gerardwr, I still haven't found a solution. A temporary fix for myself was to DigiUSB and communicate via Python, but this is not ideal for my application. I think Digistump abandoned the codebase once the Chinese counterfeits hit the scene and no-one has taken the time to delve into it to address these new(er) issues.

gerardwr

  • Newbie
  • *
  • Posts: 2
Re: DigisparkCDC: Unable to access serial with Mac OS X 10.11.3
« Reply #4 on: June 09, 2016, 07:11:55 am »
A temporary fix for myself was to DigiUSB and communicate via Python, but this is not ideal for my application.
Yes, i also prefer the Arduino Serial Monitor, so it's a shame that this does not work on El Capitan anymore.

Quote
I think Digistump abandoned the codebase once the Chinese counterfeits hit the scene and no-one has taken the time to delve into it to address these new(er) issues.
The clones are really dirt-cheap, bought some for $1,20 a piece, good quality.

But I assume the problem in El Capitan lies in the Mac software, not in the Digistump software. In Yosemite and Mavericks it worked fine. Apple seems to have rewritten the USB software stack, and this causes problems with many older USB devices. CDC-Serial is one of them.

I read many posts about CDC-Serial problems that popped up in El Capitan, but did not find any solutions or workaround.

I think we have to forget CDC-Serial in El Capitan for now :-(

StronglyWordedTOS

  • Newbie
  • *
  • Posts: 7
Re: DigisparkCDC: Unable to access serial with Mac OS X 10.11.3
« Reply #5 on: June 09, 2016, 09:28:30 am »
To clarify, I don't think that the issue was explicitly caused by the Digistump code; however, there does not appear to be anyone actively maintaining the Digispark codebase, meaning that when issues arise (such as the El Capitan incompatibility), there is nobody on their team to fix it. That being said, someone with a bit more background and experience (than myself) could always fork the code on Github and potentially fix the issue.