It would be great if
Here Documents were supported by
particle serial wifi --file. That way I would have a more reliable method for setting up devices from within scripts.
With Here Document support I would be able to do something like:
particle serial wifi --file << PARTICLEWIFI
I’ve made a GitHub Issue:
It already can take a JSON. What would be the advantage of this particular file format over JSON?
Do you have a USB serial port on your P1 board? It sounds like you do if you’re programming the initial firmware binary by serial.
Have you tried setting the Wi-Fi credentials using particle serial wifi with a JSON file? You can do it entirely automated, before you flash your firmware binary.
Create a JSON file with the Wi-Fi credentials:
Then you can set them with a command like:
particle serial wifi --port xxx --file wifi.json
This is a JSON. It’s just through a heredoc instead of an actual JSON file. The advantage of using this is that scripts wouldn’t have to create a file with credentials inside and would instead just send it through with a heredoc.