Design and energy optimization of a multifunctional IoT solution for connected bikes