The wastewater treatment plant that I toured in Urbana a few years ago was using biogas (digested from "solids") and an industrial genset to partially provide for their own energy needs.
I'm not sure how optimized the plant is for biogas production. It seems like it was mostly optimized for releasing effluent which matches the EPA specifications, and the plant staff has a professional pride in how well they do that. I did leave wondering how much change would be required to make the plant able to provide for its own energy needs -- but, given what they have and how well it works for treating wastewater, and given the costs of the improvements they'd put in recently (2009-ish?), Urbana taxpayers would have to provide 10 or 20 of million of dollars to make any meaningful changes in that direction.
-Luke