Niagara Kiosk Mode Auto-Login
This KB shows you how to turn your Niagara station into a Kiosk mode with an auto-login feature. It uses a combination NW.js, Chromedriver, Selenium, and a small Python script. The main issue is when the pc restarts that it doesn’t automatically log-in to the station. By the end of this article, you’ll have a fully running touch screen panel with an auto-login mechanism.
Download NW.js, Python, Chromedriver, and Selenium.
1. Download NW.js SDK Version — this is SDK version which includes Chromedriver. Unzip into a new folder. We’ll come back to this in a bit. NW.js is an app runtime based on Chromium and node.js. You can write native apps in HTML and JavaScript with NW.js. It also lets you call Node.js modules directly from the DOM and enables a new way of writing native applications with all Web technologies.
2. Download Python — 3.6.3 for Windows 64bit version. Make sure you get the correct version for your OS. Follow the install instructions carefully. By the end of the installation, you should be able to open command prompt and type in python. Python is an interpreted high-level programming language for general-purpose programming.
3. To install Selenium open command prompt from the same folder you created in step 1 and type in pip install selenium. Selenium Python bindings provide a convenient API to access Selenium WebDrivers like Firefox, Ie, Chrome, Remote etc. We’ll use this to automate the Niagara station web login.
4. Create a package.json file in the same folder you created in step 1. This is the NW.js configuration. Here is an example, modify as needed.
5. Create a file called launch.py in the same folder as the NW.js files. Copy the script below, modify as needed. Obviously credentials are stored in this file and every precaution should be used to protect it. However, a colleague did recommend that you could save the credentials using the browser credential save mechanism, and then just the invoke the “keys.RETURN” without putting your username and password in.
6. Basically thats all you need to do. With command prompt open, type in launch.py and watch it log in automatically. To finish off this mechanism, have the launch.py run when the PC restarts via a .bat file or something similar. I’ll leave that up to you.