Alternatively, you may use expansion of cotangent $$ \pi\cot \pi x=\frac1x+\sum_{n=1}^{\infty}\frac{2x}{x^2-n^2} $$ as a balackbox (after all, complex residues are not the onliest way to obtain this formula. Say, there is Herglotz trick, explained, for instance, in Proofs from the Book). Just substitute $x=i$, for the sum $S=\sum_{n=0}^{\infty} \frac1{n^2+1}$ we get $\pi \cot \pi i=-i-2i(S-1)$, $2iS=i-\pi \cot \pi i=i(1+\pi\cot \pi)$, $S=(1+\pi \cot \pi)/2$