Dear Rui,
For Home Automation applications,
How to use an “OLED Display” with an ESP for a control visual only and to read only directly on display ip address or status if connected or disconnected… without laptop , PC …smartphone
I’m not sure that it possible to get all datas on this screen display as on monitior ide plateform.
Many thanks and best regards
Dominique
Hi Dominique.
Yes, it is possible, but it is limited to the size of the display.
For example, instead of displaying the error messages on the Serial Monitor in case it is not connected, you need to display them on the OLED display. But you need to write the code for that.
You can also display the IP address on the OLED display.
For example, Check if it is connected to the wi-fi. If it isn’t, display an error message on the OLED:
if (WiFi.status() != WL_CONNECTED){ display.clearDisplay(); display.setTextSize(1); display.setTextColor(WHITE); display.setCursor(0, 10); display.println("Wi-Fi not connected"); display.display(); }
I’m not sure if there are better ways to do this. Because if you have more messages, you need to put the cursor in different coordinates.
Let me know if you need help with handling the OLED display or if you found a better way.
Regards,
Sara
Hi Sara,
Firstly i’m very sorry for my reply just now and many thanks for your help. I also investigate your special guide for the Oled screen SSD1306 to learn all the fonctions step by step. But unfortunately I didn’t find how to get the yellow and blue colours and I’m not sure it’s possible for the SSD1306.
Regarding how to get IP address directly on screen, your way is all good. I also want to use the ” String Method ” but my code was wrong and too difficult for my level. Do you know a guide or an advice to sudyt this section of code ?
Actualy I’m working for several automation projects with Ide arduino and after few test with ESP 8226-01 and i use now an old ESP8266 on Wemos D1-R2. Following Rui guides, i use few design Soft AP or Station Mode on LAN network or internet network with secure Base 64… Next i’going to try deep sleep sytem or trigger to reduce the batterie consumption of module outside .
Thanks by advance and best regards.
Dominique
Hi Dominique.
To display the IP address on the OLED, you can use the following lines after connecting to Wi-Fi (prints on serial monitor and oled):
Serial.println("");
Serial.println("WiFi connected.");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
display.setCursor(0,20);
display.print("Access web server at: ");
display.setCursor(0,30);
display.print(WiFi.localIP());
display.display();
Regarding the blue and yellow colors – I don’t know how to change those colors. I think it’s specific to one of the OLED models. Recently, I bought an SSD1306 OLED display and find out that the first lines appear in yellow and the rest of the lines in blue while my previous OLED display just displays white in black background.
Regards,
Sara