This paper presents the modelling and implementation of two different strategies for scheduling the DERs using mixed-integer linear programming and quadratic programming in a multi-prosumer grid-connected microgrid. Each prosumer has its own battery-based ESS with various capacities. The proposed strategies were implemented as a real-time energy management system in an experimental laboratory Microgrid based on a rolling horizon scheme. The equalization of the ESSs` state of charge is achieved in both cases but there is a compromise between cost and execution time. Meanwhile, the IoT-based smart meter allows the EMS to react in real-time to mismatches between predicted and actual load.