If you're anything like me, then I'm afraid I've got some bad news for you.
There's no solution.
Some people it seems just can't sleep on flights.
I've tried sleeping pills (I'd have been better off popping Smarties for all the good they did), used inflatable pillows, earplugs, tried all sorts of remedies that worked for others, but I have never managed more than an hour's sleep on a flight (and that was in Business Class with a flat bed style seat - I normally don't get a single wink in an Economy seat). I've even got myself so tired that I actually needed to sleep (basically stayed up far too long) and felt that I was about to drop off in the terminal, yet still couldn't actually fall asleep once I was on the plane.
But then with me it's not just planes - I can't fall asleep on any sort of transport (trains, cars etc.) or public places. I think it's that there's too much background noise that does me in. Even with noise cancelling headphones I still notice it.
So now I've just given up and go completely the opposite way. I'll try and get a nap before flying, then afterwards dose myself up on caffine and provide myself with plenty of entertainment for the flight to keep myself wide awake during it and hopefully for the few hours between the airport and home.