Ubidots Community

I have big problem with esp8266 i think problem is libirary but i cant fix it please anybody help me please

#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

Hi @baisboss,

I hope this note finds you well.

Review your code I wasn’t able to find any part involving Ubidots or trying to send data to our IoT platform. Can you please let us know what are you trying to achieve with Ubidots so we can guide you in the process? Based on the message, the error seems to be that Arduino is finding various libraries from SocketIoClient.h . At the end you can see the to paths:

Used: C:\Users\abdulbais zargar\Documents\Arduino\libraries\SocketIoClient
Not used: C:\Users\abdulbais zargar\Documents\Arduino\libraries\socket.io-client-master

Then you must delete the one you are not using.

All the best,
-Isabel

1 Like

I tried after deleting also not working. There is 3 kind of socketio library i used each one but notworking also.
I want simple project. It have to sent data to website like just connection sent data and receive data.
I mean i dont want to load html code inside arduino.

Anybody know this please help me or have any video links or any thing sen me please

Hi @baisboss,

Thank you for your response. Please refer to our help center, where you can find examples on how to connect your devices with Ubidots cloud.

https://help.ubidots.com/en

If you can share us more about your project and what are you trying to build with Ubidots, we can help you in the process of connecting your devices.

All the best,
-Isabel