     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();

    rcw = Wire.endTransmission();
    rcw = 0;
    if (rcw) {
        snprintf(global_printbuf, printbufSize, "! CO2 COMMS error1 - RC = %d", rcw);
        Particle.publish(DataSource, global_printbuf, 60, PRIVATE);
        co2errors++;
        Wire.end();
        delay(500);

    currTimeS = Time.now();

    if (initializing) {
        snprintf(g_printbuf, g_printbuf_sz, "SEQ_NUM %s %s %s %s",
            header_co2, header_baro, header_rht, header_rht2);
        Particle.publish(DataSource, g_printbuf, 60, PRIVATE);
        // 12345678 9999 FFFFFFFF 9999.99 -999.99 FFFFFFFF FFFFFFFF -999.99 44.50 FFFFFFFFFF
        initializing = false;
        delay(2000);
    }

    // Gather CO2 sensor data
    const int outbuf_co2_sz = 64;
    char outbuf_co2[outbuf_co2_sz];
    readCO2Sensor(outbuf_co2, outbuf_co2_sz, co2SensorAddr);
    delay(1000);

    // Gather MS5637 sensor data
    const int outbuf_baro_sz = 64;
    char outbuf_baro[outbuf_baro_sz];
    readBaroSensor(outbuf_baro, outbuf_baro_sz);
    delay(500);

    // Gather RHT sensor data
    const int outbuf_rht_sz = 64;
    char outbuf_rht[outbuf_rht_sz];
    readRhtSensor(outbuf_rht, outbuf_rht_sz);
    delay(500);

    // Gather PM sensor data
    const int outbuf_pm_sz = 192;
    char outbuf_pm[outbuf_pm_sz];
    readPMSensor(outbuf_pm, outbuf_pm_sz);
    delay(500);

    // Gather RHT2 sensor data
    const int outbuf_rht2_sz = 64;
    char outbuf_rht2[outbuf_rht2_sz];
    readRht2Sensor(outbuf_rht2, outbuf_rht2_sz);
    delay(500);

    // Return whatever data we got
    snprintf(g_printbuf, g_printbuf_sz, "%08X OK K30:{%s} MS5637:{%s} RHT03:{%s} SHT31:{%s}",
             currTimeS, outbuf_co2, outbuf_baro, outbuf_rht, outbuf_rht2);
    Particle.publish(DataSource, g_printbuf, 60, PRIVATE);

    snprintf(g_printbuf, g_printbuf_sz, "%08X OK PMS7003:{%s}",
             currTimeS, outbuf_pm);
    Particle.publish(DataSource, g_printbuf, 60, PRIVATE);

    // Global error handling
    if (globalErrorCount >= MaxErrCnt) {
