Tried an DFU Restore of iOS 10, same issue. After a RESTORE it worked for a few seconds, maybe a minute, but then the compass stopped working. If I shut it down and leave it off for few minutes and then starting it up, the compass works as well for a minute or so, but then stops working. Even with 9.3.5 I get the same problem. Both without the backup. Any ideas? Probably a temperature issue?