I just created a project with a moisture sensor and a button that should activate a relay.
When I join the Blynk cloud, everything is working, I can see the values of the sensor and when I push the button, the relay activates. If I only change the code to my connect to my local Blynk server (on a Raspberry Pi), I am able to see the sensor data without any problem, but the relay does not activate when I push the button (should activate D1). Do you have any idea why is this?
Thanks for the help. I will provide the code later but it is very simple. I am only connecting to my server and with a timer uploading the data of the moisture sensor.
The problem is not there. The problem is that when I create a widget in my Android app and create a button to activate the digital output D1, this is working for the blynk cloud server but not working for my local server.
I am just connecting through internet to my local server with a dynamic ip service (not from the Intranet inside my network, but outside it). I can connect to the server, create projects, put widgets to read the values of the sensors, but I cannot send an order (e.g. put D1 to 1) to my microprocessor. Is there a special port I have to open to do that?
Yes, I am connected outdoor. I have already opened a few ports, (9443 and 8443). I have set the http/webmin port to 8082 but I didn’t open in my router.
Do the communication for the widget button goes through a different port as the gauges? I can see the values of the gauges and also the values of the Super Chart but I cannot send an order to my microcontroller.
No special ports needed for that, but having the correct device type in your project will make a difference with direct GPIO manipulation as opposed to using vPins, which don’t care of the device type.
You also might want to make sure the Auth code and App connection are correct for your server and not for the Cloud… I have banged my head a few times with issues before realising which server I was connected to
If you have multiple devices in a project then you can have two buttons next to each other on the same screen controlling different devices, hence my question.
However, it seems that you’ve identified the problem as being the wrong device type.
Just writing here to confirm that the problem was that I had defined the device in the app as “Wemos D1” and I was using a “Wemos D1 mini”. After changing it, everything worked perfectly!