For refugees and migrants stuck in Greece, a smartphone is a lifeline -- as long as its battery lasts.

But access to electricity can be hard to find in overcrowded camps, nor is it always free in cafes where young and old crowd together over a socket, waiting anxiously to phone home.

A team of students from Edinburgh University is hoping to change that, having designed a mobile phone charging station powered only by the sun -- something Greece has plenty of.

They have installed two units in camps, each configured to generate electricity for 12 plugs an hour using solar energy alone, providing free power to as many as 240 people per unit each day.

The idea was born out of a visit last summer of one of the founders, 20-year-old Alexandros Angelopoulos, to the island of Samos, one of the entry points into Europe for nearly a million people fleeing wars and poverty in the Middle East and beyond.

Hundreds arrived on its shores each day, soaked and exhausted from clinging onto rubber boats from Turkey. Relieved to have made it, they snapped selfies. Others logged on to messaging applications and Google Maps to plan their onward journey to northern Europe.

"People started asking for my phone to call family and to use the internet," Angelopoulos said. Often, they were stranded at the port sharing one plug.

"We just wanted to make a positive contribution to local communities through renewable energy," said co-founder Samuel Kellerhals, 21.

The first two units of Project Elpis -- which means "hope" in Greek -- were designed and built with the help of Greek solar technology company Entec. The pair said they had to overcome red tape along the way.

"Initially it was quite difficult. Everything in Greece is quite bureaucratic," Angelopoulos said.

Now, another three units are in the works with money raised through crowdfunding, a method of generating funds from a large number of people via the internet. Its founders hope to reach as many of the dozens of camps around Greece as possible.

At the Kara Tepe camp on Lesbos where the first unit was installed, authorities and residents are thrilled.

"I told them -- you should've brought it yesterday and not one, but four," said Stavros Miroyannis, who manages the camp for families which is run by the local municipality.

"They've promised me three more and I'm expecting them with great pleasure."

Miroyannis hopes to one day power the entire site using solar energy. Solar panels have already replaced street lamps.

"This is a gift from God," he said, pointing to the blazing sun.