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

Added the ability to specify a .json file to skip the wifi prompts #225

Closed
wants to merge 0 commits into from

Conversation

@markterrill
Copy link
Contributor

commented Mar 19, 2016

Hi,
Taken the liberty of adding the ability to specify a .json file with the wifi settings you want to push. This skips the need to either write an expect script or do it manually for x hundred particle devices.

As the serial command currently expects any 'extra' arguments to be the serial com device, you need to append the .json argument to the end, ie:
particle serial wifi /dev/cu.usbmodem1411 variables.json

variables.json looking like:
{
"network":"mynetworkssid",
"security":"WPA_AES",
"password":"mySecret!"
}

@coveralls

This comment has been minimized.

Copy link

commented Mar 19, 2016

Coverage Status

Coverage decreased (-0.4%) to 18.815% when pulling 7c55d3c on markterrill:master into b64252a on spark:master.

@markterrill

This comment has been minimized.

Copy link
Contributor Author

commented Mar 19, 2016

PS, used an external file in preference to more arguments as then the file can be secured outside of direct application code in a startup/setup script

@brycekahle

This comment has been minimized.

Copy link
Contributor

commented Apr 21, 2016

@markterrill Would you mind signing the CLA as described here? Thanks.

@markterrill

This comment has been minimized.

Copy link
Contributor Author

commented Apr 22, 2016

Done!

Mark Terrill | 0412 704 411

On 22 Apr 2016, at 03:03, Bryce Kahle <notifications@github.commailto:notifications@github.com> wrote:

@markterrillhttps://github.com/markterrill Would you mind signing the CLA as described herehttps://github.com/spark/particle-cli/blob/master/CONTRIBUTING.md? Thanks.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHubhttps://github.com//pull/225#issuecomment-213017452

@markterrill

This comment has been minimized.

Copy link
Contributor Author

commented Apr 22, 2016

Done

@technobly

This comment has been minimized.

Copy link
Member

commented Feb 8, 2017

This is great! You can put something like this into your .bash_profile to target specific port of a USB hub with labeled cables, e.g. #1 - #6. Here’s the function for cable #2. Done this way so credentials are not stored in a random file and place on my computer.

alias listen2='stty -f /dev/cu.usbmodem141431 28800'

function wifi2()
{
  echo '{"network":"MY_SSID","security":"WPA2_AES","password":"MY_SUPERPASSWORD"}' > whatchamacallit.json
  particle serial wifi /dev/cu.usbmodem141431 whatchamacallit.json
  rm whatchamacallit.json
}

With these two aliases you can automatically put your device in Listening Mode and update it's WiFi Credentials. Feel free to create aliases for other labeled ports :)

$ listen2 && wifi2
@markterrill

This comment has been minimized.

Copy link
Contributor Author

commented Feb 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.