Set up a coordinate system such that pyramid vertex is $V=(0,0,h)$ and base vertices are $A=(b/2,a/2,0)$, $B=(-b/2,a/2,0)$, $C=(-b/2,-a/2,0)$,
$D=(b/2,-a/2,0)$.
A vector $N_1$ perpendicular to face $VAB$ (and directed outwards) can be found by
$$
N_1=(A-V)\times(B-V)=
\left({b\over2},{a\over2},-h\right)\times\left(-{b\over2},{a\over2},-h\right)
=\left(0,hb,{ab\over2}\right).
$$
Analogously, one can find a vector $N_2$ perpendicular to face $VAD$ and directed inwards:
$$
N_2=-(D-V)\times(A-V)=
-\left({b\over2},-{a\over2},-h\right)\times\left({b\over2},{a\over2},-h\right)
=-\left(ha,0,{ab\over2}\right).
$$
Angle $\theta$ between those faces is also the angle between $N_1$ and $N_2$, so it can be found by
$$
\cos\theta={N_1\cdot N_2\over|N_1|\cdot |N_2|}=
{-1\over\sqrt{1+4h^2/a^2}\sqrt{1+4h^2/b^2}}.
$$
A vectorial approach would be quite lean and effective.
Given two faces of the pyramid, sharing the common edge $V P_n$,
and containing the contiguous base points $P_{n-1}$ and $P_{n+1}$,
the dihedral angle between these two faces would be the angle
made by the two vectors ($t_m, t_p$), normal to the common edge and
lying on the respective face.
Clearly, that will be also the angle made by the normal vectors to the faces,
provided that one is taken in the inward, and the other in the outward
direction.
That is, by the right-hand rule,
$$
{\bf n}_{\,m} = \mathop {P_{\,n} P_{\,n - 1} }\limits^ \to \; \times \;\mathop {P_{\,n} V}\limits^ \to \quad \quad {\bf n}_{\,p} = \mathop {P_{\,n} P_{\,n + 1} }\limits^ \to \; \times \;\mathop {P_{\,n} V}\limits^ \to
$$
Then the dihedral angle $\alpha$ will be simply computed from the dot product
$$
\cos \alpha = {{{\bf n}_{\,m} \; \cdot \;{\bf n}_{\,p} } \over {\left| {{\bf n}_{\,m} } \right|\;\;\left| {{\bf n}_{\,p} } \right|}}
$$
Best Answer
I would write all distances in terms of the height $FE$. Then $$\tan(\angle FqE)=\frac{FE}{qE}\\\tan(\angle FpE)=\frac{FE}{pE}$$ From these equations you can calculate $pE$ and $qE$. You can get then $BE$ from Pythagoras' theorem: $$BE^2=qE^2+pE^2$$ Then $$\tan(\angle FBE)=\frac{FE}{BE}$$ Note that $FE$ terms will cancel.
Similarly, you can find $Fq$, then $$\tan(\angle CBF)=\frac{Fq}{Bq}=\frac{Fq}{pE}$$