A man who researched how to grow cannabis online in order to treat his chronic pain has been handed 160 hours of unpaid work.

When police officers raided Reece Ashman's home in Kirkpatrick Road, Norwich, on May 22 this year, they discovered the master bedroom had been converted into a cannabis factory with 20 mature plants which were almost as tall as the ceiling.

They also found evidence a second bedroom had been used to grow cannabis plants which had already been harvested, as well as 47g of cannabis leaves in bags around the property.

Appearing at Norwich Magistrates' Court on Friday, Ashman, 29, pleaded guilty to producing a controlled drug.

The court heard how after discovering police had raided his home Ashman had handed himself in and admitted full ownership of all the cannabis plants.

He told officers he suffered chronic pain and his intention had been to make cannabis oil as he had read it was the best way to treat his type of pain.

Josephine Jones, prosecuting, said: "He obtained all of the equipment from second hand sites and researched a lot online.

"It is the first time he has done anything like this and he knew he had to take steps to alter the electricity supply, and that was done by someone else who he was not prepared to name.

"There is nothing to disprove that this was not for his own use."

Mitigating, Ralph Gillam said Ashman sustained a severe skull fracture while playing football in 2017.

"He received surgery at the Norfolk and Norwich University Hospital but around two years ago he started suffering chronic pain akin to migraines," he said.

"He read online that this could deal with his pain quite successfully."

The court also heard from a probation officer who said: "Ashman had obviously done a lot of research about how he could grow the cannabis but he seemed quite clueless about the penalties of what he was doing."

Ashman was given a 12-month community order for 160 hours unpaid work and ordered to pay costs of £85 and a victim surcharge of £85.

It was also ordered that all Ashman's equipment and cannabis plants be destroyed.