invalid conversion from 'byte* {aka unsigned char*}' to 'char*'

Hi there,

I did copy a code from a resource online to get datas to Google Form by using pushingBox. I edited my codes and uploaded TMP7 Library as i was using it together with Arduino Uno and Wifi Shield. There seems to be a problem on my codes as it says "invalid conversion from 'byte* {aka unsigned char*}' to 'char*' [-fpermissive]" due to "WiFi.begin(mac, ip);"

My codes are as below:

#include <TMP37.h>

#include <WiFi.h>
#include <WiFiClient.h>
#include <WiFiServer.h>
#include <WiFiUdp.h>


#include <SPI.h>
#include <SPI.h>


#undef int
#undef abs
#undef double
#undef float
#undef round
#define TMP37;
#define TMP37PIN 0 

byte mac[] = {0x78, 0xC4, 0x0E, 0x02, 0x0B, 0x3F };  //Wifi shield MAC
byte ip[] = {192,168,0,20};     // Arduino device IP address

char devid[] = "mydevid"  ;  // THIS IS THE DEVICE ID FROM PUSHINGBOX

int del=300;  // Amount of seconds delay between posting to google docs.

char postmsg[100];
int k=0;
int temp_av = 0;
char server[] = "api.pushingbox.com";
WiFiClient client;
 
 
void setup()
{
  Serial.begin(9600);
  WiFi.begin(mac, ip);
  delay(1000);
  Serial.println("connecting...");
}
 
void loop(){
  
  
  
  
  // average temp reading for 'del' time.........................................
 
  for(int j=0; j<del;j++)
  {
    // Read local temp........................................
    int chk = TMP37.read(TMP37PIN);
    int temp = Fahrenheit(TMP37.temperature);
    temp_av=temp_av+temp;
    delay(1000);
  }
  
  int avtemp=temp_av/(del);
  temp_av=0;
    
    
    
  
 // Post to Google Form.............................................
  if (client.connect(server, 80)) 
  {
    k=0;
    Serial.println("connected");
    sprintf(postmsg,"GET /pushingbox?devid=%c&status=%d HTTP/1.1",devid,avtemp);  // NOTE** In this line of code you can see where the temperature value is inserted into the wed address. It follows 'status=' Change that value to whatever you want to post.
    client.println(postmsg);
    client.println("Host: api.pushingbox.com");
    client.println("Connection: close");
    client.println();

    Serial.println(postmsg);
    Serial.println("Host: api.pushingbox.com");
    Serial.println("Connection: close");
    Serial.println();
 
     delay(1000);
     client.stop();
  }
  delay(1000);
  
  if (!client.connected()) 
  {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();
    k==1;
    return;
  }
  
 
}


double Fahrenheit(double celsius) // Function to convert to Fahrenheit
{
 return 1.8 * celsius + 32;
}

What was the mistake here? I'm still a newbie and I really don't know that much about using Arduino. I hope someone could assist me through. Thank you in advance.

Is this an attempt at a 5 (five) 0xS4 ?

k==1;

Did you mean k=1;

A cast should sort out your pointer problem.

Look at the parameter types and values expected by WiFi.begin(). You may have to convert the binary data into ASCII.

6v6gt:
Is this an attempt at a 5 (five) 0xS4 ?

i think 0x54 is a typo error but that is part of my wifi shield's MAC address, which is 78:C4:0E:02:0B:3F .

AWOL:

k==1;

Did you mean

k=1;

A cast should sort out your pointer problem.

i did remove the = there but there seem to sill have the same error.

Can you post a link to the tutorial or example code you followed for "Pushing Box" and "TMP37" and also post all the error messages you got when you compiled your code. The code has an odd "feel" about it:

#include <SPI.h>
#include <SPI.h>


#undef int
#undef abs
. . .

6v6gt:
Can you post a link to the tutorial or example code you followed for "Pushing Box" and "TMP37" and also post all the error messages you got when you compiled your code. The code has an odd "feel" about it:

#include <SPI.h>

#include <SPI.h>

#undef int
#undef abs
. . .

hi there i manage to resolve my codes but i cant seem to load my data to google drive. Anyway, my codes were from http://www.instructables.com/id/Post-to-Google-Docs-with-Arduino/?ALLSTEPS

If you are still having trouble, then I suggest that you start with a more basic sketch which demonstrates connectivity with "pushingbox" and puts out a few status messages for debugging, so you can see how far you get.

Here is such an example and is a bit newer that the one you found: PushingBox-for-Arduino/PushingBox_Arduino_Ethernet_Official.ino at master · Clement87/PushingBox-for-Arduino · GitHub

It looks like you have only to change a couple of parameters for your environment, and may be connect a switch to D3 if you want to see it do something.