Problem with read characteristics

I've been working on this issue for weeks now, but today made a breakthrough, with a reproducible cause.

It's analogRead() which is to blame. I tried all 6 pins and the result is the same. If I make a call to analogRead(), then reading characteristics doesn't work.

In the same code, commenting out the call to analogRead() makes the problem goes away.

cheers,
Richard