![]() I will have look at setting the code up on ESP8266 tomorrow, Since you are using a Mega on one side, any reason you cannot use the HardwareSerial Serial1,2 or 3 instead of the SoftwareSerial? I managed to get some code working using my revised SerialComs class.Ĭurrently I have the code running between ESP32 Serial2 and Mega2560 Serial1. Your swSerial in the ESP code is never even started, but then again you never seem to be reading from it, but your hwSerial is used for passing information to the user. If there is something else that needs to be called at 2 second interval, you should use millis() elapsed time to do that. HandleClient() should be called more often than every 2 seconds. server.on("/", handle_Root) //–> This is to display web page.Īnd your 'handleNotFound' page ? no callback for that ? } Remember you will need a voltage divider on to divide the incoming voltage on the Wemos RX pin. ![]() I would not use swSerial at all on the wemos side, but rather use swap() to switch to the alternate pins for hwSerial (13 & 15) Using swSerial on pins 0 & 1 (GPIO nrs) is not going to work very well, since GPIO1 is the hwTX pin. Please provide a connection diagram #include Something is wrong with the code but I can’t figure out what.īut as stated before, it is even harder for us to figure that out without extra information. Serial.print(" Battery charging : Output V=") Serial.print(F((“deserializeJson() failed with code”))) Server.on("/", handle_Root) //–> This is to display web page.ĭeserializationError error = deserializeJson(doc, Serial) Serial.print("Successfully connected to: ") Serial.println(“Jelka Bisa MPPT Project V, I and P measurements”) nd(200, “text/html”, MAIN_page) //Send web page const char* password = “M0b1lnaPracown1a” const char* ssid = “WSG-Mobilna pracownia” This code includes a part that is in the public domain and includes own inputs. Serial.print(" || Battery charging : Output V=") reading current from A2/supply voltage and calcultating average value the loop routine runs over and over again forever: ToESP.print("From Arduino Mega 2560 Hello :wink: ") Use the lowest possible data rate to reduce error ratio initialize serial communication at 9600 bits per second: the setup routine runs once when you press reset: Int sensorValue = analogRead(A3) // From solar panelįloat R1 = 470000 // These 2 resistors build up a Voltage divider to bring down PV voltage down to Arduino operating voltage Int Vr_value = analogRead(A2) // From solar panel Int ADCValue = analogRead(A1) // From Sensor output Int voltageValue = analogRead(A0) //From Sunnybuddy output #define SAMPLES 20 //Number of samples you want to take everytime you loop I’m trying to send data from Arduino Mega to a Wemos D1 ESP8266 board, could you please help? Something is wrong with the code but I can’t figure out what.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |