A drug dealer was caught in the act after he received a text message asking for cannabis while police examined his phone at the roadside, a court was told.
Sam Hammond, of Blackbird Way, Alconbury, was first stopped by police on 16 June, 2017.
The 21-year-old was driving a Ford Fiesta along St Neots Road, Eaton Socon, at 7.30pm when he was pulled over by officers due to the tinted front windows in his car.
Hammond admitted to smoking cannabis and officers searched the vehicle where they discovered cannabis, a cannabis grinder, amphetamine and cocaine.
Hammond was arrested and released on bail but six months later, on 5 December, officers were called to suspicious activity in Leighton Bromswold.
Two men had been seen trespassing in the garden of a house and when officers arrived at just after 11pm, they found a man asleep in a blue BMW 1 series in Church Lane.
They noticed a strong smell of cannabis coming from the car, and the man - later identified as Hammond - produced a fist-sized bag of the class B drug.
Hammond was asked why he was in the area and claimed he had been 'driving around' with his friend, who he said had 'walked off to use the toilet somewhere'.
Officers searched Hammond and found a phone and £210 in cash.
Hammond agreed to have his phone examined at the roadside and as police were doing so, a text message was received from a person asking to buy cannabis.
During a further search of the vehicle, police found a baton, drug scales and a small plastic pot containing cannabis.
Hammond was arrested on suspicion of possessing class B drugs with intent to supply and possession of an offensive weapon.
Police also searched Hammond's bedroom and discovered five phones, two iPods and £1000 in cash.
He was released on bail but on March 23 last year, at just before 3am, officers spotted a car being driven in Huntingdon Road, St Neots, with only one front fog light.
The driver made off and headed into Godmanchester. The car - the same blue BMW 1 Series - was stopped in Cambridge Street with Hammond in the driving seat.
During a search of the vehicle officers found four phones, £345 in cash, a large lock knife and cannabis.
At a previous hearing at Cambridge Crown Court, Hammond pleaded guilty to two counts of possessing a class B drug with intent to supply, being concerned in the supply of class B drugs, possessing cocaine and two counts of possessing class B drugs and one charge of possessing an offensive weapon in a public place
PC Neil Woodley, who investigated, said: "Having an offensive weapon in a public place is completely unacceptable, no matter the reason.
"We are working hard to dissuade people from carrying weapons in public and would urge people to report anyone they see doing so.
"In addition, drugs destroy lives and cause misery for our communities and we will continue to work tirelessly to bring people to justice who deal them."
If you suspect somebody is involved in drug dealing, report it to the police online at https://www.cambs.police.uk/report/Report or calling 101. Always call 999 in an emergency.
Alternatively, contact Crimestoppers, anonymously, on 0800 555111 or via www.crimestoppers-uk.org.