Handle on Invalid token!

i want do some codes when token is invalid .



:joy: How can i do this?

i do not understand what is the question?

1 Like

i defined a char(myssid) to the ssid char *ssid = myssid; so my problem is here that when i change myssid my device will be connected to router, so why?

another question is here that when i want to use a ESP8266 as a Blynk’s device and a WebServer so on default of both sketch defined different ssid and SSID or pass and PASS how it use single of both?

Same here…

@sh.abar.mard The validity of a token will depend on connecting a sketch to the correct Account, on the correct Server, in which the token was generated from… so what exactly are you trying to do here??

1 Like

another question is when token is invalid how can i handle reconnection period time?

what about this?

Sorry, I am having a hard time understanding any of your questions :blush:

It seems you are looking for ways to hack the libraries to do strange things based on errors, that you seem to anticipate happening… because you are doing strange things with your sketches :stuck_out_tongue:

But whatever it is you are trying does not seem “normal”, so I am unsure how anyone can answer your interesting questions.

1 Like

:neutral_face:absolutely not cause i can’t i do and not need to do this.
i want to set auth, ssid, pass and server address with the web server like as this topic

but i want to do this with webserver on own esp.
so this action is hacking sketches?

In a sense… Yes… and that is NOT a bad thing :stuck_out_tongue:

I am not putting down your attempts… I just don’t fully understand what you are trying to accomplish. and I don’t seem to be the only one.

1 Like

If you don’t want to use Blynk’s awesome provisioning system then I think you need to ask your question regarding webserver authentication on the ESP forums.

What prevents you using Blynk’s system?

1 Like

I just asked how i define a char variable to ssid of blynk sketch?

It depends on the full context but I would use the system that’s frowned on by real coders, String.

That is myssid would be a String and then do a String to char array conversion when you want to make it equal to the char array ssid.

I grew up with String even when it was considered a sin to use it due to memory restrictions etc. With ESP’s memory is not really an issue.

1 Like

@Costas please look at replied post.:point_up_2:t2:
what about this?

I have a char variable that i put the ssid to it but when do ‘’’ CPP char ssid = myssid;’’’ it dosn’t any change on ssid and device will be connect to last defined directly same as ‘’’ char ssid = " blynk ssid"; ‘’’
Why i put another thing in ssid but it connected to old ssid that i delited it?

Provide details of the variable declarations and a snippet of the code you are using, what the results are and what you were hoping the results to be.

Ensure code is forum formatted and the smallest snippet possible that clearly highlights the problem.

How on earth did I miss this topic? This is epic!



//Read SSID
  for ( i=0; i<=(SizeSSID)-1; i++) { // SizeSSID is EEPROM sizeof character.
   mySSID[i] = EEPROM.read(i);
Serial.println("SSID is: ");

it will be shown my custom SSID.
so :

ssid = mySSID;

should be change the ssid to my custom SSID but the device connect to old SSID and doesn’t affect.
i did same code correctly for the auth.