Access to modern energy services should be universally available by 2030. This is a goal of the United Nations. A promising approach to deliver on this commitment is based on microgrids that coordinate power generation, storage and usage in a local community. Microgrids constitute an attractive option in the presence of abundant renewable energy sources, and in the absence of robust transnational power grid infrastructure. An important problem is then to design cheap, resilient and configurable microgrids that can be assembled from off-the-shelf components and managed by non specialists. In this paper, we introduce COSMGrid, a microgrid platform based on commodity hardware and open source, open protocol software. The design of COSMGrid relies on a network of microcontrollers that monitor and control stand-alone power generation and storage nodes. As a result, COSMGrid can readily integrate existing stand-alone photovoltaic installations. COSMGrid can be configured based on the characteristics of the power electronics hardware that is available, or based on the power sharing policies agreed upon by a community of end-users. It is an important step towards a popular, open microgrid solution that can be appropriated by local communities in developing regions.