Page 2 of 2

Re: NGROK Tutorial

Posted: Thu Oct 01, 2020 9:58 am
by darant1979
I have been using NGROK for a while but the Android app will still not detect the alerts ... Unsure if that is the NGROK or the App.

When I run the BI remote wizard, the second from last step never connects.

I suspect this is the part that BI needs to sent the alerts to my phone.

The device is in, the Device tags are the same but it just will not send to the app.

Re: NGROK Tutorial

Posted: Tue Nov 24, 2020 6:36 pm
by montman2k
Thixotropic wrote: Fri Sep 18, 2020 8:06 pm It may be in the registry.

I'm new here and have looked over your post as I don't want to pay the 99 dollar reg fee again

So you are correct it is in the registry ..the only issue I am having is if my app is set to auto grab it wont connect even though the proper url is in the wan field.

I made a powershell script to modify the entry on startup and it propagates to the app, but if the check on every login is set in the app it wont connect unless I go into blue iris and remove or change a character and click ok in the ui.

Not being able to have it auto pull every time on its own defeats the purpose...this may be an issue to bring up to support as it may just be a function they need to call on start of the blue iris service to make it work as if I clicked ok.

If I turn off auto check lookup key on login and manually do it, it works fine.

Re: NGROK Tutorial

Posted: Tue Nov 24, 2020 10:51 pm
by montman2k
I was able to automate the process with powershell...I used Fiddler to see what what being sent to blue iris....I had to trim the string to remove the trailing CRLF. I will share if anyone is interested along with somewhat of a tutorial. It works with the auto grab url option checked.

Re: NGROK Tutorial

Posted: Wed Nov 25, 2020 8:34 pm
by Thixotropic
Yes, please do share what you have, I'm sure it'll help others looking for answers.

Re: NGROK Tutorial

Posted: Thu Nov 26, 2020 2:51 pm
by montman2k
So the Powershell Script is as follows since the forum wont let me post a zip ,just open powershell ise as admin and paste this in and modify as needed:
#Set Your Ngrok Parameters Here#
$filepath = 'c:\ngrok\ngrok.exe'
$args = 'http'

Start-Process $filepath $args

timeout 10
#jqwin-64 path needs to match#
cmd /c curl -s localhost:4040/api/tunnels | c:\ngrok\jq-win64 -r .tunnels[0].public_url > C:\ngrok\NgrokURL.txt ##Adjust path as needed##
timeout 5
$filecontent = [IO.File]::ReadAllText("c:\ngrok\NgrokURL.txt")
$regkey = "HKLM:\Software\Perspective Software\Blue Iris\server" #This is correct for version 5#
$regprop = "ip"
$NewString = $filecontent -replace ".*//"
$NewString = $NewString.Trim()
if(Test-Path ($registryPath + "\" + $regprop))
New-ItemProperty -Path $regkey -Name $regprop -Value $NewString
Set-ItemProperty -Path $regkey -Name $regprop -Value $Newstring
Restart-Service -Name BlueIris #Optional if this process runs before blue iris

So essentially what this does is run the ngrok process with the parameters you specify in the $args field and then extracts the url from the ngrok api and transposes it to a text file, removes the trailing CRLF and then modifies the registry as well as restarts the service if its running to allow Blue iris to update.(Note this can also just be done opening console and closing it from powershell as well) Also this doesn't kill the ngrok process if its already running but it will still pull the existing tunnel info .

I did this very quickly so I know it isn't the best thought out / looking code but it works for what I need it for. If you already have a ngrok task, you could remove the items above and including start process to treat this as a seperate item.

you do need jq for windows available at and this file placed in the path specified in the powershell.

For the scheduled task run as Admin, the following is what you need..obviously paths and names change as needed:


Arguments -ExecutionPolicy Bypass -command "c:\ngrok\ngrokfree.ps1"

Also in Blue Iris uncheck the auto update checkbox under the wan field so it doesn't populate the ip automatically.

That's all there is to it.

If Anyone has any questions I'd be more than happy to help out.

Re: NGROK Tutorial

Posted: Fri Nov 27, 2020 4:01 pm
by Thixotropic
Awesome, thank you. I'm sure this will help some people who are also trying to puzzle this out.