Skip to content
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

Simplify and make WiFi configuration consistent between examples #193

Open
fhunleth opened this issue Apr 10, 2021 · 4 comments
Open

Simplify and make WiFi configuration consistent between examples #193

fhunleth opened this issue Apr 10, 2021 · 4 comments

Comments

@fhunleth
Copy link
Member

Currently some examples allow you to hardcode WiFi credentials in firmware by setting environment variables. This isn't supported by all examples and its implementation is inconsistent. I would be nice if there were common instructions for setting up WiFi and that every example that could use WiFi would be done the same way.

@mnishiguchi
Copy link
Member

@fhunleth Is it doable to standardize on nerves_livebook's firmware provision options?
https://github.com/livebook-dev/nerves_livebook#firmware-provisioning-options

@fhunleth
Copy link
Member Author

fhunleth commented Oct 7, 2021

The Nerves Livebook firmware provisioning is needed since you download images rather than build firmware yourself. All of the Nerves examples are built, so there are more options available and hardcoding network options may arguably be the most instructive to people learning Nerves. I lean towards less code in the examples if possible so that the key thing they show isn't obscured.

I'm also hesitant to promote the Nerves Livebook route. It was convenient, but there's work for every key/value that you export. What I'd really like is a generic way to update the application environment. Perhaps a ConfigProvider that reads from Nerves.Runtime.KV so any application environment key can be overridden. I think there are edge cases that need to be thought through on this especially on how to recover from bad settings.

@mnishiguchi
Copy link
Member

Ah I see. Thanks for your explanation!

@mnishiguchi
Copy link
Member

mnishiguchi commented Oct 8, 2021

Maybe we can just use this pattern for all the examples, until we have plans for the ConfigProvider thing? https://github.com/nerves-project/nerves_examples/blob/main/hello_phoenix/firmware/config/target.exs#L75-L88

And if it is OK to be the default, maybe we could let the hex nerves.new generates that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants