#include <SocketIoClient.h>
#include <ArduinoJson.h>
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include “wifipassword.h”
#define USER_SERIAL Serial
const char* ssid = “Picky_ASUS_00_2G”;
const char* pass = WIFI_PASSWORD;
int R = D1;
int G = D2;
int B = D3;
SocketIoClient webSocket;
void setup() {
pinMode(R, OUTPUT);
pinMode(G, OUTPUT);
pinMode(B, OUTPUT);
USER_SERIAL.begin(115200);
searchWiFi();
connectWiFi();
webSocket.begin(“192.168.2.66”, 5000);
webSocket.on(“message”, controlled);
}
void loop() {
webSocket.loop();
}
void controlled(const char* message, size_t length){
// USER_SERIAL.println(message);
DynamicJsonDocument doc(1024);
deserializeJson(doc, message);
double r = doc[“r”];
double g = doc[“g”];
double b = doc[“b”];
analogWrite(R, (r * 255));
analogWrite(G, (g * 255));
analogWrite(B, (b * 255));
}
void searchWiFi(){
int numberOfNetwork = WiFi.scanNetworks();
USER_SERIAL.println("----");
for(int i = 0; i < numberOfNetwork; i++ ){
USER_SERIAL.print("Network name: ");
USER_SERIAL.println(WiFi.SSID(i));
USER_SERIAL.print(“Signal strength: “);
USER_SERIAL.println(WiFi.RSSI(i));
USER_SERIAL.println(”--------------”);
}
}
void connectWiFi(){
WiFi.begin(ssid, pass);
while(WiFi.status() != WL_CONNECTED){
USER_SERIAL.print(".");
delay(1000);
}
USER_SERIAL.print("");
USER_SERIAL.println(“WiFi connected”);
USER_SERIAL.print("IP Address : ");
USER_SERIAL.println(WiFi.localIP());
}
this is the code but it is not working anybody know about this please help me
problam is at the bottom
C:\Users\abdulbais zargar\Documents\Arduino\libraries\SocketIoClient\SocketIoClient.cpp: In member function ‘void SocketIoClient::beginSSL(const char*, int, const char*, const char*)’:
C:\Users\abdulbais zargar\Documents\Arduino\libraries\SocketIoClient\SocketIoClient.cpp:46:39: error: invalid conversion from ‘const char*’ to ‘const uint8_t*’ {aka ‘const unsigned char*’} [-fpermissive]
46 | _webSocket.beginSSL(host, port, url, fingerprint);
| ^~~~~~~~~~~
| |
| const char*
In file included from C:\Users\abdulbais zargar\Documents\Arduino\libraries\SocketIoClient/SocketIoClient.h:7,
from C:\Users\abdulbais zargar\Documents\Arduino\libraries\SocketIoClient\SocketIoClient.cpp:1:
C:\Users\abdulbais zargar\Documents\Arduino\libraries\WebSockets\src/WebSocketsClient.h:50:93: note: initializing argument 4 of ‘void WebSocketsClient::beginSSL(const char*, uint16_t, const char*, const uint8_t*, const char*)’
50 | void beginSSL(const char * host, uint16_t port, const char * url = “/”, const uint8_t * fingerprint = NULL, const char * protocol = “arduino”);
| ^
Multiple libraries were found for “SocketIoClient.h”
Used: C:\Users\abdulbais zargar\Documents\Arduino\libraries\SocketIoClient
Not used: C:\Users\abdulbais zargar\Documents\Arduino\libraries\socket.io-client-master
exit status 1
Error compiling for board Node