A factory worker was caught selling heroin and cocaine in Bideford after he lost his job and became a drug dealer to pay for his £200 a week addiction.
Adrian Daker moved to Devon from the Midlands to start a new life but turned to drugs to overcome homesickness and rapidly became dependent on them.
His habit was so severe that he lost his job at a factory in North Devon and feared he would lose his flat in the town.
He was recruited as a low-level dealer when he asked his supplier for credit and was told that he would be given a free supply if he agreed to carry out deliveries.
Police spotted him street dealing near the Quay and arrested him with £70 cash from previous sales and £310 worth of heroin and crack for future ones.
He also had a note telling him where and when to meet clients, Exeter Crown Court was told.
He was spared an immediate jail sentence after a judge was told that he has gone back to his family home in Wolverhampton, overcome his addiction, and got a job in a steel works.
Daker, aged 30, of Gregory Court, Wolverhampton, admitted two counts of possession of class A drugs with intent to supply and was jailed for 20 months, suspended for two years with 150 hours unpaid community work and ten days of rehabilitation activity requirements.
Judge Timothy Rose told him: "After your life fell apart you became in the grip of substantial drug use and when you looked to get drugs on credit, you were persuaded to do this in return for drugs.
"You have done much to sort yourself out. You are back home and have regularised your circumstances. You have employment and have got out of the immediate grip of your class A drugs problem."
Herc Ashworth, prosecuting, said Daker was seen selling to known users on the streets of Bideford at 12.35pm on January 5 this year.
He claimed to be a buyer rather than a dealer but was found with nine wraps which were ready for street sale and a larger amount hidden in his sock. The total value of the heroin was £160 and of the cocaine £150.
He told police he moved from the Midlands in February 2018 after a friend offered him a job in North Devon, but he lost it as a result of his drug taking and was then persuaded to act as runner for his dealer.
Paul Grumbar, defending, said Daker's life has moved on since his arrest and he is now back with his family, off drugs and working.
He said his involvement was at the very bottom of the supply chain, delivering orders which had been made by phone from users to his dealer.