secrets header file not able to get it to work

Hi,

I am working on a IOT project with blynk. I am putting my code on GitHub (just for myself).
But I want an extra header file that contains the wifi password and the tokens.

I got the header file in the IDE but the code isn’t really able to read the token…
The token has to be a string of chars

char[] auth = "token";

This is in the header file, but it won’t work!
I get this error code:

Arduino:1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board:"Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"


C:\Users\Isaak\Documents\Arduino\Projects\Arduino IOT Station System\Arduino-IOT-System\AMS_V1\AMS_V1.ino: In function 'void setup()':

AMS_V1:523:15: error: 'auth' was not declared in this scope

   Blynk.begin(auth);

               ^~~~

C:\Users\Isaak\Documents\Arduino\Projects\Arduino IOT Station System\Arduino-IOT-System\AMS_V1\AMS_V1.ino:523:15: note: suggested alternative: 'auto'

   Blynk.begin(auth);

               ^~~~

               auto

C:\Users\Isaak\Documents\Arduino\Projects\Arduino IOT Station System\Arduino-IOT-System\AMS_V1\secrets.ino: At global scope:

secrets:1:5: error: decomposition declaration cannot be declared with type 'char'

 char[] auth = "my token was here i removed it";

     ^~

C:\Users\Isaak\Documents\Arduino\Projects\Arduino IOT Station System\Arduino-IOT-System\AMS_V1\secrets.ino:1:5: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'

secrets:1:5: error: empty decomposition declaration

secrets:1:8: error: expected initializer before 'auth'

 char[] auth = "my token was here i removed it";

        ^~~~

exit status 1

'auth' was not declared in this scope



Dit rapport zou meer informatie bevatten met
"Uitgebreide uitvoer weergeven tijden compilatie"
optie aan in Bestand -> Voorkeuren.

Any ideas?

Isaak

How about:

char auth[] = "token";

Thats the same thing that already is in the code...
And with this it gives the error.

Is the any warning message for the #include for that header file?

idv7:
Thats the same thing that already is in the code...
And with this it gives the error.

This:

char[] auth = "token";

Is not the same as this:

char auth[] = "token";

My bad.

I think put it in wrong... In my origenal code it was like you said.

Arduino:1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board:"Arduino Micro"



C:\Users\Isaak\Documents\Arduino\Projects\Arduino IOT Station System\Arduino-IOT-System\Sketches\AMS_V1\AMS_V1.ino: In function 'void setup()':

AMS_V1:523:15: error: 'auth' was not declared in this scope

   Blynk.begin(auth);

               ^~~~

C:\Users\Isaak\Documents\Arduino\Projects\Arduino IOT Station System\Arduino-IOT-System\Sketches\AMS_V1\AMS_V1.ino:523:15: note: suggested alternative: 'auto'

   Blynk.begin(auth);

               ^~~~

               auto

exit status 1

'auth' was not declared in this scope


Dit rapport zou meer informatie bevatten met
"Uitgebreide uitvoer weergeven tijden compilatie"
optie aan in Bestand -> Voorkeuren.

Isaak

idv7:
My bad.

I think put it in wrong... In my origenal code it was like you said.

Isaak

So is it compiling now?

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