How to send data to UBDITOS using AT Commands

My values are not showing up on ubidots. I have tried the same code. I put the correct auth token and variable ID… Here is the Serial Monitor window

@YudhistiraGM please help

Dear Zohaib,

You mention it doesn’t work but fail to provide the response you’re getting from our API. Can you please show the response from our API? Is it a 400, 401 or 403 error? These are all the responses you could get.

If you don’t know what an HTTP response is, or how to print it in the terminal, then you probably still need to tinker more with your device before coming to Ubidots.

Please note at Ubidots we serve a cloud product and, as such, we can only provide support to our cloud services. For hardware questions (like this case) our community does its best effort, but I would recommend going first to your device manufacturer and, once you are able to handle AT commands to create an HTTP request, then you can come back and send data to Ubidots.

You are sending floating values … you changed the function ?? … you just had to uncomment the line of floating and comment the integer.

// Function to send data to Ubidots ************************************************************************************************************* 
void send_D(int d1, int d2, int d3, int n_var) {  // Send int data
//  void send_D(float d1, float d2, float d3, int n_var) {  // Send float data  

That’s how it was but you had to change it like this:

// Function to send data to Ubidots ************************************************************************************************************* 
    //  void send_D(int d1, int d2, int d3, int n_var) {  // Send int data
    void send_D(float d1, float d2, float d3, int n_var) {  // Send float data

You did it ??

Yes i did it… I tried with integer too… Check my serial monitor for output…

When you tested it did your values showed up on ubidots?

How i can check server response here ? what server is replying i mean 200, 400, 401 or something else?

add this function in the program´s end:

void Debug() {

  String get_response;
  while (Serial.available()) {
     get_response = Serial.readString();
   }
  Serial.println(get_response);
}

Then call the function in this part of code:

void loop() {
  // put your main code here, to run repeatedly:

  int dato1 = analogRead(0);
  //  float dato1 = analogRead(0);
  int dato2 = analogRead(1);
  //  float dato2 = analogRead(1);
  int dato3 = analogRead(2);
  //  float dato3 = analogRead(2);
  
  send_D(dato1, dato2, dato3, 3);  // The last parameter "3", is for choose the number of variables to send to Ubidots: (1-3) 

  Debug();
}

Check my friend:

I’m putting my id variables in my program:

I just want to know if at the end of this part you see something similar to this:

I accept that my program is not perfect so sometimes I will not send anything but usually a submission is correct and another does not send anything but as sending is fast it does not affect much that bug:

And chek it out:

If you want you can pass me your code as it is and I know if you do not have any details that are preventing you from sending … do not be afraid to pass me your token and id variables because the variables can be deleted and the token can generate a new one after That you check that your program serves. I will send data to your variables in ubidots and you will tell me if you are doing it.

Check your inbox

Hey friend I saw that you are testing with SoftwareSerial … the truth I have not tried how it works with SoftwareSerial … it would not be possible that you do it like I did?

Check your ubidots pls.

Yes the data is coming

All 3 variables are showing data now…

Please inbox me the code you tried with my TOKEN and ID

I already saw where your error in your SoftwareSerial is … You have to change all the “Serial” by “esp” … since “esp” is your serial object that you created with which you are saying that you will make your communication . But if you do with the TX and RX of the Arduino, the only thing you have to do is that when you load the program to the arduino disconnect the connections between the arduino and the wifi module … because otherwise it will give you error Want to upload your program to arduino, since as you have connected the TX and RX of Arduino and Wifi, the programmer does not know what to do and sends you error. Then you just have to do as if you did not have the wifi module and only program your arduino, after you have already programmed your arduino, you can now connect your wifi module to the arduino rx and TX and Ready!

Sorry for my Terrible English lol …

I hope you understand

Bye. I’m going to sleep. See ya and Good luck!