Kamermayer began his political career as a deputy at the Diet of 1847–1848 during the Hungarian Reform Era. In early 1848, he was among Lajos Kossuth's so-called "parliamentary youth" (), the law students and junior clerks who supported the ideas of reform and progress represented by the liberal aristocracy at the Lower House of the Diet. After the outbreak of the Hungarian Revolution of 1848, he joined as a volunteer in Colonel Lajos Kazinczy's sapper battalion. He was later promoted to lieutenant in the 61st Battalion commanded by Major Pál Csuzy. He participated in the battles of Kápolna, Isaszeg, and others during the victorious spring campaign commanded by General Artúr Görgei in 1849. On 24 April 1849 he arrived in Pest with the engineer corps under the leadership of Colonel István Szekulics, which occupied and guarded the Chain Bridge. Kamermayer also fought in the Battle of Buda on 21 May 1849. He marched with Lajos Aulich to Komárom. The Imperial Russian Army attacked the Hungarian army on 20 June at Pered and on 28 June at Győr, winning both battles. At the end of the war, Kamermayer was promoted to first lieutenant by General György Klapka, who defended Komárom for two months even after the army's defeat.