yes yes, i know, don’t use delays, I’m aware, you can see in my code that’s it’s not my first time using timers. Let’s stay on topic please, the problem I want resolved is the connectivity issues. I spoke too quickly about the delay(1000).
The legacy works, Blynk 2.0 doesn’t. That’s the issue. The rest I’ll optimize later.
I’ve added the extra statements suggested, but now I’m getting a different error.
“Error compiling for board Generic ESP8266 Module”
At least it’s a different error, but now it won’t compile.
What is the MCU you are using ? Nodemcu dev board ? Please provide all the necessary details.
If you are aware of how blynk works, then you have to clean up your code properly. Only then we can rule out few things and concentrate on the other aspects. When we are not sure what is going on when n where we cannot get things straight.
I would suggest you to start with bare min sketch from example folder, compile n upload the code. If the board connects n start working then, the code you have right now are having errors.
If not your board selection may be wrong n many other aspects.
I already sent the link of the wiki page of the board I’m using.
Like I said, the code works on blynk legacy, and stays connected. All that’s different is Blynk 2.0, I just need to know what I have to do differently to transition to the new Blynk.
I’m sending this updated code just so we can stay on topic.
@calandry86 I think you’ve been slightly confused by the post from @John93
I think what he was trying to say is that these two lines of code…
Need to the the first two lines of code in your sketch.
You don’t need to add-in any additional lines of code, simply move those two lines to the top of your sketch
The issue is explained in more detail in this topic…
At the moment, you still have this line of code at the beginning of your sketch, which (I assume) is causing the issue…
I’m also skeptical about whether this line is needed at all, but if it is going to appear in your sketch then it needs to be moved down so that it is after the Template ID and Device Name lines.
One thing that you’ve not provided is any information about what appears in your serial monitor when you boot your device and it attempts to connect to Blynk.
Your serial monitor is the most powerful debugging tool available to you (and therefore to us as well) and without the information that this provides we are all just guessing about what is actually happening when the device tries snd fsils to connect to Blynk.
ok great, I’ll try those changes and see if I get better success, if not I’ll send you the serial monitor data. I’ll delete those extra lines too, like the firmware version etc…
You still haven’t taken onboard the comments about your void loop and the issues that could lead to you flooding the Blynk server sign virtualWrite commands.
Why don’t you simply use a timer to read your analog pin and send the results to Blynk?
It just wasn’t the issue I was interested in, the code isn’t even what I’ll be using. Most of the time I use stepper motors, and the timers don’t work well on them, so I just end up disconnecting using delays, then I can use the processor only on pulsing (at 300 microseconds, the CPU really can’t do any other function), then reconnect when the motors stop.
I’m not surprised, when you use two timer objects, when a single timer object can support up to 16 timers - and then you only service one of those objects in your void loop
If you want to learn how to use timers correctly then you should read this…
If you’re posting code that you want assistance with and
then I think you’re taking the wrong approach to seeking assistance.
This forum topic was on connectivity issues from converting from Blynk 1.0 and Blynk 2.0. When people who have similar issues, and looking for answers on forums, they are looking for answers on the topic in question. You’re making them scroll through too many topics to find their answers. That being said, this topic is resolved. The order of where to place the 2 extra #define statements for Blynk 2.0 version mattered for anyone who had similar issues.
If that’s the real name for your SSID, I’d suggest to eliminate spaces and apostrophes (replacing them with “_”) to prevent possible problems with some WiFi devices.