#include #include #include #include #include #include LiquidCrystal_I2C lcd = LiquidCrystal_I2C(0x27, 16, 2); //D4 =SDA D3=SCL #include SoftwareSerial nodemcu(D2,D1); const String ssid = "MACASINAG"; const String password = "july271914"; String url = "https://phsolutions.tech/iobottleshred/save-data.php?id=1&r="; String getUrl = "https://phsolutions.tech/iobottleshred/get-data.php?id=1"; void setup() { Wire.begin(2,0); Serial.begin(9600); // TX = GPIO1, RX = GPIO3 WiFi.begin(ssid, password); Serial.print("Connecting"); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.print("Connected to "); Serial.println(ssid); Serial.print("IP address: "); Serial.println(WiFi.localIP()); nodemcu.begin(9600); } void loop() { WiFiClientSecure client; client.setInsecure(); HTTPClient https; if (WiFi.status() == WL_CONNECTED) { //FROM DATABASE TO MEGA https.begin(client,getUrl); //Specify request destination int httpCode = https.GET(); //Send the request if (httpCode > 0) { //Check the returning code String payload = https.getString(); //Get the request response payload String readString = payload; //Split Serial.println(readString); } https.end(); //Close connection } delay(1500); // Check if data is coming from Mega // if (Serial.available()) { // String received = Serial.readStringUntil('\n'); // Serial.print("From Mega: "); // Serial.println(received); // } // Serial.println("=================================="); }