 
   //
   lastReconnectAttempt = 0;
-
+  millisnow = 0;
+  
   getResetInfo = "hello from ESP8266 s02 ";
   getResetInfo += ESP.getResetInfo().substring(0, 30);
 

//int32_t channel = WIFI_CHANNEL;

//
IPAddress mqtt_server = MQTT_SERVER;
IPAddress time_server = MQTT_SERVER;


        Serial.println(sensor_data.devid);
      }

      if ( sensor_data.devid != 15 ) {

        String radiopayload = "{\"_salt\":";
        radiopayload += sensor_data._salt;
        radiopayload += ",\"volt\":";
        radiopayload += sensor_data.volt;
        radiopayload += ",\"data1\":";
        radiopayload += ((float)sensor_data.data1 / 10);
        radiopayload += ",\"data2\":";
        radiopayload += ((float)sensor_data.data2 / 10);
        radiopayload += ",\"devid\":";
        radiopayload += sensor_data.devid;
        radiopayload += "}";

        if ( (sensor_data.devid > 0) && (sensor_data.devid < 255) )
        {
          String newRadiotopic = radiotopic;
          newRadiotopic += "/";
          newRadiotopic += sensor_data.devid;

          unsigned int newRadiotopic_length = newRadiotopic.length();
          char newRadiotopictosend[newRadiotopic_length] ;
          newRadiotopic.toCharArray(newRadiotopictosend, newRadiotopic_length + 1);

          sendmqttMsg(newRadiotopictosend, radiopayload);

        } else {
          sendmqttMsg(radiofault, radiopayload);
        }
      } else {

        if (timeStatus() != timeNotSet) {
          timestamp = numberOfSecondsSinceEpochUTC(year(), month(), day(), hour(), minute(), second());
          millisnow = millisecond();
        }
        
        String udppayload = "udptest,test=test01,measure=";
        udppayload += sensor_data._salt;
        udppayload += " devid=";
        udppayload += sensor_data.devid;
        udppayload += "i,volt=";
        udppayload += sensor_data.volt;
        udppayload += "i,delay=";
        udppayload += ((float)sensor_data.data2 / 10);
        udppayload += ",nA=";
        udppayload += sensor_data.data1;
        udppayload += " ";
        udppayload += timestamp;
        if ( millisnow > 99 ) {
          udppayload += millisnow;
        } else if ( millisnow > 9 && millisnow < 100 ) {
          udppayload += "0";
          udppayload += millisnow;
        } else {
          udppayload += "00";
          udppayload += millisnow;
        }
        udppayload += "000000";

        sendUdpmsg(udppayload);
      }


    }
  }
