When attempting to connect to an iPhone 4s running iOS 7, we kept getting the error message "Could not connect to the device" or "iTunes could not connect to this iPhone. The device does not recognize this host." This post has a solution which worked for us.
The annoying "Trust This Computer" dialog
One thing that kept popping up on the iPhone was the "Trust This Computer" dialog. Tapping "Trust" didn’t do anything, nor did restarting my MacBook Pro, the iPhone, plugging and unplugging, trying different USB ports, or trying a different MacBookPro. Every time we plugged it in, we’d get the same error on the Mac and the same trust this computer dialog on the iPhone.
The solution: untrust all computers
It turned out that making the iPhone untrust all computers fixed the problem and iTunes was then able to connect to the iPhone to make a backup, etc. The Apple support pages suggest you can only do this from iOS 8 or later, but it worked for me on iOS 7.
Go Settings -> General -> Resert -> Reset Location & Privacy -> Reset Settings.
This worked for me. Hopefully if you have the same issue it works for you.
(And for the record, although I use Apple laptops, I’ve never used an iPhone myself; this was my wife’s old iPhone and we needed to extract some data from it to load onto her new Samsung.)