DarkSector / python-particle

Python Wrapper around the Particle (particle.io) API
https://www.pronoy.in/2015/08/21/python-particle/
MIT License
12 stars 4 forks source link

Add support for local Wi-Fi configuration via file #6

Closed antoniovazquezblanco closed 4 years ago

antoniovazquezblanco commented 4 years ago

Particle cli tools support the wifi configuration process with a JSON file:

>particle serial wifi --help
Configure Wi-Fi credentials over serial
Usage: particle serial wifi [options]

Global Options:
  -v, --verbose  Increases how much logging to display                                                           [count]
  -q, --quiet    Decreases how much logging to display                                                           [count]

Options:
  --file  Take the credentials from a JSON file instead of prompting for them                                   [string]
  --port  Use this serial port instead of auto-detecting. Useful if there are more than 1 connected device      [string]

Examples:
  particle serial wifi                          Prompt for Wi-Fi credentials and send them to a device over serial
  particle serial wifi --file credentials.json  Read Wi-Fi credentials from credentials.json and send them to a device
                                                over serial

The JSON file for passing Wi-Fi credentials should look like this:
{
  "network": "my_ssid",
  "security": "WPA2_AES",
  "password": "my_password"
}

The security property can be NONE, WEP, WPA2_AES, WPA2_TKIP, WPA2_AES+TKIP, WPA_AES, WPA_TKIP, WPA_AES+TKIP.
For enterprise Wi-Fi, set security to WPA_802.1x or WPA2_802.1x and provide the eap, username, outer_identity,
client_certificate, private_key and root_ca properties.

It would be awesome to support this.

Thank you!

DarkSector commented 4 years ago

Nice, I can take a look at that. I haven't got the time to crack out my particle kit but if you want to submit a PR I am happy to accept it. Otherwise, it will have to wait a little. Cool feature though

antoniovazquezblanco commented 4 years ago

Having a look at the code, the last commit is from 2017. There seem to be more updated API implementations out there. Looking at that I may try to improve a more recent project to avoid duplicity.

Sorry and thank you very much!