James Ellis, 35, was arrested at his home on Buller Close in Peckham on September 15.
It was revealed that two days earlier he had sent sexual online messages to accounts which he believed to belong to children.
Among the messages he sent were photos of his penis, court documents state.
The accounts were actually decoys run by online paedophile hunters.
Ellis was charged with two counts of attempting to engage in sexual communication with a child and possession of cocaine.
He pleaded guilty to all three charges.
At Croydon Magistrates’ Court on Wednesday, November 5, Ellis was sentenced to nine months in custody suspended for two years.
He was ordered to complete 150 hours of unpaid work and up to 25 days of rehabilitation activities.
A Sexual Harm Prevention Order was made banning him from unsupervised contact with children and limiting his internet usage for the next ten years.
He will also be required to register with police as a sex offender for the next decade.

