I can’t use:
IPAddress local_IP(192, 168, 1, 40);IPAddress gateway(192, 168, 1, 202);IPAddress subnet(255, 255, 255, 0);IPAddress primaryDNS(8, 8, 8, 8);IPAddress secondaryDNS(8, 8, 4, 4);
I can not use in conjunction Mega and ESP8266, only dhcp. Help me find a solution.
This board does not, but in conjunction with the eps8266 why not? After dhcp works. Just in the library for this bunch there are no indications of what I need.
My idea is to add the necessary functions to the library.
i can add: #include <IPAddress.h> //for IPAddress local_IP(192, 168, 1, 40);…
and i think it is the solution for my question
but when i add #include <WiFi.h>
there is error: Compilation error for Arduino/Arduino Mega or Mega 2560.
That is because you are using a command that has no place with an ESP as shield secerio, thus not part of the “As shield” library.
With AT firmware, the ESP becomes a simple Serial to WiFi transceiver and is not directly programmable. Instead you use a Blynk Library and commands compatible with the Arduino.
AFAIK there is no “official” Blynk way to set static IPs for Arduino with ESP as shield configuration.
There are a few references about it in this forum - Esp8266 shield manual IP But mostly beyond my thinking abilities right now so I will have to step back and watch. Besides, I just use DHCP and set IP reservations in my router based on MAC.
one more way:
To configure a separate ESP as the reader port of the Mega and the sender to the Blynk.
Question how to assign data from rx / tx to a virtual Blynk port.
Or take esp8266 and PCF8575 and CD74HC4067 and throw Mega 2560