visit
I live in Ruppin Street, and as a joke, I call my apartment the “Royal Ruppin Relax” as if it were some kind of boutique hotel. I wanted to create my own customized WiFi login portal so that guests at my home would get a surprise when they logged in. That's what we're diving into today: In this tutorial, I’ll show you how to build and customize your own captive portal – a digital gateway that not only controls access but also acts as a canvas for your creativity, and a great conversation starter! With a Raspberry Pi and a bit of AI magic, you can transform your mundane WiFi login into an engaging, personalized experience.
Authentication: Captive portals authenticate users by prompting them to enter login credentials or accept terms and conditions. This process ensures that the network is used responsibly and securely.
Customization: One of the features of a captive portal is its customization potential. Businesses often use captive portals to showcase their branding, display advertisements, or provide essential information.
Access Control: Captive portals enable administrators to control the type of access users have to the internet. For instance, they can restrict certain websites, limit bandwidth, or provide different levels of access based on user roles. So technically, you can configure it such that your devices are prioritized bandwidth-wise on your WiFi network, but that’s up to you 😉
Raspberry Pi: The heart of your project, this versatile microcomputer will serve as the central hub for your captive portal setup.
MicroSD Card: You'll need a microSD card (at least 16GB) to store the operating system and other necessary files.
Power Supply: Ensure you have a compatible power supply for your Raspberry Pi to keep it running smoothly.
Ethernet Cable: You'll require an Ethernet cable to establish a wired connection between your Raspberry Pi and your internet router.
In the landscape of network devices, not all routers are created equal. Many standard routers lack native support for captive portals, making it challenging to implement this feature seamlessly. When faced with this limitation, we turn to Raspberry Pi as a solution. This credit-card-sized, affordable computer will allow you to run complimentary network-related software, and overcome the constraints of your existing router.
Nodogsplash Rules: Nodogsplash has specific rules that the splash page must adhere to, ensuring functionality. Deviating from these rules might result in our captive portal not working, making it crucial to comply with them.
CDCs force us to work with HTML and CSS only, no JS. A CDC (Captive Detection Client) is a component in operating systems or devices that helps in detecting whether a network has a captive portal. When a device connects to a WiFi network, the CDC functionality checks if the network connection is restricted by a captive portal. If it detects a captive portal, the device redirects the user to the portal's login or authentication page. Most of the CDCs don’t allow JS or even href
s, so we will have to work with HTML and CSS only to make a beautiful captive portal. Manipulating HTML & CSS requires a good understanding of their syntax, making customization challenging for many users.
To overcome these challenges, we will use some ✨ AI magic ✨.
Visit Leonardo AI: Go to the Leonardo AI website and click on “AI Image Generation”
Generate Your Image: Using Leonardo AI's intuitive interface, generate an image that resonates with your captive portal's ambiance. You can tweak various settings until you find the perfect image. My prompt was: “A beautiful boutique hotel next to the sea, palms and luxurious atmosphere, beautiful day”
Download Your Image: Once satisfied with the generated image, download it to your computer. This stunning visual will serve as the backdrop for your customized splash page.
Now that we have the image, we can customize the default HTML and CSS. To do that we will use Fine’s AI agents, that can quickly get us to the point:
Deploy an HTML Agent to Your workspace: Open Fine and click “Deploy Agent”. Upload the YAML file of the HTML Agent, found . This agent specializes in HTML and CSS tasks.
Create a project: Place the default Nodogsplash files in a folder, together with your generated image. Run git init
inside the folder and then add it as a new project to Fine.
Create a Notebook and specify the changes you want to make: The agents work according to a plan specified in a notebook. I wrote a short description for my wanted task and connected the notebook to the project.
Run the agent, and make some final tweaks: The agent will start changing the HTML and CSS pages according to the specifications in your notebook. If it isn’t exactly to your liking, make the final changes and that’s it!
/etc/Nodogsplash/htdocs/