OSX device not listed

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
TheRegnirps
Posts: 8
Joined: Thu Feb 13, 2014 6:20 am

OSX device not listed

Post by TheRegnirps » Fri Jun 13, 2014 12:28 am

A search for OSX here in the forum only shows difficulty with USB cables and getting the pyboard to appear as a drive.

That works fine for me. However, the first thing in the tutorial is to use an OSX terminal and screen /dev/usb.modem*
My/dev does not show any USB devices that might be the pyboard, and dmesg shows failures to make connections (but the volume noname shows on the dedsktop and I can edit main.py)

Any ideas on getting a terminal going? (Mac Mini 10.5.8 and upgrade is not an option).

I can switch to a Debian box or Ubuntu laptop if I have to, but really want to work with BBEdit.

blmorris
Posts: 348
Joined: Fri May 02, 2014 3:43 pm
Location: Massachusetts, USA

Re: OSX device not listed

Post by blmorris » Fri Jun 13, 2014 3:20 pm

Sorry if this sounds stupid, but have you tried rebooting? I've been playing with Micro Python on a 2007 MacBook Pro; I have found that the USB system can get hung up in such a way that only a reboot can fix. Usually this happens because I wasn't careful to unmount the drive or disconnect the terminal program before unplugging or putting the computer to sleep, sometimes it was because of a hard crash of the Micro Python firmware running on the board. Annoying, because I typically would go months between reboots, but this is the only thing I have found to work. Good luck!
-Bryan

TheRegnirps
Posts: 8
Joined: Thu Feb 13, 2014 6:20 am

Re: OSX device not listed

Post by TheRegnirps » Sat Jun 14, 2014 4:42 am

No love. Restart the Mac. Reset the Pyboard. I can edit main.py in the volume that appears on the desktop and I can eject (unmount) it. But I can not get a REPL prompt. Plus nothing in /dev

Is there firmware called UAC1 or UAC2? There is a history of UAC2 failing on 10.5.8 and 10.6.4

Here are some outputs with potentially useful info.

dmesg gives:

0 0 AppleUSBCDCACMControl: start - Failed to find the CDC driver
AppleUSBCDCACMData: start: InterfaceMappings dictionary not found for this device. Assume CDC Device...
0 0 AppleUSBCDCACMData: start - Find CDC driver failed

System Profiler reports:

USB Bus:

Host Controller Location: Built In USB
Host Controller Driver: AppleUSBUHCI
PCI Device ID: 0x27c9
PCI Revision ID: 0x0002
PCI Vendor ID: 0x8086
Bus Number: 0x3d

Pyboard Virtual Comm Port in FS Mode:

Capacity: 240 KB
Removable Media: Yes
Detachable Drive: Yes
BSD Name: disk3
Product ID: 0x9800
Vendor ID: 0xf055
Version: 2.00
Serial Number: 000000000011
Speed: Up to 12 Mb/sec
Manufacturer: Micro Python
Location ID: 0x3d100000
Current Available (mA): 500
Current Required (mA): 500
Mac OS 9 Drivers: No
Partition Map Type: MBR (Master Boot Record)
S.M.A.R.T. status: Not Supported
Volumes:
NO NAME:
Capacity: 112 KB
Available: 70 KB
Writable: Yes
File System: MS-DOS FAT12
BSD Name: disk3s1
Mount Point: /Volumes/NO NAME

And command line: system_profiler SPUSBDataType

USB Bus:

Host Controller Location: Built In USB
Host Controller Driver: AppleUSBUHCI
PCI Device ID: 0x27c9
PCI Revision ID: 0x0002
PCI Vendor ID: 0x8086
Bus Number: 0x3d

Pyboard Virtual Comm Port in FS Mode:

