Monitoring Wireless Sensor Networks (WSNs) are composed of sensor nodes that report temperature, relative humidity, and other environmental parameters. The time between two successive measurements is a critical parameter to set during the WSN configuration because it can impact the WSN's lifetime, the wireless medium contention and the quality of the reported data. As trends in monitored parameters can significantly vary between scenarios and within time, identifying a sampling interval suitable for several cases is also challenging. In this work, we propose a dynamic sampling rate adaptation scheme based on reinforcement learning, able to tune sensors' sampling interval on-the-fly, according to environmental conditions and application requirements. The primary goal is to set the sampling interval to the best value possible so as to avoid oversampling and save energy, while not missing environmental changes that can be relevant for the application. In simulations, our mechanism could reduce up to 73 the total number of transmissions compared to a fixed strategy and, simultaneously, keep the average quality of information provided by the WSN. The inherent flexibility of the reinforcement learning algorithm facilitates its use in several scenarios, so as to exploit the broad scope of the Internet of Things.
 Wireless sensor networks (WSN) are extensively applied in civil and military areas. Localization is an essential prerequisite for many WSN applications, and is often based on beacons that provide geographical information in real time. Mobile Beacons (MB) can be used to replace many static beacons with paths that can be controlled in real-time. Robotic and or flight vehicles can work as MBs. In this paper we consider the use of reinforcement learning (RL) (a significant branch of machine learning) to control MBs. Usually, RL needs an infinite series of episodes to determine an optimal policy. We propose however a method of localization employing mobile beacon whose behavior will be controlled by an adapted RL algorithm. A MB learns and makes decisions based on weighted information collected from unknown sensors. Simulation results show that the adapted RL algorithm provides sufficient information to the MB to localise unknown sensors in a lightweight but effective way. Classical routing protocols for WMNs are typically designed to achieve specific target objectives (e.g., maximum throughput), and they offer very limited flexibility. As a consequence, more intelligent and adaptive mesh networking solutions are needed to obtain high performance in diverse network conditions. To this end, we propose a reinforcement learning-based routing framework that allows each mesh device to dynamically select at run time a routing protocol from a pre-defined set of routing options, which provides the best performance. The most salient advantages of our solution are: i) it can maximize routing performance considering different optimization goals, ii) it relies on a compact representation of the network state and it does not need any model of its evolution, and iii) it efficiently applies Q-learning methods to guarantee convergence of the routing decision process. Through extensive ns-2 simulations we show the superior performance of the proposed routing approach in comparison with two alternative routing schemes.