[SOLVED] 'Unable to connection, status: 268450048' using Wi-Fire board with Ubidots code

Hi,

I am trying to connect to internet using chipKit Wi-Fire board with ubidots code but I get an “Unable to connection, status: 268450048” error every time i try to send value to ubidots. i am using the code provided on the ubidots website for wifi connection and uploading variable to server.

I don’t know what the status mean. Can anyone please tell me how to resolve this issue or any information on the status that might lead me to resolve this issue will be very helpful.

Thank You!
Vinod

hello friend could you send me your code? with that I can help you

1 Like

AirQualityDetector.zip (2.9 KB)

I uploaded the zipped pde file. sorry i dont know other ways to send the code.

Okay i see, try to use this new code, with new library because your code is the old method

Follow the steps inside the README and tell me if you have another problem

1 Like

sorry for the late reply.

I tried the code after setting up, but the error is ‘client is not declared in the scope’. how do we declare client?

Thank You!
Vinod

Yes i saw the problem, I will fix it right now, try with this code:

// This example is to send one varable to the Ubidots API
#include <MRF24G.h>
#include <UbidotsWiFire.h>

#define ID  "Your_variable_ID_here"  // Put here your Ubidots variable ID
#define TOKEN  "Your_token_here"  // Put here your Ubidots TOKEN
#define SSIDWIFI "Your_WiFi_SSID_here"  // Put here your WiFi SSID
#define PASS "Your_WiFi_PASS_here"  // Put here your WiFi password

Ubidots client(TOKEN);

void setup(){
    Serial.begin(9600);
    client.setWifiConnection(SSIDWIFI, PASS);
}
void loop(){
    float value = analogRead(A12);
    client.add(ID, value);
    client.sendAll();
}
1 Like

Thank you so much.

I was trying to instantiate the ubidots constructor without token parameter. now it works fine. thank you.

1 Like