Capacity: 240 KB
Removable Media: Yes
Detachable Drive: Yes
BSD Name: disk3
Product ID: 0x9800
Vendor ID: 0xf055
Version: 2.00
Serial Number: 000000000011
Speed: Up to 12 Mb/sec
Manufacturer: Micro Python
Location ID: 0x3d100000
Current Available (mA): 500
Current Required (mA): 500
Mac OS 9 Drivers: No
Partition Map Type: MBR (Master Boot Record)
S.M.A.R.T. status: Not Supported
Volumes:
NO NAME:
Capacity: 112 KB
Available: 70 KB
Writable: Yes
File System: MS-DOS FAT12
BSD Name: disk3s1
Mount Point: /Volumes/NO NAME
Volumes:
disk3s1:
Capacity: 112 KB
Available: 70 KB
Writable: Yes
File System: MS-DOS FAT12

milkybar_ton
Posts: 6
Joined: Thu Apr 17, 2014 10:11 am

Re: OSX device not listed

Post by milkybar_ton » Tue Jun 24, 2014 1:40 pm

Hi there,
Also having some problems . Macbook 10.6.8
Open a terminal and
screen /dev/tty.usbmodem*

A message comes up about being unable to as it doesn't exist then it reverts back to the Terminal screen, now with [screen is terminating] under the previous line.

board mounts and ejects ok. have re-booted mac and reset Micropython board

Any help would be appreciated
ta

blmorris
Posts: 348
Joined: Fri May 02, 2014 3:43 pm
Location: Massachusetts, USA

Re: OSX device not listed

Post by blmorris » Wed Jun 25, 2014 2:52 am

milkybar_ton wrote: Open a terminal and
screen /dev/tty.usbmodem*

A message comes up about being unable to as it doesn't exist then it reverts back to the Terminal screen, now with [screen is terminating] under the previous line.
You need to provide the specific device name that the pyboard configures as - the asterisk '*' is just a wild card for a string of numbers and letters.
You can type 'ls /dev/tty.usbmodem*' at the command prompt to get the actual device name.
Depending on which usb port I plug in to on my computer, my pyboard appears as either '/dev/tty.usbmodem1a22' or '/dev/tty.usbmodem1d12'
I would guess that if I connected using a hub I might even get different names, but I haven't tried that yet.

milkybar_ton
Posts: 6
Joined: Thu Apr 17, 2014 10:11 am

Re: OSX device not listed

Post by milkybar_ton » Wed Jun 25, 2014 11:10 am

Thanks for the info, still having problems however

"You can type 'ls /dev/tty.usbmodem*' at the command prompt to get the actual device name." i get a no such file or directory reply to this.

if i df -h then i get

/dev/disk1s1 95Ki 20Ki 75Ki 22% /Volumes/NO NAME -This is my board

I've also tried replacing the tty.usbmodem* part with /disk1s1 but again no joy

Your patience is appreciated
cheers

blmorris
Posts: 348
Joined: Fri May 02, 2014 3:43 pm
Location: Massachusetts, USA

Re: OSX device not listed

Post by blmorris » Wed Jun 25, 2014 11:20 am

There should be two new devices which appear in the /dev tree when you plug in- you are finding the mass storage device but not the serial device (/dev/tty.usbmodem*)
Replying from my phone at the moment, will try figure out what it is when I get to my computer. Meanwhile, can you see what 'dmesg' returns when you plug in your board?

milkybar_ton
Posts: 6
Joined: Thu Apr 17, 2014 10:11 am

Re: OSX device not listed

Post by milkybar_ton » Wed Jun 25, 2014 11:29 am

Hi and thanks for the prompt reply. I get this :-


