MAG3110/ESP8266 Data Problem

Hello everyone,

I’m running the default code for a MAG3110 chip, “SparkFun_MAG3110_Basic” on an Amica ESP8266 with the following board settings settings:

Board = NodeMCU 1.0 (ESP-12E Module)
CPU Frequency = 160 MHz
Flash Size = 4M
Upload Speed = 921600

The code is just initializing and starting the sensor datastream, you can view it here:

https://github.com/sparkfun/SparkFun_MAG3110_Breakout_Board_Arduino_Library/blob/master/examples/SparkFun_MAG3110_Basic/SparkFun_MAG3110_Basic.ino

Now onto the problem:
I’m viewing the datastream and getting several constant “good” values, although abnormally high, and then these bursts of bad outlier values that happen fairly regularly. Yet, when I plug the same sensor into an Arduino Uno, the raw numbers are totally different and there’s no outliers. Here’s a sample of the data:

x=62689,y=2143,z=58228
x=62706,y=2148,z=58234
x=62700,y=2142,z=58231
x=62706,y=2142,z=63750
x=62712,y=2140,z=63760
x=62710,y=2145,z=63755
x=115,y=5098,z=3744
x=118,y=5098,z=3731
x=62728,y=2147,z=63756
x=62710,y=2144,z=63751
x=62721,y=2140,z=63750
x=62702,y=2144,z=58228
x=62726,y=2146,z=63749
x=62711,y=2146,z=58226
x=101,y=5101,z=63753
x=62709,y=2147,z=63756
x=62719,y=2147,z=63765
x=62709,y=2139,z=58220
x=119,y=5331,z=3732
x=62712,y=2145,z=58223
x=100,y=5098,z=63748
x=62700,y=2142,z=58230

Any idea what might be causing this problem and how to fix it?

Thanks!