Giter Club home page Giter Club logo

Comments (3)

 avatar commented on May 18, 2024

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.

scargill avatar scargill commented on May 18, 2024

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.

 avatar commented on May 18, 2024

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)

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.