Giter VIP home page Giter VIP logo

Comments (6)

JAndrassy avatar JAndrassy commented on July 18, 2024

you mean WiFi.config

from wifispi.

madmetz avatar madmetz commented on July 18, 2024

No, we are talking about WiFiSpi here - I thought. ;-)
Pls look at file WiFiSpi.h
But you are right - Of course I meant ".config" and not ".begin"
Thanx anyway.

from wifispi.

JiriBilek avatar JiriBilek commented on July 18, 2024

Hi, I can't do any tests now. I'll be back in the middle of September.
Looking at the code I am afraid the code won't work without entering a gateway address. Precisely speaking, without specifying the gateway address, the gateway IP is set to 0.0.0.0. I can't test it, I've only looked into the sources.

Look at:

  1. library WiFiSPI, file WiFiSPI.cpp, function bool WiFiSpiClass::config(IPAddress local_ip)
  2. then app WiFiSPIESP, file WiFiSPICmdGeneral.cpp, function void WiFiSpiEspCommandProcessor::cmdSetIpConfig()
  3. then library ESP8266WiFi, file ESP8266WIFISTA.cpp, function bool ESP8266WiFiSTAClass::config(IPAddress local_ip, IPAddress arg1, IPAddress arg2, IPAddress arg3, IPAddress dns2)
  4. and finally <arduino_path>\hardware\esp8266\esp8266\tools\sdk\lwip\src\core\netif.c, function void netif_set_addr(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask, ip_addr_t *gw)

If it were so, I'd have to delete the function bool WiFiSpiClass::config(IPAddress local_ip) from the library.

from wifispi.

JAndrassy avatar JAndrassy commented on July 18, 2024

the Arduino's WiFiNINA and WiFi101 have the same error. the code to create the addresses is missing.
I have a PR for booth
arduino-libraries/WiFiNINA#219
arduino-libraries/WiFi101#326

from wifispi.

madmetz avatar madmetz commented on July 18, 2024

@JiriBilek, @JAndrassy
Hi and thanx for your replies.
I had a look at all the files and functions you listed and it's exactly the same on my machine.
Then I tried to find a workaround and decided to take my own ip address as gateway and dns like this:
#ifdef IP_ADDRESS
IPAddress local_ip(IP_ADDRESS);
#ifdef DNS_ADDRESS
IPAddress dns_server(DNS_ADDRESS);
#else
IPAddress dns_server(IP_ADDRESS);
#endif
#ifdef GW_ADDRESS
IPAddress gateway(GW_ADDRESS);
#else
IPAddress gateway(IP_ADDRESS);
#endif
#ifdef SUBNET_MASK
IPAddress subnet(SUBNET_MASK);
#else // if none specified we assume the smallest network class (C)
IPAddress subnet(255, 255, 255, 0);
#endif
#endif

At least it works this way and I couldn't find any problems so far.
BTW: do you know if there is example code that makes the AVR (Mega) / ESP8266 work as a server that supports multiple sockets? The Ethernet library has a function "Ethernet.accept" which is missing in the WiFiSpi library.

from wifispi.

JAndrassy avatar JAndrassy commented on July 18, 2024

BTW: do you know if there is example code that makes the AVR (Mega) / ESP8266 work as a server that supports multiple sockets? The Ethernet library has a function "Ethernet.accept" which is missing in the WiFiSpi library.

my WiFiEspAT library with Jiri's ATMod firmware

from wifispi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.