Giter Club home page Giter Club logo

Comments (6)

RigTig avatar RigTig commented on May 27, 2024

Aha! Maybe not RTOS. It seems that the get has the station mode hardcoded into the request, so getting the IP address in AP mode (or the AP address when in both station and AP) only returns the station address. Now if this is true, then it also seems the set has the index hardcoded to AP address. Anyway, I've pushed the limit of what I can do. Please check further.

In wifi.forth,
: wifi-ip ( -- str ) here 16 allot 16 over wifi-ip-str ;

In ext.S,
defprimitive "wifi-ip-str",11,wifi_ip_str,REGULAR DPOP a2 // buffer DPOP a3 // buffer size CCALL forth_wifi_get_ip_str NEXT

In forth_wifi.c,
void forth_wifi_get_ip_str(char * buffer, int size) { struct ip_info wifi_info; sdk_wifi_get_ip_info(0, &wifi_info); struct ip_addr ip = wifi_info.ip; snprintf(buffer, size, IPSTR, IP2STR(&ip));

Now, I cannot find the code for sdk_wifi_get_ip_info() but the nearest I get is Espressif document 20B-ESP8266_RTOS_SDK_API Reference.pdf which says
image

from punyforth.

zeroflag avatar zeroflag commented on May 27, 2024

thanks for the finding, I'm going to check this

from punyforth.

RigTig avatar RigTig commented on May 27, 2024

It occurs to me that when in dual mode (STATIONAP_MODE) that there are two possible IPs to set and get, so it seems that those forth functions need to either have a parameter to say which IP or for there to be different words in forth.

from punyforth.

zeroflag avatar zeroflag commented on May 27, 2024

I introduced a new word:

: softap-ip ( -- str ) 1 ip ;

This works the same way as wifi-ip but gets the softap ip instead of the station ip. I also modified wifi-ip as follows:

: wifi-ip ( -- str ) 0 ip ;

I didn't rename wifi-ip to station-ip because of backward compatibility.

from punyforth.

RigTig avatar RigTig commented on May 27, 2024

Thank you for the new word. It has allowed me to poke around further. I have noticed that the softap configuration is not remembered by the ESP8266, so needs to be set up each boot. This might well be an RTOS issue or might just be that there is a flag somewhere to make the configuration stick. For my purposes, it is not an issue at this stage, since initialisation code is needed anyway.

You might like to revisit the comment in readme.md which says

The Wi-Fi settings are persistently stored by the ESP8266, there is no need to setup the Wi-Fi at every startup.

from punyforth.

zeroflag avatar zeroflag commented on May 27, 2024

Thanks, I updated the comment in readme.md.

from punyforth.

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.