witnessmenow / Universal-Arduino-Telegram-Bot

Use Telegram on your Arduino (ESP8266 or Wifi-101 boards)
MIT License
1.12k stars 307 forks source link

Does not work with Static IP ?? #133

Closed consolacion closed 4 years ago

consolacion commented 4 years ago

EDIT apologies. the problem was in me being lazy with configuring the static IP with: WiFi.config( ip, gateway, subnet );
that works......most of the time, but not always. Using WiFi.config( ip, dns, gateway, subnet );
solved the problem

============================================== The library works great. My compliments. However, when instead of letting DHCP assign a an IP nr, I tried a static IP in the conventional esp8266 way, I found it not working. I get the right ip nr assigned, I see the IP nr appear in my router table, the serial monitor prints out the IP....and then nothing, No incoming messages registered.

I can't imagine this to be a problem. but yet it appears to be.

I use IPAddress ip( 192, 168, 1, 34 ); IPAddress gateway( 192, 168, 1, 1 ); IPAddress subnet( 255, 255, 255, 0 );

WiFi.config( ip, gateway, subnet ); // <= Problem here WiFi.begin(ssid, password);

and I set: client.setInsecure();

When I comment out the WiFi.config...the bot works, when I leave it in it doesnt I can live without Static IP, but it intrigues me why it wouldnt work with the bot