Sara, I do have one problem in the MQTT chapter in the code for Client_2. In my IDE, your code has an error* when invoking the library. So I changed the code to use the and libraries (they auto search the I2C net for the LCD, which is a real plus). Anyway, they compile fine. But 4×20 LCD does not work on either a WeMos D1 or your recommended ESP8266 DevKit (30 pin). The MQTT code is running fine, I see the correct output on the serial monitor. I’ve tried pullup resistors on SDA and SCL to the 3v3 rail and that didn’t help. I can’t figure out if this is a 3v3 IO trying to talk to the 5v pins on the LCD, or if it’s a code issue. Is there a known issue with the ESP8266 talking to the LCD?
* R:\01-Arduino projects\libraries\Newliquidcrystal_1.3.5/LiquidCrystal_I2C.h: In function ‘void setup()’:
R:\01-Arduino projects\libraries\Newliquidcrystal_1.3.5/LiquidCrystal_I2C.h:154:9: error: ‘int LiquidCrystal_I2C::init()’ is private
int init();
Hi.
Can you tell me what you changed in the library? Or what library are you using?
Also, when you say it doesn’t work, what exactly happens?
In the LCD, you might need to adjust the contrast. If you have an LCD with the I2C module, usually there’s a potentiometer that you can adjust to set the brightness.
Regards,
Sara
- did not change anything in Rui’s code, so it’s the same library call as in the original code.
- LiquidCrystal_I2C.h, but I don’t know the version number in my library. Using this library I get the error you see in the first post. When I change to the <hd44780ioClass/hd44780_I2Cexp.h> library and its sister, the code runs, but no text on the LCD, as below.
- the LCD does nothing, not white squares, no vague characters. once every few seconds it has a very faint blink (very very faint) which I’m assuming is about the cycle time of the loop()
- It’s not the contrast. I have about 15 of these up and running on Arduino minis and nanos and I generally adjust that if I don’t see anything.
- I know the MQTT Client_2 code is running because I can blink the LED on Client_1 and I can see the serial output text on the IDE serial monitor.
- I see exactly the same behavior on a WeMosD1 and the ESP8266 DevKit. Both running the Client_2 sketch fine, except for the display. I am assuming it’s
Hi.
Did you change the lcdColumns and lcdRows variables for your display size?
How did you install the library?
Can you try a sample example from the library and see if it works?
Like this, for example:
https://github.com/johnrickman/LiquidCrystal_I2C/blob/master/examples/HelloWorld/HelloWorld.pde
Regards,
Sara
Working. Had to clean out and reinstall all the libraries, used the I2C scanner to find the LCD was at 0x3F. BTW, I usually install libraries from .zip files.
The LCD_I2C driver gives a warning during compilation that it may not be compatible with any non-avr processor, but it works. I’m going to try to get the other driver to work, since I’ve had multiple experiences with differing LCD addresses with various vendors. The other driver supposedly (and does) find the correct address when the processor is an ATmega328. That driver, however, may not be compatible with the ESP8266.