Why it not load the data to the Googlesheet?

Hi, can anyone help me to go through the coding as it cannot help read the RFID tag number when at serial monitor after i run the codingPreformatted text.

Basically, my project is using UHF Rfid, RS232 and Ethernet Shield. The purpose of the project is to track the asset movement.

#include <ModbusMaster232.h>
#include <ModbusSlave232.h>


/* Arduino Code which sends data to google spreadsheet */

#include<SPI.h>
#include <SoftwareSerial.h>
#include <Ethernet.h>
#define SS_PIN 4 //FOR RFID SS PIN BECASUSE WE ARE USING BOTH ETHERNET SHIELD AND RS-522
#define RST_PIN 9
#define No_Of_Card 3


byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
char server[] = "api.pushingbox.com/pushingbox?devid=vE474F9B73B19E59";   //YOUR SERVER
IPAddress ip(10, 30, 20, 95);
EthernetClient client;


SoftwareSerial mySerial (5, 6);
unsigned char incomingByte;

// the setup function runs once when you press reset or power the board
void ethernet() {

  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    Ethernet.begin(mac, ip);
  }
  delay(1000);
  Serial.println("connecting...");
}

void sendIdentifyCmd ()
{
  mySerial.write (0x7c);
  mySerial.write (0xff);
  mySerial.write (0xff);
  mySerial.write (0x01);
  mySerial.write (0x08);
  mySerial.write (0x7d);
#ifdef DEBUG
  Serial.print (0x7c);
  Serial.print (0xff);
  Serial.print (0xff);
  Serial.print (0x01);
  Serial.print (0x08);
  Serial.print (0x7d);
  Serial.println ();
#endif
}

void setup ()
{
  Serial.begin (9600);
  mySerial.begin (9600);
  Serial.println ("begin initial Serial!\n");
}

void loop ()
{
  sendIdentifyCmd ();
  delay (2);
  while (mySerial.available () > 0)
  {
    incomingByte = mySerial.read ();
    Serial.print (incomingByte, HEX);
    Serial.print (' ');
  }
  Serial.println ();
  delay (1000);
}

void Sending_To_spreadsheet()   //CONNECTING WITH MYSQL
{
  if (client.connect(server, 80)) {
    Serial.println("connected");
    // Make a HTTP request:
    client.print("GET /pushingbox?devid=vE474F9B73B19E59&machine_location=");     //YOUR URL
    //    if(j!=No_Of_Card)
    //  {
    //    client.print('1');
    //      Serial.print('1');
  }
  else
  {
    client.print('0');
  }

  client.print("&Machine_ID=");
  for (int s = 0; s < 4; s++)
    //{
    //client.print(rfid.uid.uidByte[s]);

    //  }
    client.print(" ");      //SPACE BEFORE HTTP/1.1
  client.print("HTTP/1.1");
  client.println();
  client.println("Host: api.pushingbox.com");
  client.println("Connection: close");
  client.println();
  //} //else {
  // if you didn't get a connection to the server:
  // Serial.println("connection failed");
  //}
}

Hi, @hezra
Do you get the

begin initial Serial

Message when you open the monitor?
If so what other messages do you get?

Is your monitor set to 9600baud?
What model controller are you using?

Thanks… Tom… :grinning: :+1: :coffee: :australia:

Hi @TomGeorge

Yes, I get the begin initial Serial.
After that the RFID serial number.
But, it cannot transfer the data to the Google sheet.
Sorry, i just confuse after do all the coding.

Yes, the monitor been set to 9600baud.

I’m using Arduino Uno R3.

Is there any other way than using Pushingbox to transfer the data?

Thanks for answering.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.