How to display client ESP8266 reading data on LCD5110

Hello,guys.

I have setup one AP station with ESP8266+pro min+LCD5110 and the other CLIENT station with ESP8266+pro mini+DHT22. CLIENT station can send temperature data to AP station and I can see AP station temperature data on COM port. But,I can’t show temperature on LCD5110.Below is my code.

#include <SoftwareSerial.h>
#include <LCD5110_Basic.h>
#define _baudrate 9600
#define _rxpin 8
#define _txpin 9
SoftwareSerial debug( _rxpin, _txpin ); // RX, TX
#define SSID “ALPHAxxx”
#define PASS “harxxx”
#define IP “192.168.4.1”
#include <LCD5110_Basic.h>
LCD5110 myGLCD(3,4,5,6,7);

extern uint8_t SmallFont;
extern uint8_t MediumNumbers;
extern uint8_t BigNumbers;
float t1;

void setup() {
myGLCD.InitLCD();
Serial.begin( _baudrate );
debug.begin( _baudrate );

sendDebug(“AT+CWMODE=2”);
delay(1000);
Loding(“AT+CWMODE=2”);
delay(4000);
connectWiFi();
}

void loop() {
if (debug.available())
{
myGLCD.clrScr();
myGLCD.setFont(SmallFont);
String s = “”;
char c = debug.read() ;
Serial.print(c);
myGLCD.printNumF(c, 1, LEFT, 0);
}
if (Serial.available())
{ char c = Serial.read();
debug.print(c);
}
}

boolean connectWiFi()
{
Wifi_connect();
}

void Wifi_connect()
{
String cmd=“AT+CWSAP=”";
cmd+=SSID;
cmd+="","";
cmd+=PASS;
cmd+="",6,4";
sendDebug(cmd);
delay(2000);
sendDebug(“AT+CIFSR”);
delay(1000);
Loding(“AT+CIFSR”);
delay(2000);
sendDebug(“AT+CIPMUX=1”);
delay(1000);
Loding(“AT+CIPMUX=1”);
delay(2000);
sendDebug(“AT+CIPSERVER=1,80”);
delay(1000);
Loding(“AT+CIPSERVER=1,80”);
delay(2000);
}

void Loding(String state){
if(debug.find(“OK”))
{
Serial.println(“RECEIVED: OK”);
}
else
{
Serial.println(“RECEIVED: NG”);

}
}

void sendDebug(String cmd)
{
Serial.print("SEND: ");
Serial.println(cmd);
debug.println(cmd);
}

I try it for a long time,But i just can’t displayed temperature data where appended in +IPD,…
Have anyone know what’s the problem? Thanks for your reading and comments.

boolean connectWiFi()
{
    Wifi_connect();
}

You lied when you said that connectWiFi() would return a value. Why?

SoftwareSerial debug( _rxpin, _txpin ); // RX, TX

You have a debug connected to the Arduino? Post a picture of the debug, please.

LCD5110 myGLCD(3,4,5,6,7);

As if you might be using someone else's display...

 if (debug.available())
  {         
   myGLCD.clrScr(); 
   myGLCD.setFont(SmallFont);
   String s = "";
   char c = debug.read() ; 
   Serial.print(c);
   myGLCD.printNumF(c, 1, LEFT, 0);
  }

Why are you creating a variable, s, but never using it?

What serial output do you see? Why would you call printNumF() with a character?

PaulS:

SoftwareSerial debug( _rxpin, _txpin ); // RX, TX

You have a debug connected to the Arduino? Post a picture of the debug, please.

:slight_smile: :slight_smile: