Comments (3)
The characters maybe from bootloader(in baud 74880). can't be switched off.
There are another 2 pins in chip can be used as uart, if we swap to these pins. no more garbage.
but since ESP-01 or some other modules didn't have them out. so can't turn it off in these modules.
wifi.sta.getip() always return a string now.
which is better?
maybe return two results?
ip, got = wifi.sta.getip()
if got==true then..
or,
ip = wifi.sta.getip()
if ip~=nil then...
from nodemcu-firmware.
Hi
Thanks for the explanation- as you say we are stuck with the pins we have available... Oh well it was worth trying :-)
I'm still getting to grips with Lua's ability to return more than one argument - I think it's wonderful.
But I would say that perhaps your second option is the best? Right now mine returns "0.0.0.0" if there is no initial connection - I would be happier if NIL was returned.. but that also begs the question - do you CHECK... for example let's say we already have a connection and the home router gets turned off - would you still return the IP?
What I'm trying to achieve is to be able to tell if we currently have a connection - so that, for example in a small unit controlling a light removely by a phone, if the router failed - we could detect lack of Internet - and reboot the board after a short delay.
I'm assuming that right now if connectivity is lost momentarily, we are in trouble?
from nodemcu-firmware.
No check for the connection to router, in nodemcu.
but the low level sdk will check and return a 0.0.0.0 if the current ap/router failed.
there is still a bug in it. sometimes router failed like 1s, we can get a valid ip, but can't connect to network anymore.
it's hard to detect. but a wifi.sta.disconnect() and wifi.sta.connect() will solve this.
from nodemcu-firmware.
Related Issues (20)
- ESP32: Cannot send files to device HOT 1
- ESP32: Not enough memory to load library HOT 1
- ESP32: dev-branch doesn't build out of the box
- Typo in docs/modules/spi.md
- Release version issue snprintf
- Lua httpserver duplicates status line HOT 1
- enduser resets any connection to http port
- Error during build: "as: unrecognized option '--text-section-literals'" HOT 3
- Add support for BMP390 sensor
- Flashing on ESP32-C2 not working HOT 5
- Add the rotary module to the ESP32 version
- Integer overflow (leading to stack-based buffer overflow) in embedded lua_struct.c HOT 2
- Here is a negation overflow in lua HOT 2
- Support the RGB LED used on the ESP32-C3-DevKitM-1
- Add support for matrix keypads to ESP32
- Making the lua component more standalone
- MQTT connect failure callback reason constants
- πESP8266 attempt to index global 'softuart' (a nil value)
- add module βRDA5807Mβ
- PR#3646 broke the 'file upload' function in ESPlorer HOT 11
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 nodemcu-firmware.