Getting "disk not ejected properly" in OSX

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
blmorris
Posts: 348
Joined: Fri May 02, 2014 3:43 pm
Location: Massachusetts, USA

Re: Getting "disk not ejected properly" in OSX

Post by blmorris » Wed Sep 03, 2014 1:50 am

Hi Dave- thanks (again!) for offering to help. The Beagle 12 is at the office, I would be happy to send you a capture to have a look at. As I said, when I tried before nothing really jumped out at me, but I really don't know what to look for.
The software you need is Total Phase's Data Center, which is available for free and which will allow you to look at a data capture without having any of their analyzer devices connected. You can download from http://www.totalphase.com/products/data-center/ but you will need to register first to download. They have v6.61 and v2.20 available for download; I haven't figured out why except that maybe 2.20 is the last version to support some older operating systems.
(The Data Center software is also cross-platform, available for Windows, Linux and OSX. I give Total Phase credit for understanding that putting barriers up against using their products doesn't make their them more useful to anyone. I'll also give a shout to Salaea for the same positive qualities before getting off my soapbox…)
I can put the capture up on Google Drive, or on another service if you prefer. Do you have any suggestions for conditions to test? I would plan to capture a full sequence- plug in, open and maybe save a file, open the REPL to demonstrate that it works, and then try to unmount after a short time (when it should work correctly) and then repeat the same sequence, this time waiting about 5 minutes before unmounting, when it should be expected to fail. Any other suggestions?

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

Re: Getting "disk not ejected properly" in OSX

Post by dhylands » Wed Sep 03, 2014 2:12 am

blmorris wrote:Hi Dave- thanks (again!) for offering to help. The Beagle 12 is at the office, I would be happy to send you a capture to have a look at. As I said, when I tried before nothing really jumped out at me, but I really don't know what to look for.
The software you need is Total Phase's Data Center, which is available for free and which will allow you to look at a data capture without having any of their analyzer devices connected. You can download from http://www.totalphase.com/products/data-center/ but you will need to register first to download. They have v6.61 and v2.20 available for download; I haven't figured out why except that maybe 2.20 is the last version to support some older operating systems.
(The Data Center software is also cross-platform, available for Windows, Linux and OSX. I give Total Phase credit for understanding that putting barriers up against using their products doesn't make their them more useful to anyone. I'll also give a shout to Salaea for the same positive qualities before getting off my soapbox…)
I can put the capture up on Google Drive, or on another service if you prefer. Do you have any suggestions for conditions to test? I would plan to capture a full sequence- plug in, open and maybe save a file, open the REPL to demonstrate that it works, and then try to unmount after a short time (when it should work correctly) and then repeat the same sequence, this time waiting about 5 minutes before unmounting, when it should be expected to fail. Any other suggestions?
That seems like something reasonable to start with.

It would be good if you could use a stop watch to give a rough time for when you did each thing (start, copy file, do eject).

gmail lets me have huge attachments (10+ Mb). GoogleDrive or DropBox is fine, or if need be I can set you up with an ftp account on one of my hosting accounts.

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

Re: Getting "disk not ejected properly" in OSX

Post by blmorris » Wed Sep 03, 2014 2:26 am

Yes, I will be sure to keep track of the timing of the different events as well. Sounds like a plan.

LarryTru
Posts: 26
Joined: Wed Aug 06, 2014 5:46 am

Re: Getting "disk not ejected properly" in OSX

Post by LarryTru » Sun Sep 07, 2014 5:44 pm

Hello,

Any results from the USB trace?

Larry

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

Re: Getting "disk not ejected properly" in OSX

Post by dhylands » Sun Sep 07, 2014 8:00 pm

I've got it but haven't had a chance to look at it yet.

robbie
Posts: 3
Joined: Sat Aug 16, 2014 12:25 am

Re: Getting "disk not ejected properly" in OSX

Post by robbie » Sat Sep 13, 2014 3:42 pm

I've been having this problem since receiving my pyboard. Originally I thought it might be related to the SD card issue, but a lot of poking and the recent patches seem to have resolved that separately. Also the problem seems to occur with both the internal storage and SD cards alike. Often the pyboard appeared to be mounted but accessing files via USB would cause the process to hang. On at least two occasions pulling the USB cable at this point caused a kernel exception.

The latest clue is that since disabling disksleep there's been no problems, although I haven't had a chance to test for more than a few hours. Perhaps there's an issue between how the USB driver and the pyboard handle standby mode?

LarryTru
Posts: 26
Joined: Wed Aug 06, 2014 5:46 am

Re: Getting "disk not ejected properly" in OSX

Post by LarryTru » Sun Sep 14, 2014 2:53 am

Hello,

I've always felt it might have something to do with "standby". But I could't tie it to that specifically. What is "disksleep" and how do I disable it? do you mean "put hard disls to sleep when possible" found in "energy saver" in "settings"?

Larry

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

Re: Getting "disk not ejected properly" in OSX

Post by blmorris » Sun Sep 14, 2014 3:20 am

robbie wrote:The latest clue is that since disabling disksleep there's been no problems, although I haven't had a chance to test for more than a few hours. Perhaps there's an issue between how the USB driver and the pyboard handle standby mode?
I just tried that, disabling disksleep, and found that I was able to cleanly unmount the pyboard after 15 minutes, which would always hang before.
LarryTru wrote:What is "disksleep" and how do I disable it? do you mean "put hard disks to sleep when possible" found in "energy saver" in "settings"?
That may be one way to do it; I found the following command to do it:

Code: Select all

sudo pmset -a disksleep 0
Reference: http://www.thexlab.com/faqs/harddrivesleep.html

Anyway, this seems very promising. Thanks @robbie! Going to sleep now, but will test this more thoroughly tomorrow.

-Bryan

LarryTru
Posts: 26
Joined: Wed Aug 06, 2014 5:46 am

Re: Getting "disk not ejected properly" in OSX

Post by LarryTru » Sun Sep 14, 2014 9:21 am

Hello,

From what I've read, flash drives (which I assume the Micro Python emulates) shouldn't be impacted by or react to a "disk standby". Pure speculation, but maybe the Micro Python board is treating a "standby" condition like it is an "eject". Alternately, if there is a "active" condition after a "standby", maybe it isn't responding as expected.

Larry

robbie
Posts: 3
Joined: Sat Aug 16, 2014 12:25 am

Re: Getting "disk not ejected properly" in OSX

Post by robbie » Sun Sep 14, 2014 9:48 pm

@blmorris Yes that's the setting I was referring too. Toggling the "put hard disks to sleep when possible" setting has the same effect.

@larrytru I assumed so too, but SanDisk's SD Card manual mentions that (at least for their cards) there is a deep sleep mode activated by the host shutting down the clock. Maybe for SD cards disksleep tries to trigger something along these lines? Equally it could be just a coincidence.

Post Reply