Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
EliasKotlyar committed Jul 30, 2018
2 parents eda540b + 1a9a898 commit e007723
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 13 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ If you/we solve your issue, please condense your gained insights into a pull req

Start [here](/hacks/technical.md)


## Viewer and control solution:

After install, you can use this [android application](https://play.google.com/store/apps/details?id=io.ext.medinvention.dafangcam) developed by [@medinvention](https://github.com/mmohamed) and join us on [Gitter](https://gitter.im/Dafang-Hacked-Cam-App)


## Integration in Home Automation Systems:

[Domoticz](/integration/domoticz/domoticz.md)
Expand Down
Binary file modified firmware_mod/bin/setconf
Binary file not shown.
Binary file modified firmware_mod/bin/v4l2rtspserver-master
Binary file not shown.
2 changes: 2 additions & 0 deletions firmware_mod/controlscripts/configureOsd
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ if [ -f /system/sdcard/config/osd.conf ]; then
[ ! -z "${POSY}" ] && /system/sdcard/bin/setconf -k x -v ${POSY} 2>/dev/null
[ ! -z "${FIXEDW}" ] && /system/sdcard/bin/setconf -k w -v ${FIXEDW} 2>/dev/null
[ ! -z "${SPACE}" ] && /system/sdcard/bin/setconf -k p -v ${SPACE} 2>/dev/null
[ ! -z "${FONTNAME}" ] && /system/sdcard/bin/setconf -k e -v ${FONTNAME} 2>/dev/null

else
/system/sdcard/bin/setconf -k o -v ""
fi
Binary file added firmware_mod/fonts/CarroisGothicSC-Regular.ttf
Binary file not shown.
Binary file added firmware_mod/fonts/FromCartoonBlocks.ttf
Binary file not shown.
Binary file added firmware_mod/fonts/NotoMono-Regular.ttf
Binary file not shown.
Binary file added firmware_mod/fonts/NotoSans-Regular.ttf
Binary file not shown.
Binary file added firmware_mod/fonts/NotoSerif-Regular.ttf
Binary file not shown.
6 changes: 6 additions & 0 deletions firmware_mod/fonts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Fonts folder
NotoMono-Regular.ttf and NotoSans-Regular.ttf are mandatory
Some fonts does not be read (to be tested)
Too high size maybe not work (bigger than 70 pixels)


Binary file added firmware_mod/fonts/Roboto-Black.ttf
Binary file not shown.
10 changes: 8 additions & 2 deletions firmware_mod/www/cgi-bin/action.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ if [ -n "$F_cmd" ]; then
position=$(printf '%b' "${F_Position}")
osdtext=$(printf '%b' "${F_osdtext//%/\\x}")
osdtext=$(echo "$osdtext" | sed -e "s/\\+/ /g")
fontName=$(printf '%b' "${F_fontName//%/\\x}")
fontName=$(echo "$fontName" | sed -e "s/\\+/ /g")


if [ ! -z "$axis_enable" ];then
update_axis
Expand All @@ -301,8 +304,8 @@ if [ -n "$F_cmd" ]; then
echo "COLOR=${F_color}" >> /system/sdcard/config/osd.conf
/system/sdcard/bin/setconf -k c -v "${F_color}"

echo "SIZE=${F_size}" >> /system/sdcard/config/osd.conf
/system/sdcard/bin/setconf -k s -v "${F_size}"
echo "SIZE=${F_OSDSize}" >> /system/sdcard/config/osd.conf
/system/sdcard/bin/setconf -k s -v "${F_OSDSize}"

echo "POSY=${F_posy}" >> /system/sdcard/config/osd.conf
/system/sdcard/bin/setconf -k x -v "${F_posy}"
Expand All @@ -312,6 +315,9 @@ if [ -n "$F_cmd" ]; then

echo "SPACE=${F_spacepixels}" >> /system/sdcard/config/osd.conf
/system/sdcard/bin/setconf -k p -v "${F_spacepixels}"

echo "FONTNAME=${fontName}" >> /system/sdcard/config/osd.conf
/system/sdcard/bin/setconf -k e -v "${fontName}"
return
;;

Expand Down
44 changes: 40 additions & 4 deletions firmware_mod/www/cgi-bin/status.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -707,23 +707,57 @@ cat << EOF
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-label is-normal">
<label class="label">OSD Text Size</label>
<label class="label">Font name</label>
</div>
<div class="field-body">
<div class="field">
<div class="control">
<div class="select">
<select name="size">
<option value="0" $(if [ "$(grep SIZE /system/sdcard/config/osd.conf | sed s/SIZE=//)" -eq 0 ]; then echo selected; fi)>Small</option>
<option value="1" $(if [ "$(grep SIZE /system/sdcard/config/osd.conf | sed s/SIZE=//)" -eq 1 ]; then echo selected; fi)>Bigger</option>
<select name="FontName">
$(
fontName="$(/system/sdcard/bin/setconf -g e)"
echo -n "<option value=\"\""
if [ -n "${fontName-unset}" ] ; then echo selected; fi
echo -n ">Default fonts </option>"
for i in `/system/sdcard/bin/busybox find /system/sdcard/fonts -name *.ttf`
do
echo -n "<option value=\"$i\" "
if [ "$fontName" == "$i" ] ; then echo selected; fi
echo -n ">`/system/sdcard/bin/busybox basename $i` </option>"
done
)
</select>
</div>
</div>
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-label is-normal">
<label class="label">OSD Text Size</label>
</div>
<div class="field-body">
<div class="field">
<p class="control">
<input class="input" id="OSDSize" name="OSDSize" type="number" size="4"
value="$(
fontSize=$(/system/sdcard/bin/setconf -g s)
if [ "$fontSize" == "0" ]; then echo 18
elif [ "$fontSize" == "1" ]; then echo 40
else echo "$fontSize"
fi
)"/>
</p>
<p class="help">Too high value won't display anything</p>
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-label is-normal">
<label class="label">Pixels between chars</label>
Expand Down Expand Up @@ -763,9 +797,11 @@ cat << EOF
<option value="1" $(if [ "$(grep FIXEDW /system/sdcard/config/osd.conf | sed s/FIXEDW=//)" -eq 1 ]; then echo selected; fi)>Yes</option>
</select>
</div>
<p class="help">Fixed width works only for "default" fonts</p>
</div>
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-label is-normal">
Expand Down
3 changes: 2 additions & 1 deletion firmware_mod/www/scripts/status.cgi.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ $(document).ready(function() {
'AXISenable': axisenable,
'osdtext': $('input[name=osdtext]').val(),
'color': $('select[name=color]').val(),
'size': $('select[name=size]').val(),
'OSDSize': $('input[name=OSDSize]').val(),
'fontName': $('select[name=FontName]').val(),
'spacepixels': $('input[name=spacepixels]').val(),
'posy': $('input[name=posy]').val(),
'fixedw': $('select[name=fixedw]').val()
Expand Down

0 comments on commit e007723

Please sign in to comment.