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

Ability to insert random number or string into config files like WiFi #23

Open
jywarren opened this issue Sep 24, 2018 · 5 comments
Open
Labels

Comments

@jywarren
Copy link
Member

This could be useful in setting up a whole set of different Raspberry Pis to be used in the same place -- so the WiFi networks won't overlap.

The current default is 00-PiCamera but we could have this change to 00-PiCamera-XXX where XXX is a random string.

Maybe this could be a simple shell script to create an environment variable as $RAND_STRING or something?

@icarito
Copy link
Member

icarito commented Oct 13, 2018

Here's a recipe for a random 6-char string in bash:

RAND_STRING=`date | md5sum | cut -c 1-6`

We would need to run sed at build time to change relevant files in builder/files/etc/.

@jywarren
Copy link
Member Author

jywarren commented Oct 17, 2018 via email

@icarito
Copy link
Member

icarito commented Oct 20, 2018

Yeah the thing is I'm not sure what to implement because there are several levels to this.
For one thing there's the hostnames which will interfere if we rely on mdns/zeroconf - so we need unique hostnames but then they'll be unpredictable - then there's the wifi hotspot.

One could think to do this at first boot, but it will be nearly impossible to get a random bit on first boot on identical hardware without networking or a RTC (unless I'm wrong on that!).

This requires some research!

@jywarren
Copy link
Member Author

jywarren commented Oct 20, 2018 via email

@jywarren
Copy link
Member Author

How about we decide to make a script that uses the system clock to add 2 random alphanumerics to the end of the WiFi network name. This way the URL stays the same, but we would get 00-PiCamera-XX if you press that button. This way we get good pseudorandomness (timestamp the button is pressed) and it's optional on all devices.

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

No branches or pull requests

2 participants