     Wire.write(0x2A);
     rcw = Wire.endTransmission();
     if (rcw) {
-        snprintf(global_printbuf, printbufSize, "! CO2 COMMS error2 - RC = %d", rcw);
-        Particle.publish(DataSource, global_printbuf, 60, PRIVATE);
+        snprintf(g_printbuf, g_printbuf_sz, "! CO2 COMMS error2 - RC = %d", rcw);
+        Particle.publish(DataSource, g_printbuf, 60, PRIVATE);
         co2errors++;
         rcw = Wire.endTransmission();
         rcw = Wire.endTransmission();

int globalErrorCount = 0;
bool initializing = true;

bool readRht2Sensor(char outbuf[], int len) {
    rht2Sensor.readData();
    rht2Sensor.snprintfData(outbuf, len);
    return rht2Sensor.checksumErr;
}

bool readPMSensor(char outbuf[], int len) {
    pmSensor.readData();
    pmSensor.snprintfData(outbuf, len);
    return pmSensor.checksumErr;
}

bool readCO2Sensor(char outbuf[], int address) {
    int rcw = 0;
    int co2errors = 0;
    unsigned char buffer[4];

    Wire.setSpeed(i2cDataRate);
    Wire.begin();
    delay(500);
    const int outbuf_9dof_sz = 128;
    char outbuf_tester[outbuf_9dof_sz];
    disable9DOFSensor(outbuf_tester, outbuf_9dof_sz);
    Particle.publish(DataSource, outbuf_tester, 60, PRIVATE);
    delay(2000);
}
