Skip to content

Instantly share code, notes, and snippets.

@kantlivelong
Last active July 15, 2023 16:28
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kantlivelong/c89c069b090ea0d8d10fea09da185166 to your computer and use it in GitHub Desktop.
Save kantlivelong/c89c069b090ea0d8d10fea09da185166 to your computer and use it in GitHub Desktop.

Initial setup

  1. Setup DNS reservation for the cam
  2. Configure firewall to block outgoing traffic from the cam IP
  3. SSID Broadcast needs to be enabled on initial wifi setup (Only required if you want to connect to a hidden wifi network)
  4. Configure wifi through mobile app (This can likely done via API but good enough for now)
  5. Don't click Next to add to Cloud. Kill mobile app

Useful API calls

Dump Config

curl --digest --user admin:PASSWORD -X GET 'http://IP/cgi-bin/Config.backup?action=All'

Set NTP

curl --digest --user admin:PASSWORD -X GET 'http://IP/cgi-bin/configManager.cgi?action=setConfig&NTP.Address=NTP_SERVER'

Timezone

curl --digest --user admin:PASSWORD -X GET 'http://IP/cgi-bin/configManager.cgi?action=setConfig&NTP.TimeZone=25' # 0=GMT +0:00, 19=GMT +13:00, 20=GMT -1:00, 32=GMT -12:00
curl --digest --user admin:PASSWORD -X GET 'http://IP/cgi-bin/configManager.cgi?action=setConfig&NTP.TimeZoneDesc=America/New_York' # Doesn't seem to update with TimeZone. Might be pointless?

Disable items potentially reaching internet

curl --digest --user admin:PASSWORD -X GET 'http://IP/cgi-bin/configManager.cgi?action=setConfig&T2UServer.Enable=false'
curl --digest --user admin:PASSWORD -X GET 'http://IP/cgi-bin/configManager.cgi?action=setConfig&VSP_PaaS.Enable=false'
curl --digest --user admin:PASSWORD -X GET 'http://IP/cgi-bin/configManager.cgi?action=setConfig&VSP_PaaS.CustomEnable=false'

This may need to be run routinely to ensure the device thinks it's online. (Maybe trigger via ntp update event in node red)

curl --digest --user admin:PASSWORD -X GET 'http://IP/cgi-bin/configManager.cgi?action=setConfig&VSP_PaaS.Online=true'

Reboot device

curl --digest --user admin:PASSWORD -X GET 'http://IP/cgi-bin/magicBox.cgi?action=reboot'

Set audio stream (G.711 is a supported codec which is what pcm_mulaw is.)

curl --digest --user admin:PASSWORD -X GET 'http://IP/cgi-bin/configManager.cgi?action=setConfig&Encode\[0\].MainFormat\[0\].Audio.Compression=G.711Mu'
curl --digest --user admin:PASSWORD -X GET 'http://IP/cgi-bin/configManager.cgi?action=setConfig&Encode\[0\].ExtraFormat\[0\].Audio.Compression=G.711Mu'

Remove AMCrest watermark

curl --digest --user admin:PASSWORD -X GET 'http://IP/cgi-bin/configManager.cgi?action=setConfig&VideoWidget\[0\].PictureTitle.EncodeBlend=true'
curl --digest --user admin:PASSWORD -X GET 'http://IP/cgi-bin/configManager.cgi?action=setConfig&VideoWidget\[0\].PictureTitle.PreviewBlend=true'

Position clock

curl --digest --user admin:PASSWORD -X GET 'http://IP/cgi-bin/configManager.cgi?action=setConfig&VideoWidget\[0\].TimeTitle.Rect\[0\]=0' # top left corner x coordinate (left)
curl --digest --user admin:PASSWORD -X GET 'http://IP/cgi-bin/configManager.cgi?action=setConfig&VideoWidget\[0\].TimeTitle.Rect\[1\]=0' # top left corner y coordinate (top)
curl --digest --user admin:PASSWORD -X GET 'http://IP/cgi-bin/configManager.cgi?action=setConfig&VideoWidget\[0\].TimeTitle.Rect\[2\]=0' # bottom right x coordinate (right)
curl --digest --user admin:PASSWORD -X GET 'http://IP/cgi-bin/configManager.cgi?action=setConfig&VideoWidget\[0\].TimeTitle.Rect\[3\]=0' # bottom right y coordinate (bottom)

Custom text

curl --digest --user admin:PASSWORD -X GET 'http://IP/cgi-bin/configManager.cgi?action=setConfig&VideoWidget\[0\].CustomTitle\[0\].Text=Doorbell'
curl --digest --user admin:PASSWORD -X GET 'http://IP/cgi-bin/configManager.cgi?action=setConfig&VideoWidget\[0\].CustomTitle\[0\].EncodeBlend=true'
curl --digest --user admin:PASSWORD -X GET 'http://IP/cgi-bin/configManager.cgi?action=setConfig&VideoWidget\[0\].CustomTitle\[0\].PreviewBlend=true'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment