rwaldron / johnny-five

JavaScript Robotics and IoT programming framework, developed at Bocoup.
http://johnny-five.io
Other
13.26k stars 1.76k forks source link

Kernel Panic #176

Closed asherraz closed 11 years ago

asherraz commented 11 years ago

I was at the Nodebots event in SF today, and used Johnny Five for the first time. After it not working when running the JS file, I tried to ctrl^c and it said that it was exiting out of Firmata, Serialport... Yet it wouldn't exit though to a new command line, so after a few minutes I went ahead and manually exited Terminal, and wow it sent my Mac kernel into panic mode and I had to manually shut off the computer! That's crazy! Then when I turned it back on, my computer wouldn't boot up! Luckily someone much smarter than me was there to help me boot into the terminal (CMD+S upon startup) and clear some stuff out. My Mac has never done that in 3 years.

Later, I realized I hadn't loaded StandardFirmata on the Arduino, but still that is a pretty serious issue and I'm surprised no one else has encountered it. And now I'm scared to try it again with StandardFirmata loaded on the Arduino.

Can you confirm this was clearly the reason my kernel was sent into panic mode and that it won't happen now that StandardFirmata is loaded on my Arduino?

And if this is that important to have Firmata loaded on, otherwise it will send the kernel into panic mode, that should be in big bold letters on the Readme rather than the fourth bullet point under Setup and Assemble Arduino.

Thanks

divanvisagie commented 11 years ago

Thats a very interesting scenario, the worst I've ever had is a freeze up , but that was a special case board and actually seemed to be a firmata+driver issue. would you mind telling us what board you are using? It may seem like an irrelevant question but there can be surprises.

asherraz commented 11 years ago

Sure, it was an Arduino Uno. I had a basic custom sketch loaded on it that I can send you, which may have been the issue?

Also to give you all the details:

1) I'm running OSX 10.6.8

2) I cloned Johhny-Five, did the npm install, then the npm install johnny-five, and wrote up the basic example in a .js file.

3) I ran it once, got a few messages up indicating it was working, but the LED didn't strobe. So I did ctrl+c, and it said it was stopping firmata, serialport...

4) I waited a minute and didn't get a new command line, so I hit ctrl+c a few more times, typed exit, and then manually exited Terminal, and when I did, this screen popped up: http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/TS3742/en_US/TS3742_01_KP-001-en.jpg

5) I manually shut down the computer. Then turned it back on and it booted up.

6) I went back into Terminal and tried again, same thing happened. This time when I tried to turn back on the computer it wouldn't load (stayed at the faint blue screen without the logo showing up). So I shut if off again and then did cmd+s on starting up to get into the terminal. Someone typed in some commands that cleared out 4 of something. Then booted it back up.

divanvisagie commented 11 years ago

Thanks for the info , will try see if I can replicate the problem at home , there is weird behavior with boards that don't have firmata, never heard of anything this bad though.I suspect this may have to be forwarded on to either the firmata or serial port repos.

reconbot commented 11 years ago

The serial port drivers are usually the cause of problems like this. The ftdi chipsets are particularly problematic but I've seen trouble with others too. On Jul 28, 2013 8:36 AM, "Divan Visagie" notifications@github.com wrote:

Thanks for the info , will try see if I can replicate the problem at home , there is weird behavior with boards that don't have firmata, never heard of anything this bad though.I suspect this may have to be forwarded on to either the firmata or serial port repos.

— Reply to this email directly or view it on GitHubhttps://github.com/rwldrn/johnny-five/issues/176#issuecomment-21682849 .

divanvisagie commented 11 years ago

@gmon01 Ive attempted to replicate your issue to no avail, though I do have a newer os. Would you happen to have any non standard drivers installed worth mentioning? as @reconbot said , its probably a driver thing so any info could help pin this down. are you running node 0.10.x ? I know I have an ftdi driver installed , but that could be why I dont get any issues.

When i say no avail i mean no kernel panic. i did get a term freezup however when i tried exiting but this didnt seem very agressive as a good C+z and killall -9 node fixed that

asherraz commented 11 years ago

Cool, I'm running Node v0.10.13

I haven't installed any non standard drivers that I know of. Do you know of a way to check? I just spent some time researching this and all I could come up with is looking in the system/library/extensions folder. I'm not sure what I'd be looking for, but nothing seemed out of the ordinary.

On the c+z and then killall -9 node, were you given a new command line prompt?

After I did ctrl+c, I was allowed to continue typing on the next line, but I wasn't given a new prompt (i.e mac:/ user$). I'm clearly a novice here, so forgive me for not using the right terminology.

Hmm I really want to get back to trying this but I'm nervous it will send it into panic mode again.

rwaldron commented 11 years ago

@reconbot covered the technical, so I'll touch on the emotional... The first kernel panic I experienced was terrifying (imagining the worst kind of irreparable harm), but when I rebooted and everything was ok, I was less scared. My Mac kernel panics at least twice a week, so I'm used to it now. The point is that you shouldn't be afraid :) have fun!

divanvisagie commented 11 years ago

@rwldrn , I hope you have an ssd or sitting through reboots must be a long wait. I think @gmon01 's concern is that someone had to run some commands to get his working again if i'm not mistaken. Just a random piece of info , i have a Spider controller with some dodgy ftdi drivers that freeze all of my input devices so I proxy that by using a raspberry pi , just saying if you are that scared, there is that. Personally though the more excuses I can rack up for this the better I feel.

rwaldron commented 11 years ago

No ssd, I suffer ;)

Next one though...

asherraz commented 11 years ago

Yeah, that's the issue. It not rebooting after I turn it off and then back on. Seems serious.

rwaldron commented 11 years ago

Can you confirm this was clearly the reason my kernel was sent into panic mode and that it won't happen now that StandardFirmata is loaded on my Arduino?

...and...

there is weird behavior with boards that don't have firmata,

I doubt these were ever related—a board without Firmata won't cause a kernel panic. If that were the case, any time anyone connected to an Arduino and did read/write in the serial terminal, there might be a kernel panic.

asherraz commented 11 years ago

This is the basic custom sketch I had loaded on the Arduino at the time (which I used to communicate with a Node server I wrote using only Serialport): https://github.com/sensa/sensa.io/blob/master/sensread/sensread.ino

Maybe including the SoftwareSerial library had something to do with it? Thought I'd throw it out there.

asherraz commented 11 years ago

I have replicated this Kernel Panic by disconnecting a FTDI USB TTL serial cable from my Mac during a live session with a Raspi. This is what @reconbot mentioned initially. However, it is important to note that at the time of when I had the initial panic and started this thread I had never installed or done anything with a serial port driver.