In Pertrograd, Janonis enrolled at the XII Gymnasium and joined the Russian Social Democratic Labour Party (bolsheviks). For the revolutionary work, he was arrested in December 1916 and imprisoned in the Kresty Prison. Released, he traveled to Tartu where he met with Karolis Požela and . He took a train further south but once again was arrested and imprisoned in Vitebsk. He was freed after the February Revolution but his health was failing. He returned to Petrograd where he lived with Zigmas Angarietis and worked on publishing "Tiesa" (Truth). He was a press correspondent at the 7th Congress of the Russian Communist Party (Bolsheviks). In spring 1917, he passed gymnasium graduation exams but his tuberculosis was getting worse. Not wanting to be a burden, he committed suicide by jumping in front of a train halfway between Petrograd and Pushkin. As a suicide victim, he was buried outside a cemetery in Pushkin. In the early 1960s, it was decided to rebury him at the center of the cemetery.