0 [Level 3] [ReadUID 0] [Facility com.apple.system.fs] [ErrType IO] [ErrNo 6] [IOType Write] [PBlkNum 55] [LBlkNum 55] [FSLogMsgID 1515363706] [FSLogMsgOrder First]
0 [Level 3] [ReadUID 0] [Facility com.apple.system.fs] [DevNode devfs] [MountPt /dev] [Path /dev/disk1s1] [FSLogMsgID 1515363706] [FSLogMsgOrder Last]
disk1s1: media is not present.
0 [Level 3] [ReadUID 0] [Facility com.apple.system.fs] [ErrType IO] [ErrNo 6] [IOType Write] [PBlkNum 43] [LBlkNum 43] [FSLogMsgID 1086214669] [FSLogMsgOrder First]
0 [Level 3] [ReadUID 0] [Facility com.apple.system.fs] [DevNode devfs] [MountPt /dev] [Path /dev/disk1s1] [FSLogMsgID 1086214669] [FSLogMsgOrder Last]
disk1s1: media is not present.
0 [Level 3] [ReadUID 0] [Facility com.apple.system.fs] [ErrType IO] [ErrNo 6] [IOType Write] [PBlkNum 1] [LBlkNum 0] [FSLogMsgID 499150781] [FSLogMsgOrder First]
0 [Level 3] [ReadUID 0] [Facility com.apple.system.fs] [DevNode /dev/disk1s1] [MountPt /Volumes/NO NAME] [FSLogMsgID 499150781] [FSLogMsgOrder Last]
USBMSC Identifier (non-unique): 000000000011 0xf055 0x9800 0x200
0 0 AppleUSBCDCACMControl: start - Failed to find the CDC driver
0 2 AppleUSBCDCACMData: start - Find CDC driver for data interface failed
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
USBMSC Identifier (non-unique): 000000000011 0xf055 0x9800 0x200
0 0 AppleUSBCDCACMControl: start - Failed to find the CDC driver
0 2 AppleUSBCDCACMData: start - Find CDC driver for data interface failed
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)
dos2unixtime(): month value out of range (15)

After i have sudo dmesg. Don't know what any of this means, if you haven't already guessed i'm new to all this ;)
ta

blmorris
Posts: 348
Joined: Fri May 02, 2014 3:43 pm
Location: Massachusetts, USA

Re: OSX device not listed

Post by blmorris » Wed Jun 25, 2014 11:59 am

Your problem is revealed here:
USBMSC Identifier (non-unique): 000000000011 0xf055 0x9800 0x200
0 0 AppleUSBCDCACMControl: start - Failed to find the CDC driver
0 2 AppleUSBCDCACMData: start - Find CDC driver for data interface failed
I had the impression that OS X always had the CDC class driver available, but I'm not an expert in this. I'll try to look into it.

Edited to add: It looks like this is the same issue that the OP for this thread has; one running 10.5.x and one running 10.6.x
Anyone else running older OS X versions seeing the same issue? I am on 10.7 on a machine from 2007 and don't have this problem.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: OSX device not listed

Post by dhylands » Wed Jun 25, 2014 3:25 pm

I did some poking around, and apparently earlier versions of the Apple CDC driver were less tolerant of certain descriptors.

I don't have a Mac to test this with but I found this:
http://www.opensource.apple.com/source/ ... ontrol.cpp
If you search for CM_ManagementData you'll see that they had early returns if the capabilities bits for CM_ManagementData (0x01) or CM_ManagementOnData (0x02) are zero.

It looks like these capabilities bits are defined in the following places (the lines that mention "bmCapabilities: D0+D1")

https://github.com/micropython/micropyt ... cdc.c#L221
https://github.com/micropython/micropyt ... cdc.c#L317
https://github.com/micropython/micropyt ... cdc.c#L409

https://github.com/micropython/micropyt ... hid.c#L104

https://github.com/micropython/micropyt ... _msc.c#L88

https://github.com/micropython/micropyt ... hid.c#L123
https://github.com/micropython/micropyt ... hid.c#L260

Looking in my build directory, I only see the following object file: build-PYBV10/usbdev/class/cdc_msc_hid/src/usbd_cdc_msc_hid.o which would imply that you only need to change stmhal/usbdev/class/cdc_msc_hid/src/usbd_cdc_msc_hid.c (lines 123 and 260).

I'd try changing the 0x00 to be 0x03 and see if that makes any difference.

Post Reply