Arduino does not boot... sometimes?!?

Try and narrow down where it gets stuck.
When you open the serial monitor, do your Serial.prints & writes work?
Is the code actually making it to the last line of setup?
Use the output LED as a test point too.
move the
pinMode(ledPin,OUTPUT);
farther up in setup.
Do things like after every library call make it blink on for a half second, off half second, see where the problem is.