For every Hilbert bimodule over a C*-algebra, there are natural gauge actions of the circle on the associated Toeplitz algebra and Cuntz–Pimsner algebra, and hence natural dynamics obtained by lifting these gauge actions to actions of the real line. We study the KMS states of these dynamics for a family of bimodules associated to local homeomorphisms on compact spaces. For inverse temperatures larger than a certain critical value, we find a large simplex of KMS states on the Toeplitz algebra, and we show that all KMS states on the Cuntz–Pimsner algebra have inverse temperature at most this critical value. We illustrate our results by considering the backward shift on the one-sided path space of a finite graph, where we can use recent results about KMS states on graph algebras to see what happens below the critical value. Our results about KMS states on the Cuntz–Pimsner algebra of the shift show that recent constraints on the range of inverse temperatures obtained by Thomsen are sharp.