Flexible IoT gateway for intelligent tank level monitoring