July 19, 2019 at 10:50 am #61741
Is there a way to import and export all settings via api without having to make multiple calls? I have 19+ controllers and I would like to be able backup my settings quicklyt without having to log in to each controller.
I could not find anything in the api.
Thanks,July 19, 2019 at 5:20 pm #61766July 19, 2019 at 5:23 pm #61769
Ray, can I then re-import it via api or save it as a bin file and use the webif to import it?July 19, 2019 at 6:10 pm #61777
That’s a good question, I don’t think importing is as simple as a one line command as exporting. Samer probably knows a better way, but your best bet is to use the app / UI to import the settings.October 1, 2019 at 6:28 pm #62800
I’m curious about this too… i had been taking a nightly backup of the nvm.dat file (along with other config files) which has always worked when rebuilding the raspberry pi but as I found out last night – nvm.dat isn’t used on the latest release.
ideally if we could run a command that simulates the same result as the GUI Export Configuration, that would be awesomeOctober 2, 2019 at 8:04 am #62805
From firmware 2.1.9, the original nvm.dat has been split into individual data files (integer options, string options, programs, station data etc.). This makes it possible to expand each separately without being constrained into a single file. Previously nvm.dat is designed to match the exact format of ATmega1284’s EEPROM, which is only 4K in size. So every time we want to expand something, like the number of programs, some other data size has to reduce to make room for this. Now they are all in their own files stored in SD card or flash memory, so it’s no longer constrained by the 4K size.
At the moment, the best way is to export configurations from time to time. If you use script, you can simply export configurations by issuing a:
where x.x.x.x is your controller’s IP address, yyy is the MD5 checsum of your password. This will return all settings in one json, and that’s essentially what the UI does.
Then use the UI to import — there is currently no API support for importing all configurations at once, but the UI will read the file (i.e. the output of /ja) and parse it into individual commands (/co, /cp, /cn etc.) and send those to the controller. In the future I agree that we can add an API, something like /ca to allow importing all settings through one command.October 4, 2019 at 7:35 am #62830
Perfect, thanks Ray!
just added this to my nightly backup script:
wget 'http://127.0.0.1:8080/ja?pw=xxx' -O /mnt/backup/ospi_settings.json
- You must be logged in to reply to this topic.