I won't say it isn't possible that the (re)boot function checks get_free_disk_space() on boot.
but since it is not SUIx but CHDK i can't do that.....yet hence, this feature request is one for the more experienced CHDK engineers.
CHDK engineer reporting, but I don't really understand the issue or request here.
CHDK does not check free disk space at boot, and has no reason too. If there is ~0 free space on the card, CHDK might not work correctly (failing to update config or script settings), but generally when there isn't room for another jpeg, there will still be at least tens of KB free.
As far as I understand
@jonemo's issue, it appears to be that get_jpg_count() doesn't reflected images deleted via a flashair card, and some issue with the subsequent behavior of suix.lua:
I use a Wifi-SD card (Flashair) to get the photos off the camera continuously. But the get_jpg_count() counter doesn't know that I am deleting photos in the background and keeps decrementing the counter of how much space is left.
Caefix seemed to suggest that the "ghost files" left by remoteshoot or deleting with os.remove() affect the the jpeg count, but I did not observe this on elph130 or elph180. My observation on those cameras is that the displayed get_jpg_count() updates on half press, shoot or play/rec transition, and reflects actual file space. Deleting files with os.remove affects the jpeg count, even if the files are outside of DCIM. Similarly, remoteshoot with dummy files doesn't affect the free count.
It's quite possible other cameras behave differently,
@jonemo, which camera are you using?
It is also possible (and quite likely) IMO, that the problem is because the Canon OS is unaware of the flashair deleting files. In that case, a reboot is probably required, and the correct solution is to keep autostart enabled, despite the card reporting full.
This might be enough of a corner case that's it's not worth adding an "official" option to SUIx, but it should be trivial to add as a local mod in
@jonemo's copy. Presumably,
-- shut down camera if SD card is full
if (jpg_count ~= nil) then
if (jpg_count < 2 ) then
printf("SD card full - shutting down")
sleep(5000)
post_levent_to_ui('PressPowerButton')
sleep(10000)
end
could be changed to call camera_reboot or or just do the part with
set_autostart(2) -- autostart once
...
sleep(1000)
reboot()
Another alternative might be to only use the flashair to download files, and rely on the script to delete them. However, keeping them in sync might require some though.
Edit:
Some previous discussion of flashair cards and issues with changes from the flashair side:
https://chdk.setepontos.com/index.php?topic=11082.0