-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exemple of init.lua with wifi portal #3395
base: dev
Are you sure you want to change the base?
Conversation
As a stylistic point, I'd make In my code, I always start the enduser_setup -- it exits once the connection is up -- no matter whether the user configured it, or whether a previously set SSID was found. |
Now it is - I just changed the base branch. Also, please fix the CI build issues: https://travis-ci.org/github/nodemcu/nodemcu-firmware/jobs/757193097 |
@@ -0,0 +1,34 @@ | |||
-- init.lua example, with wifi portal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should IMO go into a sub directory like e.g. lua_examples/eus/init.lua
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that this init.lua is "eus" specific. I have no problem moving it to eus. However, maybe we could group all examples of init.lua together... one with eus, one for waking up after deep sleep, other situations.... All I know is that when we need those examples, they are scattered around the docs, so a directory "starting up" might also work. Its up to you, I'll follow your suggeations and update the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we could group all examples of init.lua together
Good idea! Do you have a naming proposal? A directory called init_lua
and then files like e.g. eus-init.lua
?
https://nodemcu.readthedocs.io/en/latest/upload/#initlua -> move from docs to a file in that new folder, add reference to existing docs chapter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blobule still interested in following up on this?
To answer, @pjsg, we can't make Unfortunately, |
@blobule "I don't see any way around this" -- Use a tmr. ;-) |
You can disable checks in luacheck by adding a comment. See the luacheck documentation |
Fixes no specific issue,
dev
branch rather than for therelease
branch.docs/*
.Following a suggestion in #3374 , this is an example for a init.lua that uses a wifi portal to configure wifi if needed.
I put it inside lua_examples, but I don't know how and where to refer to this in the docs. Suggestions?
Also, I wonder if it would be interesting to provide complete examples for some common IOT setups:
( Here robust means that it will survive power outage, network outage, etc, and always restart properly. )
Such examples could make it much simpler to setup IOT by providing a good template.
Juste wondering if this is something that would be considered useful.