You cannot connect a relay to a virtual pin - it’s virtual and doesn’t physically exist. Your relays will be connected to physical pins , labelled D0, D1, D2 etc on your board - but they should be disconnected for initial testing until your disconnection issue is solved.
I don’t understand what you mean by this.
The best solution would be for you to create a new Blynk account using a new email address. This would be created by default on your local Frankfurt server and overcome the redirection issue (assuming that it is actually an issue). However, if you’ve bought any energy on your existing account this would not transfer to your new account.
The Vin pin is “Voltage In” and is a way of providing power to your NodeMCU as an alternative to the USB connection. Once you’ve solved the disconnection issue then you could power both the NodeMCU and the relays from one 5v power supply using this pin and the VCC pin on the relay board. For now, use the USB connector and leave the relays fully disconnected.
You should create a project in this account, generate an Auth code and use this in your code. You will need to add the widgets and attach them to the correct virtual pins.
Trial and error!
As I’m in the UK, Frankfurt is my local server, so entering…
blynk-cloud.com/your_auth-code/project
should have returned information about your project, but instead it gave me ‘invalid auth code’ which told me that the project lives on a different server.
I replaced blynk-cloud.com with the IP address of the New York server with the same result. Doing the same with the IP address of the Singapore server gave me the data I was looking for.
so i changed the auth token and the serial started to 9600 it ran for 5 hours without restart then again about 13 hours over night and now it goes offline again very often. unfortunately i can only check the monitor on saturday.
When you say “changed the Auth code” do you mean that you re-created your project in the Blynk account that you set-up and are loved-in to that account on your phone and are using a corresponding Auth code for a device linked to that account in your sketch?
Also, I strongly disagree with the notion that serial monitor baud rates above 9600 can cause reboots with this hardware.
In my opinion, you should always run the serial monitor at the native baud rate for the board you are using. In the case of the NodeMCU this will probably be 74880.
The reason for doing this is that the board will output valuable data to the serial monitor when it boots-up, but that data will be at its native baud rate. If you have your serial monitor set to a different baud rate then this data will either not show up, or appear as random characters on the screen.
Matching your serial monitor output to the native baud rate for your board allows both system messages from your board and debug data from your sketch to be viewed in the serial monitor at the same time.
There is a scenario, where a ‘virtual’ serial port is created using the SoftwareSerial library, where restricting the baud rate for that virtual port is necessary - but that is not the case here.
Seeing the output from your serial monitor, when it’s set to the native baud rate for your device and the sketch is using the same setting, would be very useful as it would show whether your device is rebooting when a Blynk disconnection/reconnection is taking place. If it is, then the system message will show a code which gives the reason for that reboot.
If the disconnections do not coincide with reboots then we need to start looking at other issues like WiFi signal strength etc.
If you are physically away from your hardware and MacBook during the week then maybe something like TeamViewer would be useful way of monitoring your serial output?
That should be perfect, but if the device isn’t rebooting each time the connection drops then the issue is most likely somewhere along the route between your device and your router, or the router to the Blynk server. Knowledge of whether or not a reboot occurs each time the connection is dropped, and if so what the reboot cause is would be extremely useful in narrowing-down the issue.
If your router is a cheap one that could be the problem. I have found from experience certain brands work better than others. In Canada I use a $150 Asus.
So why aren’t you using Node-Red and the Blynk plug-in and controlling your NodeMCU via MQTT?
I personally never run Blynk code on my devices, they are all running MQTT with Node-Red acting as the ‘glue’ that provides the Blynk integration.
yes i tried it once i couldn’t get it to work so i looked for someone on freelancer. So I don’t know how, so to speak. So the add-on yes, but I did not get the mqtt to run. And how to connect it… i appreciate these devices and programs but unfortunately i just don’t have the time to “program” them so that they work together. set that, but not I call it connect.
Well, that approach didn’t work very well, did it?
The problem is that if you want to do customised home automation projects then you have to get your hands dirty at some point. The advantage of Node-Red is that it’s a drag and drop visual environment, which can make it easy to get started quickly - but it’s also very powerful and allows you to do more advanced stuff if you wish.
my home automation works it all works just integrating it into hassio blynk did not work i did not get the mqtt to work i did not know how to connect it to blynk