In a previous post, the OP stated that all worked well until he added WiFi. WiFi is a radio
signal in the 2.4 Ghz range (UHF) and around the 5 Ghz range (SHF). These are elecromagnetic frequencies being constantly emitted from a sending unit. Fluxgate compasses are, unless fully protected from outside interference
, are susceptible to electromagnetic interference
. Disconnect the WiFi (as has previously been suggested here) and test the system again.
Remember one day sailing
the Ches Bay years ago on a friend's boat while on AP. Friend got a call on his cellular phone
and the AP took a automatic 90-turn to port! Once the phone
call ended, AP worked just fine. Dude calls his wife....and 90-degrees to port we go again.
So, fluxgate compasses are susceptible to RF interference.
MarkJ mentioned alternators, additionally a faulty voltage regulator
can also emit an RF signal (I know when a taxi passing my flat here in Egypt
has a faulty regulator
....if I am watching local channels my satellite
signal is disrupted).