Robotic swarms offer flexibility, robustness, and scalability. For successful operation they need appropriate communication strategies that should be dynamically adaptable to possibly changing environmental requirements. In this paper we try to achieve this through evolving communication on-the-fly. As a test case we use a scenario where robots need to cooperate to gather energy and the necessity to cooperate is scalable. We implement an evolutionary algorithm that works during the actual operation of the robots (on-line), where evolutionary operators are performed by the robots themselves (on-board) and robots exchange genomes with other robots for reproduction (distributed). We perform experiments with different cooperation pressures and observe that communication strategies can be successfully adapted to the particular demands of the environment. © 2012 Springer-Verlag.