Smart Cities - Low Carbon Computing Future: Difference between revisions
| Line 130: | Line 130: | ||
This project not only teaches technical skills but also fosters creativity, problem-solving, and an understanding of sustainable practices in ICT. It prepares students to think critically about how technology can serve communities under resource-constrained conditions. | This project not only teaches technical skills but also fosters creativity, problem-solving, and an understanding of sustainable practices in ICT. It prepares students to think critically about how technology can serve communities under resource-constrained conditions. | ||
=Installing and Removing Software using Terminal= | |||
Yes, you can install software on Lubuntu (a lightweight Ubuntu variant) using the sudo apt install command in the terminal. Lubuntu uses the same package management system as Ubuntu, so you can leverage the Advanced Package Tool (APT) for software installation. | |||
Step-by-Step Instructions | |||
* Open the Terminal:Press Ctrl + Alt + T or find "Terminal" in your application menu. | |||
* Update the Package List:Before installing software, ensure your package list is up to date: | |||
<syntaxhighlight lang="bash"> | |||
sudo apt update | |||
</syntaxhighlight> | |||
Install the Software: Use the sudo apt install command followed by the software package name. For example, to install the VLC media player: | |||
<syntaxhighlight lang="bash"> | |||
sudo apt install vlc | |||
</syntaxhighlight> | |||
* Confirm Installation: If prompted, press Y to confirm the installation. | |||
* Run the Installed Software: | |||
* Once installed, you can launch the software from the application menu or by typing its name in the terminal. For example: | |||
<syntaxhighlight lang="bash"> | |||
vlc | |||
</syntaxhighlight> | |||
Notes | |||
Checking Availability: | |||
To check if a package is available, use: | |||
<syntaxhighlight lang="bash"> | |||
apt-cache search <software-name> | |||
</syntaxhighlight> | |||
Uninstalling Software: To remove a package: | |||
<syntaxhighlight lang="bash"> | |||
sudo apt remove <software-name> | |||
</syntaxhighlight> | |||
Full Removal: To remove the package and its configuration files: | |||
<syntaxhighlight lang="bash"> | |||
sudo apt purge <software-name> | |||
</syntaxhighlight> | |||
Why Use the Terminal? | |||
* Efficiency: Faster and more direct than using graphical package managers. | |||
* Dependency Management: APT handles dependencies automatically. | |||
* Customizability: Advanced options like installing specific versions or debugging are easier via the terminal. | |||
* Lubuntu’s terminal-based software installation method is identical to other Ubuntu flavors, making it straightforward and efficient. | |||
=DHCP and DNS Server for Low Carbon Future = | =DHCP and DNS Server for Low Carbon Future = | ||
Revision as of 05:39, 26 December 2024
Student Project: Building a Low-Carbon, Low-Energy ICT Infrastructure for an Offline Future
This project challenges students to design and implement an ICT infrastructure that functions efficiently without internet access, using Linux, old laptops, and Raspberry Pi devices. The project emphasizes sustainability, resourcefulness, and essential services for a community.
Goals
Design a Sustainable ICT Infrastructure:
- Minimize energy consumption.
- Use repurposed or low-energy hardware.
Provide Basic ICT Services:
- Communication, knowledge access, and resource management.
- Prepare for Internet Loss:
- Preload essential software and content.
- Plan for long-term, local operations.
Project Steps
1. Understand the Community’s Needs
Key Questions:
- What essential ICT services are required (e.g., communication, education, record-keeping)?
- How can technology address basic needs like water, food, and energy management?
Potential Services:
- Local communication (text-based chat, email).
- Offline libraries (Wikipedia, medical guides).
- Environmental monitoring (water levels, air quality).
- Collaborative tools (file sharing, project management).
- Educational resources.
2. Choose and Prepare Hardware
Use Existing Equipment:
- Old laptops as servers and workstations.
- Raspberry Pis for lightweight tasks like networking or automation.
Hardware Considerations:
- Low power consumption.
- Compatibility with Linux.
- Potential for solar or battery-powered operation.
Pre-Setup Steps:
- Test hardware and replace failing components.
- Install lightweight Linux distributions (e.g., Ubuntu Server, Raspbian Lite, or Lubuntu).
3. Set Up Essential ICT Services
Local Network (No Internet):
- Use a Raspberry Pi as a DHCP and DNS server.
- Set up a Wi-Fi router for local communication.
Offline File Sharing:
- Install Nextcloud on a Raspberry Pi for local file hosting and collaboration.
Offline Libraries:
- Download and host offline versions of:
- Kiwix for Wikipedia and other content.
- OpenStreetMap for navigation.
- Localized educational materials (Khan Academy).
Messaging and Email:
- Set up a local email server (e.g., Postfix).
- Use lightweight chat systems (e.g., Matrix or Rocket.Chat) for local messaging.
Environmental Monitoring:
- Use Arduino or Raspberry Pi with sensors to monitor environmental data (e.g., temperature, water levels).
4. Implement Energy-Efficient Practices
Low Power Consumption:
- Use old laptops and Raspberry Pis in low-power mode.
- Disconnect unnecessary peripherals (e.g., monitors when not in use).
Renewable Power:
- Integrate solar panels or manual chargers for energy independence.
5. Create Local Automation Systems
Water Management:
- Use IoT devices to automate irrigation or monitor water tanks.
Community Bulletin Board:
- Set up a local website for news, announcements, and resource coordination.
Backup Systems:
- Implement regular data backups on external drives.
6. Prepare for Internet Loss
Preloaded Content:
- Download essential tools, software repositories, and manuals (e.g., Linux documentation, open-source software).
Skill Development:
- Train students in using Linux, basic programming, and networking.
Redundant Systems:
- Test systems to ensure reliability and redundancy in services.
Project Evaluation
Energy Efficiency:
- Measure power consumption and compare it to traditional setups.
Functionality:
- Demonstrate the ICT services provided (e.g., messaging, file sharing).
Resilience:
- Evaluate how well the system operates in a simulated internet-free scenario.
Sustainability:
- Assess the environmental impact (e.g., use of repurposed hardware, renewable energy).
Example Scenario
Hardware Setup:
- A Raspberry Pi acts as a local server hosting Nextcloud and Kiwix.
- Old laptops connect to the Pi via Wi-Fi for accessing services.
Services Provided:
- Students can access offline Wikipedia, download educational content, and communicate using a local chat system.
Energy Source:
- A small solar panel array powers the Raspberry Pi and a shared laptop.
Community Benefit: Students and community members can continue learning, sharing resources, and managing local projects without internet access.
Preparations Before Internet Goes Down
- Pre-download essential resources and software.
- Train students in Linux, networking, and hardware maintenance.
- Test the system in a simulated offline environment.
- Document the setup process for future reference.
This project not only teaches technical skills but also fosters creativity, problem-solving, and an understanding of sustainable practices in ICT. It prepares students to think critically about how technology can serve communities under resource-constrained conditions.
Installing and Removing Software using Terminal
Yes, you can install software on Lubuntu (a lightweight Ubuntu variant) using the sudo apt install command in the terminal. Lubuntu uses the same package management system as Ubuntu, so you can leverage the Advanced Package Tool (APT) for software installation.
Step-by-Step Instructions
- Open the Terminal:Press Ctrl + Alt + T or find "Terminal" in your application menu.
- Update the Package List:Before installing software, ensure your package list is up to date:
sudo apt update
Install the Software: Use the sudo apt install command followed by the software package name. For example, to install the VLC media player:
sudo apt install vlc
- Confirm Installation: If prompted, press Y to confirm the installation.
- Run the Installed Software:
- Once installed, you can launch the software from the application menu or by typing its name in the terminal. For example:
vlc
Notes Checking Availability: To check if a package is available, use:
apt-cache search <software-name>
Uninstalling Software: To remove a package:
sudo apt remove <software-name>
Full Removal: To remove the package and its configuration files:
sudo apt purge <software-name>
Why Use the Terminal?
- Efficiency: Faster and more direct than using graphical package managers.
- Dependency Management: APT handles dependencies automatically.
- Customizability: Advanced options like installing specific versions or debugging are easier via the terminal.
- Lubuntu’s terminal-based software installation method is identical to other Ubuntu flavors, making it straightforward and efficient.
DHCP and DNS Server for Low Carbon Future
Setting up a Raspberry Pi as a DHCP and DNS server is a critical step in building a local network for a community, especially in a low-carbon future where internet access might be limited or unavailable. Here's how to set it up, its importance, use cases, coverage, and recommendations for deployment.
How to Set Up a Raspberry Pi as a DHCP and DNS Server
Step 1: Prepare Your Raspberry Pi
- Install a lightweight Linux distribution, such as Raspberry Pi OS Lite.
- Ensure the Pi has a static IP address for consistent identification in the network.
Step 2: Install the Required Software
Update the Pi:
sudo apt update && sudo apt upgrade
Install dnsmasq, which combines DHCP and DNS functionality:
sudo apt install dnsmasq
Step 3: Configure DHCP Services
Edit the dnsmasq configuration file:
sudo nano /etc/dnsmasq.conf
Add the following lines to define the DHCP range and DNS behaviour:
interface=wlan0 # Replace with your network interface
dhcp-range=192.168.1.50,192.168.1.150,24h
domain-needed
bogus-priv
expand-hosts
- dhcp-range: Specifies the range of IP addresses to assign dynamically.
- domain-needed: Ensures only valid domain names are queried.
- expand-hosts: Expands the local hostname with a domain.
Restart the dnsmasq service to apply changes:
sudo systemctl restart dnsmasq
Step 4: Enable Static IP on the Raspberry Pi
Edit the network configuration file:
sudo nano /etc/dhcpcd.conf
Add:
interface wlan0
static ip_address=192.168.1.1/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
Restart the Pi to apply changes:
sudo reboot
Why is a DHCP and DNS Server Needed in a Low-Carbon Future?
1. Localized Networks:
- A local DHCP server assigns IP addresses to devices in a local network, eliminating dependency on external ISPs.
- A DNS server resolves domain names locally, enabling offline access to hosted services (e.g., file sharing, offline Wikipedia).
2. Resource Efficiency:
- Reduces energy use by keeping data local and avoiding power-intensive internet infrastructure.
- Raspberry Pi is highly energy-efficient compared to traditional servers.
3. Resilience:
- Supports essential ICT services like communication, file sharing, and automation in scenarios where global connectivity is down.
How Do People Use It?
- Education: - Access offline educational content hosted locally, such as Wikipedia and Khan Academy materials.
- Communication: - Provide local messaging services using systems like Matrix or Rocket.Chat.
- Resource Management:- Monitor and automate local resources, such as water and energy systems.
- Collaboration: - Use tools like Nextcloud for file sharing and project management.
- Entertainment: - Serve media content locally (e.g., movies, books).
Coverage
- Typical Range: - The Raspberry Pi, combined with a Wi-Fi router, covers approximately 30-50 meters indoors and 100-200 meters outdoors, depending on obstacles and interference.
- Range can be extended using repeaters or mesh networks.
- Scalability: - For larger communities, multiple Raspberry Pis can be interconnected to create subnetworks.
Where Should It Be Based?
- Centralized Location: - Place the Raspberry Pi in a central location within the community to ensure even Wi-Fi signal coverage.
- Ensure it has access to a reliable power source (solar or battery backup).
- Near Users: - Ideally close to the main areas where users access services (e.g., schools, community centers).
Additional Considerations Security: - Secure the network with WPA2 encryption.
- Use firewalls (e.g., ufw) to prevent unauthorized access.
- Backups: - Regularly back up the Raspberry Pi's configuration to prevent data loss.
- Power Backup: - Pair with solar panels or power banks for uninterrupted service.
By setting up a Raspberry Pi as a DHCP and DNS server, communities can create robust, low-carbon networks that provide critical services locally. This approach not only reduces energy consumption but also builds resilience and independence, ensuring ICT resources remain accessible in challenging scenarios.
Setting Up Nextcloud on Raspberry Pi
Setting up Nextcloud on a Raspberry Pi is a great way to create a private cloud server for file sharing, collaboration, and data storage. Here's a step-by-step guide on how to set it up and use it.
Step 1: Prepare the Raspberry Pi
Install Raspberry Pi OS: Use Raspberry Pi OS Lite for a minimal installation. Flash the OS to an SD card using tools like Raspberry Pi Imager. Update and Upgrade the System: sudo apt update && sudo apt upgrade -y Set a Static IP Address: Edit /etc/dhcpcd.conf and assign a static IP to the Raspberry Pi (important for consistent access). Step 2: Install Prerequisites
Install Apache and PHP: sudo apt install apache2 libapache2-mod-php php7.4 php7.4-{cli,zip,xml,gd,curl,mbstring,common,bz2,intl,sqlite3} -y Install MariaDB (MySQL Alternative): sudo apt install mariadb-server php7.4-mysql -y Secure MariaDB: sudo mysql_secure_installation Set a strong root password and remove unnecessary defaults. Install Additional Dependencies: sudo apt install unzip wget -y Step 3: Install Nextcloud
Download Nextcloud: wget https://download.nextcloud.com/server/releases/latest.zip Unzip and Move Files: unzip latest.zip sudo mv nextcloud /var/www/html/ Set Permissions: sudo chown -R www-data:www-data /var/www/html/nextcloud sudo chmod -R 755 /var/www/html/nextcloud Enable Apache Modules: sudo a2enmod rewrite headers env dir mime sudo systemctl restart apache2 Step 4: Configure the Database
Access MariaDB: sudo mysql -u root -p Create Database and User: CREATE DATABASE nextcloud; CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'securepassword'; GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost'; FLUSH PRIVILEGES; EXIT; Step 5: Complete the Setup in a Browser
Open a browser on a device connected to the same network. Navigate to the Raspberry Pi's IP address followed by /nextcloud, e.g., http://192.168.1.100/nextcloud. Follow the on-screen instructions: Create an admin account. Enter database details: Database user: nextclouduser Database name: nextcloud Password: securepassword Finish the setup, and Nextcloud will be ready for use. Using Nextcloud Accessing Nextcloud
Open a browser and enter the Raspberry Pi's IP address (e.g., http://192.168.1.100/nextcloud). Log in with the admin account. Uploading Files
After logging in, click on Files. Drag and drop files into the browser interface or use the upload button. Sharing Files
Right-click on a file and select Share. Set permissions for the shared file (e.g., view-only, editing). Share via a local link or generate a download link. Syncing with Devices
Install the Nextcloud client on your computer or smartphone. Connect to your server using its local IP. Sync files across devices. Collaboration
Install apps from Nextcloud's App Store for additional functionality, such as: Collaborative document editing (e.g., OnlyOffice or Collabora). Calendar and contact synchronization. Task management. Offline Access
Preload files for offline availability on client devices. Why Use Nextcloud in a Low-Carbon Context? Energy Efficiency: Hosted locally on a Raspberry Pi, it uses significantly less energy than cloud providers. Data Privacy: Keeps data within the community, avoiding reliance on internet services. Self-Sufficiency: Enables file sharing, collaboration, and document access even without internet. Customizability: Tailored services for local needs, reducing unnecessary resource use. Where Should Nextcloud Be Deployed? Central Location: Place the Raspberry Pi in a community center or school for easy access. Network Coverage: Ensure it’s within the range of the local Wi-Fi network. Use Wi-Fi extenders if the coverage needs to expand. Power Supply: Use renewable energy sources (e.g., solar panels) to power the Raspberry Pi. Nextcloud on a Raspberry Pi is a low-energy, scalable solution for local file management, collaboration, and communication, making it ideal for offline or low-carbon communities.