unixpunk / PlutoWeb

PlutoWeb
73 stars 19 forks source link

settings.txt integration #18

Closed unixpunk closed 6 years ago

unixpunk commented 6 years ago
  1. You don't need to include a default settings.txt you created, /bin/readsettings.sh gets called at boot and will create it from the settings it got from nvram.

  2. Can we redo the order in your settings.txt file because I'm already using a certain order in several places and keeping this the same would be easier since the order actually matters here. Also, all values will always be lowercase unless its SoapyRemote in which case it will have caps in it. This is because this variable is used to know which program to start so it has to match the name exactly. Also, I use a lowercase y for the autoupdate and autoreboot is now configurable in the number of hours. (The list below is just to show order, settings.txt will only contain the actual values.) autostart=openwebrx autoreboot=12 autoupdate=y center_freq=460250000 start_freq=460102200 samp_rate=600000 start_mod=nfm rf_gain=89 ppm=0

Post the change here once you redo the order, then I'll finish the script.

ImDroided commented 6 years ago

Yup I can change the order read easy. Go ahead and change the script to do what it needs to do just make sure it's only raw values and I will change the html and cgi and add the hours text field for auto reboot time

On Sat, May 12, 2018, 10:45 PM unixpunk notifications@github.com wrote:

Assigned #18 https://github.com/unixpunk/PlutoWeb/issues/18 to @ImDroided https://github.com/ImDroided.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/unixpunk/PlutoWeb/issues/18#event-1623410758, or mute the thread https://github.com/notifications/unsubscribe-auth/ANVzaXBGHBW-JiAvhbXccTeFkfWrSxlFks5tx6xfgaJpZM4T8phk .

unixpunk commented 6 years ago

OK, /www/settings.txt is now created during boot and also recreated after any settings are changed. https://github.com/unixpunk/PlutoWeb/commit/8114bd34fecc5edafb49399fb08062acac52c048

ImDroided commented 6 years ago

Im in Michigan and wont be able to flash the pluto till Friday unless you want to email me a update.zip with the included files that need to be updated

unixpunk commented 6 years ago

I think for this all that's left is updated www with the new settings.txt order, then we can wrap it up for an update after you push. Attached an update.zip with just the bin/*settings.sh files which are what are needed for the new settings to come through. Just upload and run /bin/readsettings.sh and you'll then have the new settings.txt in the new order. (settings.sh just re-writes that file when you change settings)

update.zip

ImDroided commented 6 years ago

Ok so test the site before making a new image I did not make a new update file so make one with your updates in it as well and run the readsettings.sh script to generate the settings.txt

ImDroided commented 6 years ago

Somethings not working right.

/bin/readsettings.sh

Temp settings found, using them...

Current settings are: Auto-start = openwebrx Auto-reboot = app=settings Auto-update = n Updates running = n Center frequency = 460125000 Starting frequency = 460126000 Sample rate = 600000 Starting demodulator = nfm RF gain = 89 PPM = 0

thats the output I get then I vi the settings.txt file to read correct values the site loads just fine then I save settings and it goes back to this. the auto reboot shows messed up. not sure if its your end or mine. I was working fine then I pushed the commit and a new update.zip and this happened. not sure if its just we need a new image to fix everything as the current image is not writing the settings.txt file correctly.

ImDroided commented 6 years ago

this is the contents of the settings.txt file

openwebrx app=settings n 460125000 460126000 600000 nfm 89 0

ImDroided commented 6 years ago

And this is the output on the website after trying to save settings

Saving Settings

Stopping updatewatch.sh... Done. Temp settings found, using them... Current settings are: Auto-start = openwebrx Auto-reboot = app=settings Auto-update = n Updates running = n Center frequency = 460125000 Starting frequency = 460126000 Sample rate = 600000 Starting demodulator = nfm RF gain = 89 PPM = 0 Changes saved here will take effect now and persist across reboots. If you (re)flash the PlutoSDR you will lose your settings. qspiboot=set stdout nulldev;adi_hwref;test -n $PlutoRevA || gpio input 14 && set stdout serial@e0001000 && run dfu_sf; set stdout serial@e0001000;itest f8000258 == 480003 && run clear_reset_cause && run dfu_sf; itest f8000258 == 480007 && run clear_reset_cause && run ramboot_verbose; itest f8000258 == 480006 && run clear_reset_cause && run qspiboot_verbose; itest f8000258 == 480002 && run clear_reset_cause && exit; echo Booting silently && set stdout nulldev; run read_sf && run adi_loadvals; envversion;setenv bootargs console=ttyPS0,115200 maxcpus=${maxcpus} rootfstype=ramfs root=/dev/ram0 rw quiet loglevel=4 uboot="${uboot-version}" && bootm ${fit_load_address}#${fit_config} || set stdout serial@e0001000;echo BOOT failed entering DFU mode ... && run dfu_sf Wait while writing to NVRAM... Done. Done. One or more changes require (re)starting the running program, doing now... Stopping SoapyRemote: done Stopping dump1090: done Stopping OpenwebRx: done Starting OpenwebRx:

ImDroided commented 6 years ago

ok so the auto reboot is fixed but I cant get it to turn on auto updates it keeps reading current settings and setting it to no. then when I tell it to turn it on it reverts to current settings..

unixpunk commented 6 years ago

Try the latest image and see if you still have the issue - https://github.com/unixpunk/PlutoWeb/commit/2b56adde420c51dd3decd0040c73dea31a10e713

ImDroided commented 6 years ago

That fixed it. web is playing nice now.