Hello, thanks for the good course (Home Automation).
I installed the Ngrok on Raspberry Pi 3 Model B+, but I need some your help.
I followed the steps of Module 9 to install the Ngrok and got my unique link!
I put it in the browser and connected to my dashboard of Node Red and the tunnel works!
After, I restarted the operating system (Raspbian) and the tunnel did not work.
I think, the Ngrok is off, but I do not know how to turn on the Ngrok server ?
How to run the Ngrok server automatically, after restarting the operating system ?
How to change a region in the Ngrok settings, because I’m in europe ?
This free version of the Ngrok, how long will the tunnel work in hours ?
Hello Ivaylo, thanks for bringing that up because I definitely need to add that part to the course.
First, you need to install a software called screen, so that your command can be executed in the background. To install screen:
sudo apt install screen
Then, if you would run the ngrok software with:
screen -d -m ./ngrok http -auth="yourusername:yourpassword" 1880
You would see anything in the Terminal, but your tunnel would be running in the background.
In order to start ngrok in the boot, you need to edit the file .bashrc:
sudo nano /home/pi/.bashrc
Scroll to the end of that file and add this next line:
screen -d -m /home/pi/./ngrok http -auth="yourusername:yourpassword" 1880
Control+X, then Enter and Y. Reboot your Pi and your tunnel should start automatically. If you login into the ngrok.com website, you’ll see the URL that you need to access and if the tunnel is active or not.
The tunnel should run indefinitely, but you can’t customize the URL when the Pi restarts.
I hope that helps!
Hi, this works on my Pi 3 BUT only after I SSH into the Pi. Ngrok will not display my Tunnels Online until I do this. Any idea why this is necessary? Thanks, Bob
The rc.local should solve your problem
I have the same problem and went to the suggested site: dexterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup/
You mention that the rc.local should solve the problem, but I do not understand this: Add commands to execute the python program, preferably using absolute referencing of the file location (complete file path are preferred)
What should be the command when Ngrok should run when the RBPi starts up?
Sorry i´m new to this!
You need to understand a little bit of linux so you can modify a text file with a command line application. On that linked web site they use “nano”. I’m pretty old school so when I learned *nix some 40 years ago I used “ed” and then “vi”.
See if you can find a linux tutorial and then a nano tutorial.
Hello Claudio, what do you mean by same problem? If you use the method:
sudo nano /home/pi/.bashrc
Does it work for you when you open the SSH connection?
There is nothing wrong with your description.
now it is working.
After rebooting I overlooked the fact that I should use the new URL provided in the NGROK tunnel online followed by /ui
Sorry for the hassle