Thanks for the suggestions.
Unfortunately, nothing in the field of view is in focus The camera shouldn't be getting that badly confused by near and far objects. If autofocus is working, at least something should be in focus, and if not, it seems to me there is a problem with the hardware or...