remicaumette / esp8266-redis

An Arduino library for Redis that works on ESP8266.
24 stars 11 forks source link

ESP 8266 library for Redis is Not Woking #7

Open indianplans opened 4 years ago

indianplans commented 4 years ago

I have copied your same code in simple.ino and uploaded to my Esp8266

But The redis server is not Connecting

redis fail

Herewith I am pasting the code. It is the same code but I have taken a free account in redislabs.com to test. I need this Redis option for my app to control Home Automation. I tried with Firebase. But it seems there is some problem in Firebase libraries,.

code begins

include

define WIFI_SSID "Redmi Rahim"

define WIFI_PASSWORD "zulekha88"

define REDIS_ADDR "redis-15399.c10.us-east-1-3.ec2.cloud.redislabs.com"

define REDIS_PORT 15399

define REDIS_PASSWORD "qciH3LxOYsLItikmMecCX9LQyeUjrWv4"

Redis redis(REDIS_ADDR, REDIS_PORT);

void setup() { Serial.begin(115200); Serial.println();

WiFi.mode(WIFI_STA);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print("Connecting to the WiFi");
while (WiFi.status() != WL_CONNECTED) 
{
    delay(250);
    Serial.print(".");
}
Serial.println();
Serial.print("IP Address: ");
Serial.println(WiFi.localIP());

if (redis.begin(REDIS_PASSWORD)) 
{
    Serial.println("Connected to the Redis server!");
} 
else 
{
    Serial.println("Failed to connect to the Redis server!");
    return;
}

Serial.print("SET foo bar: ");
if (redis.set("foo", "bar"))
{
    Serial.println("ok!");
}
else
{
    Serial.println("err!");
}

Serial.print("GET foo: ");
Serial.println(redis.get("foo"));

redis.close();
Serial.print("Connection closed!");

}

void loop() { }

With Regards

SA Rahim +91 9292606060 iconicbrain@gmail.com

indianplans commented 4 years ago

Dear @remicaumette

Please look at this issue. If I try a lot it connects once, Screenshot 2020-04-02 22 09 59