Hi there Harry, I probably am not much help, but I also get the headaches while I am sleeping. Mine turned out to be Fybromyalgia and arthritis of the neck. I took a lot of Ibuprofen 800mg for the headache. Usually one would do it, for a while anyway, but sometimes I would take no more than 4 to 5 in a day. I am now on other meds for all this so my ibuprofen intake is way down.