Cant get Wifi working

Hey there.
Im fairly new to Blynk and appreciate your Work!

Im Working on a self-made Macro Rail for Photography and found a very useful code (in commentary section)

since I dont have a wifi shield for my Arduino and some Nodemcu’s laying around, I want to use it instead of the Arduino.
The “basic” code works finde without any issues but when I start to implement some of those “Wifi connection samples” from the Arduino IDE it won’t compile because of “multiple variable definitions”

You can find my code on Pastebin: https://pastebin.com/Tsqyy6QR
My Errors: https://pastebin.com/fk7gSHkt

I hope there is someone helping me out…

I got the basic code from: https://peakd.com/@markangeltrueman/building-a-photography-macro-rail-for-focus-stacking-part-3-control-with-blynk

Hey there,
Please post your sketch here instead of external link and make sure to add triple backticks at the beginning and the end of your sketch, triple backticks look like this```, and give more details.

I’ve changed the sketch so that it will work with a NodeMCU, here is the revised first part of the code. Noithing beyond void setup has changed, so I’ve not included that part…

#define BLYNK_PRINT Serial
#define BLYNK_MSG_LIMIT 0
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
 
char auth[] = "blynk key";
char ssid[] = "wifi ssid";
char pass[] = "wifi pass";
 
const int stepPin = 13;
const int dirPin = 12;
const int shutterPin =14;
 
bool moveForward = false;
bool moveBackward = false;
const double pitch = 2;       // pitch in mm
const double stepAngle = 1.8; // angle per step
double distance = 0;
double numImages = 0;
bool runIt = false;
bool autoMode = false;
double startStep = 0;
double endStep = 0;
double currentStep = 0;
 
void terminalout(String out)
{
  Blynk.virtualWrite(V2, out + "\n");
}
 
void setup()
{
  /*
     Sets the two pins as Outputs
  */
  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
  pinMode(shutterPin,OUTPUT);
  Serial.begin(74880); // This should be the native baud rate for your NodeMCU
  Blynk.begin(auth, ssid, pass);
}

I have to say that there are some parts of the code that are far from ideal, such as the cluttered void loop and the use of blocking delay commands, but this should at least get you started.

I’d be interested to see what sort of results you obtain. Setting-up a macro focus stacking rig is one of the things on my "to-do- list, but i think I’d want to invest a reasonable amount in a good linear stepper slide, and that side of the project gets expensive.

Pete.

How do i do this?

Thank you PeteKnight!
The code does still not wok and im unable to figure out why.
My Errors: https://pastebin.com/X1SqMVgZ

I will share my 3D Models and Schematics if it works.
“Extreme Macro Photography” is very expensive, my Controller should work with any Stepper Motor when its finished.
iI Printed the rail to, the full Project costs about 30 Dollars but I think I will buy a more massiv (full metal" Linear Rail from Aliexpress. I think my Canon 6D could be way to heavy for the Printed one.

I will share some pictures later this day if you want?

What version of the Blynk library do you have installed, and how did you install it?

I think that would be $30 wasted!

I agree!

Pete

30 Dollars is pretty cheap if you compare it to a Stackshot or something else.
The Controller should be able to run every Stepper Motor from 12v to 24v. (:

Im using the Blynk Libary 1.0.1, should I install another one?

Yes, and you’ll get a $30 paperweight that will be good for nothing, then you’ll end-up buying a $200 linear slide (depending on the travel that you want) and the $30 will have been a waste of time and effort.

As you’re using the Legacy app you should be using version 0.6.1
Did you install 1.0.1 via the Arduino IDE ?

Pete.

Yeah, I think my rail won’t done the trick.
But the 30 Dollars is the Rail with the Controller I can use with a better Linear Slide. :slight_smile:

Yes, I’ve installed it via Arduino IDE.
Im using Blynk 2.27.32 not Blynk IOT the Guy who programmed this Code was using the old Version too.

You can use blynk legacy sketch with blynk IOT after some modification, check this out

it depends on the type of controller. You might want to take a read of this, about the best type of driver to use…

Pete.