Comments (6)
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
from punyforth.
thanks for the finding, I'm going to check this
from punyforth.
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.
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.
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.
Thanks, I updated the comment in readme.md.
from punyforth.
Related Issues (20)
- Complete word list with usage HOT 2
- Just for fun
- Mistype in README.md HOT 1
- A new fast flash utility HOT 1
- An interesting bug in the example dht22-data-loger or in netcon?
- highbit HOT 6
- Seriously? Python?
- Contributions HOT 2
- Convert flash.py to python3 HOT 1
- Flash starts but doesn't finish properly HOT 5
- Different speeds for multiple motors
- Word Glossary I have written HOT 3
- TASKS - when restarting a task, the data and return stack are not empty HOT 1
- Connected but no sending from the terminal HOT 1
- port on ESP-01 ? HOT 1
- Can TCP REPL eval be replicated using just strings? HOT 2
- TCP-REPL triggers ESP8266 Restart? HOT 3
- Receiving binary data via UDP
- This line should be.... .int xt_drop2
- Feature request: forth repl on tcp/ip or i2c HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from punyforth.