A cannabis dealer was found with 10,000 drug-related messages on his phone after police stopped him for speeding.
Mark Roper supplied a network of users in South Molton and had £205 in cash, as well as drugs worth £1,774, when police searched his car and home.
The 29-year-old was stopped for speeding but officers realised there was cannabis in the car because of the strong smell of the drug.
An analysis of his phone showed there had been 10,000 messages over the previous 12 months between Roper and 19 contacts.
Roper, of Albion Terrace, South Molton, admitted possession with intent to supply and offering to supply cannabis.
He was ordered to do 140 hours unpaid community work and pay £250 costs by Judge David Evans.
Judge Evans said a community order was the right penalty because Roper had turned his life around in the 14 months since his arrest, giving up cannabis and finding a job.
Richard Crabb, defending, said Roper had stopped mixing with a circle of friends who use cannabis and given up the drug.
He has found a steady job in Barnstaple and now spends most of his time at home.