Serial data on snow leopard

Hey, so I need to do some more research here, but I wanted to start a thread to explain a problem I'm having with my beatseqr project and my arduino mega. (http://beatseqr.com)

I upgraded to snow leopard (mac os x 10.6.1) and now my serial data stream is grinding to a halt after a short amount of time. Like I said, I need to measure the problem more thoroughly in order to speak coherently about the problem, but here's what I know so far:

  • the cocoa app that I've written uses a library to deal with the serial data. it's called AMSerial (and I should probably email that guy to ask if he's seen any problems with other snow leopard implementations)
  • when I launch my app, all is well, the app is responsive.
  • when I ask the app to bring up a list of serial devices, assuming you've upgraded to the FTDI drivers, it works fine, I can see the device name.
  • then I connect to my arduino mega, and the program I've written for the mega starts querying the circuit for data to send, and begins to do so at 57600bps.
  • my app has a running text box that displays the raw incoming data, and it appears to be working for about 2 seconds
  • after about 2 seconds, it begins to become progressively less and less responsive to the point of locking up the entire branch of my USB tree... so that means if I have it connected to my external keyboard, the keyboard and mouse connected to it become unresponsive.
  • My CPU does not peg or otherwise seem to be overtaxed at all.
  • unplugging my arduino mega will, obviously and correctly, illicit a warning dialog saying "Hey, I had a device connected that was sending data, and that's dangerous to the data"
  • that branch of the overall USB bus is thereafter poisoned... unplugging and replugging doesn't revive the bus. If you're using the USB port directly from the macbook, the macbook keyboard becomes unresponsive. The power button does seem to work, as in if you hit the power buttons once, it brings up the "sleep, reboot, turn off" options... however, since the keyboard and trackpad are dead at that point, a cold reboot is required by holding the power key until it turns off.

And that's what I know so far. I had a SuperDuper! backup of my leopard install, so i was able to restore my hard drive to my pre-snow leopard state, so development can continue while I try to get some help.

Weird. I guess you can't test other things now, but I'd be curious if you'd get the same behavior using something like screen to watch the incoming data.

Hey, i got the same problem: I’d like to read data from my Arduino, but all i use is just call a NSTask with cat /dev/cu.usbXXX, which gives me output for about 5 seconds and then about 30s later, the keyboard and trackpad of my macbook pro don’t respond anymore. i still can use my usb mouse&keyboard, so i can log out and do the login from the osx panel and the input devices work again.
I’ve tried several way of doing this:

Cint main(int argc, char *argv[])
{
      NSAutoreleasePool *pool = [NSAutoreleasePool new];
      NSString *path = [@"/dev/cu.usbserial-A9007VLR" stringByStandardizingPath];
      
      NSMutableData *data = [NSMutableData data]; 
      uint8_t buffer[1024];
      
      NSInputStream *stream = [NSInputStream inputStreamWithFileAtPath:path]; 
      [stream open]; 
      sleep(100);
      while ([stream hasBytesAvailable]) {
            NSUInteger len = [stream read:buffer maxLength:1024]; 
            NSLog(@"%i Bytes read", len); 
            [data appendBytes:(const void *)buffer length:len];
      }
      
      [stream close]; 
      NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
      NSLog(@"%@", string);      
      
      
      [pool drain];
      
      
}

nor did the example from the post http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1243282360/0 by docmobius, the getline-function isn’t defined.

So, did anyone manage to get the serial communication between Arduino and a Mac (10.6/Snow Leopard) to work? I’d really be interested =)

cheers