Forked from https://gist.github.com/jenschr/e5ff966f5d6db91ca4743ac10d6a1c72 by jenschr
Works on OSX and should also work for Linux. Users of Windows 10 (or higher) can likely use the builtin Ubuntu install.
- Query the computer for the relevant USB port
- Set the device to listening mode (if required)
- Query the device for the deviceID
- Set the Wifi Credentials using credentials stored in text file:
particle serial wifi --port /dev/tty.usbmodem1451 --file defaultwifi.json
- Claim the device (make sure you're logged in with the correct user!)
- Set the device DFU mode, so we can upload firmware
- Flash our device test & setup firmware via USB:
particle flash --usb setup.bin
./ParticleDetect.sh # You will have to will confirm device is in listening mode. Serial monitor will not open.
./ParticleDetect.sh -y # You will not have to confirm device is in listening mode. Serial monitor will not open.
./ParticleDetect.sh monitor # You will have to will confirm device is in listening mode. Serial monitor will open.
./ParticleDetect.sh -y monitor # You will not have to confirm device is in listening mode. Serial monitor will open.
particle-cli
must be installeddefaultwifi.json
must be presentsetup.bin
must be present- On Linux:
custom-baud
must be present or recompiled (if you want)
@rickkas7 for examples in https://github.com/rickkas7/particle-device-helper
@jrodas for examples https://community.particle.io/t/firmware-tips-and-tricks/3649/35
@nrobinson2000 for improvements to this script https://github.com/nrobinson2000/ParticleDetect
Written by https://community.particle.io/u/jenschr
Caveat: Linux cannot use stty to set the baud rate to 28800 and 14400 like OSX can. custom-baud
is a C executable for Linux that can get around this.