  Wireless Sensor Networks (WSNs) are composed of low powered and
resource-constrained wireless sensor nodes that are not capable of performing
high-complexity algorithms. Integrating these networks into the Internet of
Things (IoT) facilitates their real-time optimization based on remote data
visualization and analysis. This work describes the design and implementation
of a scalable system architecture that integrates WSNs and cloud services to
work autonomously in an IoT environment. The implementation relies on Software
Defined Networking features to simplify the WSN management and exploits data
analytics tools to execute a reinforcement learning algorithm that takes
decisions based on the environment's evolution. It can automatically configure
wireless sensor nodes to measure and transmit the temperature only at periods
when the environment changes more often. Without any human intervention, the
system could reduce nearly 85% the number of transmissions, showing the
potential of this mechanism to extend WSNs lifetime without compromising the
data quality. Besides attending to similar use cases, such a WSN autonomic
management could promote a new business model to offer sensing tasks as a
service, which is also introduced in this work.
