-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIBER: Add important modules and code refactor
* Add documentation for Fiber * Add FIBER modules * Update sidebars-fiber.js * Refactor installation-setup.md * Refactor introduction.md * Refactor project-structure.md * Reposition FIBER between EMBER and TOWER
- Loading branch information
1 parent
97d6791
commit 3c2c2f0
Showing
11 changed files
with
197 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,5 @@ | |
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
.codegpt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,191 +1,88 @@ | ||
--- | ||
slug: installation-setup | ||
title: FIBER Installation | ||
title: Installation | ||
--- | ||
import Image from '@theme/IdealImage'; | ||
|
||
# FIBER Installation | ||
# Installation | ||
|
||
This article provides instructions on bootstrap and configuring the Linux system on Compute Module 4. The instructions below assume the Linux host environment. | ||
This article uses the term host - a Linux-based PC which configures the target (FIBER version 2 hardware). | ||
This article provides instructions on bootstrap and configuring the Linux system on **Compute Module 4**. The instructions below assume the Linux host environment. | ||
This article uses the term host - a Linux-based PC which configures the target (**FIBER** version 2 hardware). | ||
|
||
## Install Image | ||
|
||
- Download image | ||
- Uncompress the image | ||
- Install image to FIBER | ||
- Connect the PoE adapter to the target. | ||
- Connect the Mini USB cable between the host and the target. | ||
- Use a jumper to short the BOOT pins on the mainboard. | ||
- Shortly press the RESET tact switch on the rear side of the mainboard. | ||
- Now Compute Module 4 should start in the bootloader mode. | ||
- Remove the jumper from the BOOT pins on the mainboard. | ||
- Flash the image | ||
- Set up network connection | ||
1. Download image | ||
|
||
2. Uncompress the image | ||
|
||
## Network Connection Setup | ||
|
||
To start FIBER, follow the instructions below depending on your preferred connection method: | ||
|
||
### Wi-Fi Connection | ||
|
||
If you are connecting FIBER to your network via Wi-Fi, follow these steps: | ||
|
||
- Connect your FIBER device to the PoE port of the PoE adapter. | ||
- Wait for the device to establish a Wi-Fi connection with your network. | ||
- Determine the IP address. | ||
- Log in to the target (password *`fiber`*): | ||
```sh | ||
ssh root@[ip address] | ||
``` | ||
- Wait for approximately a minute for FIBER to establish a connection with your network. | ||
|
||
### Ethernet Connection | ||
|
||
If you are connecting FIBER to your network via Ethernet, follow these steps: | ||
|
||
- Connect one Ethernet cable from the PoE adapter's LAN port to your router or switch. | ||
- Connect another Ethernet cable from the PoE adapter's port to the FIBER device. | ||
- Determine the IP address. | ||
- Log in to the target (password *`fiber`*): | ||
```sh | ||
ssh root@[ip address] | ||
``` | ||
- Wait for approximately a minute for FIBER to establish a connection with your network. | ||
|
||
### Static IP Address Connection | ||
|
||
If your company utilizes a static IP address for FIBER connections, follow these steps: | ||
|
||
- Update Configuration File (system section) | ||
- Set static_ip to True. | ||
- Replace the following placeholders with your network details: address (Your static IP address), netmask, gateway, dns. | ||
- Depending on the type of Ethernet or Wi-fi connection, use the instructions for them above. | ||
|
||
## Development Environment Setup | ||
3. Install image to **FIBER** | ||
|
||
This section outlines the process of configuring the development environment to facilitate work on the FIBER project. Follow these steps to ensure a smooth and efficient development experience with FIBER. | ||
- Connect the **PoE adapter** to the target. | ||
|
||
- Connect the **Mini USB cable** between the host and the target. | ||
|
||
### 1. Clone Project Repository Locally from GitLab | ||
- Use a jumper to short the **BOOT pins** on the mainboard. | ||
|
||
[https://gitlab.hardwario.com/Fiber-v2/application](https://gitlab.hardwario.com/Fiber-v2/application) clone to local/path/to/project | ||
- Shortly press the **RESET tact switch** on the rear side of the mainboard. | ||
|
||
### 2. Create Dockerfile and Build Docker Container | ||
- Now **Compute Module 4** should start in the bootloader mode. | ||
|
||
#### 2.1 Install Docker | ||
- Remove the jumper from the **BOOT pins** on the mainboard. | ||
|
||
**For Windows and macOS:** | ||
4. Flash the image | ||
|
||
- Download Docker Desktop from the official Docker website. | ||
- Start Docker Desktop and wait for Docker Engine to fully start. | ||
5. Set up network connection | ||
|
||
**For Ubuntu:** | ||
|
||
```terminal | ||
sudo apt update | ||
sudo apt install -y docker.io | ||
``` | ||
|
||
#### 2.2 Create Dockerfile | ||
|
||
```Dockerfile | ||
# Specify the base image, in this case Python 3.10 slim | ||
FROM python:3.10-slim | ||
|
||
# Update the package list and install necessary dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
libffi-dev \ | ||
libgpiod-dev \ | ||
python3-dev \ | ||
gcc \ | ||
libc-dev \ | ||
libncurses5-dev \ | ||
libncursesw5-dev \ | ||
ansible \ # Install Ansible for automating configuration management | ||
sshpass \ # Install sshpass for passing SSH password in scripts | ||
sudo # Install sudo for executing commands with superuser privileges | ||
|
||
# Install Poetry - a tool for managing Python dependencies | ||
RUN pip install poetry | ||
|
||
# Set the working directory to /app | ||
WORKDIR /app | ||
## Network Connection Setup | ||
|
||
# Create a volume to persist data inside the container | ||
VOLUME /app | ||
To start **FIBER**, follow the instructions below depending on your preferred connection method: | ||
|
||
# Disable virtual environment creation for Poetry, as we are using a container | ||
RUN poetry config virtualenvs.create false | ||
``` | ||
### Wi-Fi Connection | ||
|
||
#### 2.3 Start Docker Container | ||
If you are connecting **FIBER** to your network via **Wi-Fi**, follow these steps: | ||
|
||
1. Navigate to the project directory: | ||
1. Connect your **FIBER** device to the PoE port of the PoE adapter. | ||
|
||
```sh | ||
cd local/path/to/project | ||
``` | ||
2. Wait for the device to establish a Wi-Fi connection with your network. | ||
|
||
2. Build the Docker image: | ||
3. Determine the IP address. | ||
|
||
```sh | ||
docker build -t image-name . | ||
``` | ||
4. Log in to the target (password *`fiber`*): | ||
|
||
3. Run the Docker container: | ||
```bash | ||
ssh root@[ip address] | ||
``` | ||
|
||
```sh | ||
docker run -it -v ${PWD}:/app --name container-name image-name bash | ||
``` | ||
5. Wait for approximately a minute for **FIBER** to establish a connection with your network. | ||
|
||
4. If the container is stopped, start it and open a bash session: | ||
### Ethernet Connection | ||
|
||
```sh | ||
docker start container-name ; docker exec -it container-name bash | ||
``` | ||
If you are connecting **FIBER** to your network via **Ethernet**, follow these steps: | ||
|
||
_Please replace image-name and container-name with the desired names. Ensure that you execute docker build and docker run commands with administrator privileges if Docker Desktop is running without administrator rights (Windows and macOS)._ You'll be able to work with the project inside this container, and any changes you make will be reflected immediately in the local file system. | ||
|
||
### 3. Put the project in the FIBER | ||
1. Connect one Ethernet cable from the PoE adapter's LAN port to your router or switch. | ||
1. You need to copy the local project to your target: | ||
2. Connect another Ethernet cable from the PoE adapter's port to the **FIBER** device. | ||
|
||
```sh | ||
scp -r local/path/to/project/* root@[ip address]:/app/ | ||
``` | ||
3. Determine the IP address. | ||
|
||
2. Log in to the target | ||
4. Log in to the target (password *`fiber`*): | ||
|
||
```sh | ||
```bash | ||
ssh root@[ip address] | ||
``` | ||
|
||
3. Run the installation script using the following command: | ||
|
||
```sh | ||
/app/scripts/install.sh | ||
``` | ||
5. Wait for approximately a minute for **FIBER** to establish a connection with your network. | ||
|
||
The program must be running. | ||
|
||
#### Additional information | ||
|
||
1. View logs journal | ||
|
||
```sh | ||
journalctl -u fiber-core.service | ||
``` | ||
### Static IP Address Connection | ||
|
||
2. Restart the service | ||
If you utilize a **static IP** address for **FIBER** connections, follow these steps: | ||
|
||
```sh | ||
systemctl restart fiber-core.service | ||
``` | ||
1. Update Configuration File (system section) | ||
|
||
3. Stop the service | ||
- Set `static_ip` to `True`. | ||
- Replace the following placeholders with your network details: `address` (Your static IP address), `netmask`, `gateway`, `dns`. | ||
|
||
```sh | ||
systemctl stop fiber-core.service | ||
``` | ||
2. Depending on the type of Ethernet or Wi-fi connection, use the instructions for them above. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.