Even as simple as Blink Sketch was ended the same:
/*
Blink
http://www.arduino.cc/en/Tutorial/Blink
*/
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(2, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(2, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for a second
digitalWrite(2, LOW); // turn the LED off by making the voltage LOW
delay(500); // wait for a second
}
FYI: I’m using ESP 8266-12E, and tried several circuits and ended the same … fortunately the system is running well … Just worried maybe causing a long term problem …
I am completely confused from this discussion.
What is changed? I think, new sketch use port 8080 instead of port 8442.
That’s all. Or are there also any other changes?
Why I should add this port forwarding to the Blynk server:
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
What has port 80 to do with 8080 or 8442 ? Many people use port 80 for HTTP server. It is not possible to forward it to 8080.
@cj190133 with latest firmware default port is 80 unless you change it. So if you owner of local server you have to do port forwarding as local server uses 8080 by default (as 80 port requires root right). That’s it. For those who uses Blynk cloud you have nothing to worry about.
@Dmitriy,
Hi Dmitriy,
thank you for answer.
I use my own Blynk server and currently I am using following command in sketch:
Blynk.begin(auth, server_ip, 8442, arduino_ip, dns_ip, gateway_ip, subnet_mask, arduino_mac);
After update Blynk Library to 0.5.1 I can use following command:
Blynk.begin(auth, server_ip, 8080, arduino_ip, dns_ip, gateway_ip, subnet_mask, arduino_mac);
I am right ?
Which port is preffered for hardware on local Blynk server in the future ?
Best Regards
Jozef
@Dmitriy, after upgrading from 0.5.0 to 0.5.1, i observed that the device type changed from “esp8266” to “arduino”. this could be because of some changes in the new library? or why is it so?
anyone else observed this? please look at the terminal line 3 and last.
@Dmitriy
That’s OK, “fixed”!
It looks like hardware calls use the same port as RESTful api.
I was wondering is there any way to “ping” the local server via REST?
@Dmitriy
Sure i can. i’m already using REST to exchange data between my hardware, server and app.
The weird thing with REST is that while exchange of data is normal, there is an “Offline” indication in the application.
There should be some kind of “ping” from the hardware to the server periodically, informing that hardware is alive.
This is missing from REST. I was wondering if there is a way to implement it.
Ok, I give up. I can not get the new library 5.1 to work not matter what I try.
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080 Causes raspberry pi 3 to freeze
#define BLYNK_DEFAULT_PORT 8080 // does not work.
Blynk.config(auth_local_server, local_server, 8080); // does not work.
Or make port forwarding from 80 to 8080. // is not available because I have a web server.
I see these statements. They conflict me.
----- @cj190133 with latest firmware default port is 80 unless you change it.
----- 8080 now is the default port for hardware on the Local Server.
I done a port forward of 8080 to the pi server ( Blynk server) . // does not work.
I’m just going to go back to library 5.0 until we get finished monkey-ing with all the ports
Try to define it directly inside BlynkConfig.h #define BLYNK_DEFAULT_PORT 8080
It worked for me. (although different port)
edit: this #define doesn’t work in sketch (for me), as it is overwritten by lib. It might be, the compiler must know you want to use local server (another #define?)