Closed 0n3-70uch closed 4 years ago
Sdcard is corrupted. FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Is your sd card written through? Is you power supply strong enough?
Sdcard is corrupted. FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Is your sd card written through? Is you power supply strong enough?
Hi, thanks for your reply. Is it possible, that this is an old message? Because it's there after every reboot at the same time ([ 3.046953]). I checked the power supply now... seems to be fine. Brand power supply with 2A. I measured the current and the consumption is under 2A all the time.
Update: I low level formated the card. Now the "corrupted" message is gone away. I will update the issue tomorrow after one night.
Update 2: This problem still exists. Switching between day and night does not work.
Well then run autonight in debug mode with and without the page open and post the logs.
Well then run autonight in debug mode with and without the page open and post the logs.
Ok I will do it.
I can't find an option to enable debugging for auto-night-detection. Can you give me a short tip? Thank you.
PS: I get this error...
/system/sdcard/controlscripts/auto-night-detection: /system/sdcard/config/autonight.conf: line 3: -j: not found
Seen that error before. Was because the argument string wasn’t properly passed on to the executable. This was fixed some commits ago. To see all modes supported by autnonight run the executable with flag -h.
Seen that error before. Was because the argument string wasn’t properly passed on to the executable. This was fixed some commits ago. To see all modes supported by autnonight run the executable with flag -h.
But it still exist in the current commit 74256f7.
There is now response to -h. Seems that I do something wrong...
I'm not sure if it is related to this but I'm seeing where changes saved to the SW night mode configuration in the webui are being saved to the configuration file but those changes aren't reflected in the webui after a page refresh or camera reboot. The camera appears to ignore the configuration file modifications after a reboot but the webui still contains the default values and won't switch to night mode until visiting the SW night page once. But it still only appears to use the defaults.
Yeah I notice the same problem.
./autonight -h
Usage: autonight [options]
Options:
-v Increase verbosity
-S uses software to determine day/night
following options don't mean anything for software method
use sw_night_configure.html for more software mode options
-D <str> Sets jz_adc_aux device (default: /dev/jz_adc_aux_0)
-c <str> Sets the command to call to set night mode (default: /system/sdcard/scripts/nightmode.sh)
-a <int> Sets the number of ADC reads to average into a single sample (default: 25)
-d <int> Delay (in seconds) between averaged reads (default: 10)
-n <int> Number of averaged samples to window average for thresholding (default: 5)
-O <float> Turn on night mode when window average value drops below this threshold (default: 40.00)
-F <floag> Turn off night mode when window average value goes above this threshold (default: 45.00)
-h Print this usage statement and exit
Thanks for your help. But I'm to stupid to find the ./autonight tool. I connect via ssh to my camera. But there is only one auto night file: /controlscripts/auto-night-detection
And I can't find the debug mode in your description. Or is there a running output to the terminal after executing the command?
the binary is in /system/sdcard/bin you have to start it like this ./autonight -v to output debug more debug information
the binary is in /system/sdcard/bin you have to start it like this ./autonight -v to output debug more debug information
Oh man... sometimes I'm inside a forest and cannot see the trees ;-). Thank you.
This is my output for ./autonight -v -S -j 3 -w 3 -1 1200000 -2 930000,14,10 -3 300 0,17,8:
Starting software method using
jitter_percent = 3
eq1_user_exposure = 1200000
eq2_user_exposure = 930000
eq2_user_iridix = 14
eq2_count = 10
eq3_user_wb = 3000
eq3_user_iridix = 17
eq3_count = 8
sec_wait = 3
Night Mode Disabled
jitter active
mode switch wait active
mode switch wait active
mode switch wait active
Switching to night new exp=1266819
Night Mode Enabled
/system/sdcard/scripts/nightmode.sh: /system/sdcard/config/autonight.conf: line 3: -j: not found
jitter active
mode switch wait active
mode switch wait active
mode switch wait active
Same problem... will not switch automatically.
show your /system/sdcard/config/autonight.conf
/system/sdcard/config/autonight.conf
Stock settings.
autonight_mode=sw
hw_parameters=
sw_parameters=-S -j 3 -w 3 -1 1200000 -2 930000,14,10 -3 3000,17,8
# set ir_led_off to true in front of IR reflecting windows
ir_led_off=false
Not quite stock settings: https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/blob/master/firmware_mod/config/autonight.conf.dist has single quotes around sw_parameters
value.
I think this is an issue with rewrite_config
function, which is maybe stripping these?
Okay i was able to trace that error:
/system/sdcard/scripts/nightmode.sh: /system/sdcard/config/autonight.conf: line 3: -j: not found
It happens because right value of the variable sw_parameters is broken up after the -S and the rest is lost (again) when sourcing the config in night_mode on
in common_functions
.
As @Dopeyr pointed out, the culprit may be the rewrite_config
function.
Any regex experts here that could help with a better rewrite_config
function?
I verified that the stock config file is working as intended. Rewriting with sw night configuration removes the quotation marks and breaks the functionality.
I verified that the stock config file is working as intended. Rewriting with sw night configuration removes the quotation marks and breaks the functionality.
Ah great... thanks for your investigation.
One thing to bear in mind, there are points in action.cgi where it looks like it's doing its own escaping e.g. https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/blob/master/firmware_mod/www/cgi-bin/action.cgi#L392 so just need to take that into account. Perhaps with a fixed up rewrite_config
that could be removed? Just needs checking anyway.
I added the two single quotes and now the auto night detection works again.
PS: I added a detailed description above: https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/issues/1301#issue-574135324
I added the two single quotes and now the auto night detection works again.
Not quite stock settings: https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/blob/master/firmware_mod/config/autonight.conf.dist has single quotes around
sw_parameters
value.I think this is an issue with
rewrite_config
function, which is maybe stripping these?
Good eye! I just made the modification to my configuration and I'm back in business. Thanks everyone!
it solved my problem too , thanks
I added a detailed description above: https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/issues/1301#issue-574135324
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Description
Do not auto switch to night or day mode.
Everything similar to this: https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/issues/1300
What did you do to debug the issue
See link above.
Evidence
Summary of all log files
Content of dmesg
Content of logcat
Process List
Mounts
Hotfix
Add two single quotes at line 3 in file
/system/sdcard/config/autonight.conf
.Example: Before:
After: