diff --git a/software/BE25_firmware_v1.7.bin b/software/BE25_firmware_v1.7.bin new file mode 100644 index 0000000..2a656f3 Binary files /dev/null and b/software/BE25_firmware_v1.7.bin differ diff --git a/software/docs/BE25_firmware_update.md b/software/docs/BE25_firmware_update.md new file mode 100644 index 0000000..1f40671 --- /dev/null +++ b/software/docs/BE25_firmware_update.md @@ -0,0 +1,17 @@ +# Updating the firmware of the Deco BE25 wifi router + +## Doing it with a local file: + +While connected to your the wifi router, open a browser, and go to the page 192.168.68.101 + +The password asked by this page is the same one used when you registered on the mobile application, it is **not** the router's wifi password. + +Then, go to "advanced", "system", and finally "fimware update" in the dropdown menu. + +download the file named "BE25_firmware.bin" if you haven't already + +select BE25 in the Device model, then select the file "BE25_firmware.bin" in the field "New Firmware File". + +Wait after the process is finished you have successfully updated your Deco wifi router firmware. + + diff --git a/software/docs/installation_instructions.md b/software/docs/installation_instructions.md new file mode 100644 index 0000000..6f7201d --- /dev/null +++ b/software/docs/installation_instructions.md @@ -0,0 +1,20 @@ +# Using the installation script: instructions + +## NOTE: Before running this script, make sure you have downloaded the webplatform available [here](https://github.com/project-SIMPLE/simple.webplatform/archive/refs/heads/main.zip) and have placed it in the folder ~/Documents so the full adress of the web platform is ~/Documents/simple.webplatform + +### To automate the installation of all the dependencies and the setup of the web platform, the script "Installation_script.command" was created. + +- To use it, download it, grant it execution permission (you can do this by using the command ```chmod +x file/path/to/installation_script.command``` ) + +- Then open it. Apple will refuse to run this script, to run it once, go to the system settings, privacy and security, then scroll all the way down + +- you should see the that Apple refused to run the script, but gives you a button called "open anyways" + +- enter the mac Mini password, then the script will open a terminal that will: + + - download homebrew + - download node + - download adb + - initialize the .env file using the .env.example file + - run the application a first time + diff --git a/software/docs/startup_script_instructions.md b/software/docs/startup_script_instructions.md index 540e7f4..d411d2d 100644 --- a/software/docs/startup_script_instructions.md +++ b/software/docs/startup_script_instructions.md @@ -1,11 +1,21 @@ # How to set your web platform up to automatically start when you boot your mac computer: --- -first, open the startup_script.command file using your favorite text editor, and change line 3, initially "cd path/to/application", and change it to the actual path to your application. +To automatically start the application when you boot up your Mac computer, follow these steps: -Next, give execution permissions to this script by using the command "chmod +x ./startup_script.command" in a terminal located in the same folder as the startup script. +Open the automator app, then select "application" -Next, click on the Apple logo on the top left, then system settings, General, and finally login items. +Next, select "Run shell script" by double clicking it in the action list. you can find it by using the search bar on the top right located to the left of "variables" -Finally, click on the "+" on the bottom left of the table, and select the startup_script.command file. +make sure that the shell selected is /bin/sh -The next time you boot up your computer after completing these steps, a pop up will appear to inform you that login items have been added. You can now open a browser page at localhost:8000 and find the application there. A terminal should also be opened, and is used to run the application. \ No newline at end of file +copy paste the script named "startup script" in the "run shell script" window. + +Save the file, then click on the Apple logo on the top left, then system settings, General, and finally login items. + +Finally, click on the "+" on the bottom left of the table, then select the app you just created. + +The next time you boot up your computer after completing these steps, a pop up will appear to inform you that login items have been added. + +The automator application will ask you permission for accessing local files, and discovering devices on your network. Click ok for both + + Safari should automatically open the web platform page \ No newline at end of file diff --git a/software/scripts/Installation_script.command b/software/scripts/Installation_script.command new file mode 100644 index 0000000..41a1394 --- /dev/null +++ b/software/scripts/Installation_script.command @@ -0,0 +1,108 @@ +#!/bin/bash + +# ───────────────────────────────────────── +# setup.command +# ───────────────────────────────────────── +# Installs Homebrew → Node.js → Gama (optionnal) → runs the app + +set -e # Exit immediately if any command fails + +PROJECT_DIR="$HOME/Documents/simple.webplatform" + +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo " 🍺 Step 1: Installing Homebrew" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + +if command -v brew &>/dev/null; then + echo "✅ Homebrew is already installed. Skipping." +else + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + + # Add Homebrew to PATH for Apple Silicon Macs + if [[ -f "/opt/homebrew/bin/brew" ]]; then + eval "$(/opt/homebrew/bin/brew shellenv)" + fi + + echo "✅ Homebrew installed successfully." +fi + +echo "" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo " 🟢 Step 2: Installing Node.js" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + +if command -v node &>/dev/null; then + echo "✅ Node.js is already installed ($(node -v)). Skipping." +else + brew install node + echo "✅ Node.js installed successfully ($(node -v))." +fi + +echo "" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo " 🟢 Step 3: Installing adb tools" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + +if command -v adb &>/dev/null; then + echo "adb is already installed ($(adb version))." +else + brew install --cask android-platform-tools + echo "✅ adb installed successfully ($(adb version))." +fi + +echo "" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo " 🟢 Step 4(optionnal): Installing GAMA" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +read -r -p "Do you want to install GAMA ? (y/n) : " CONFIRM + +if [[ "$CONFIRM" =~ ^[yY]$ ]]; then + brew install gama-jdk + echo "✅ GAMA installed sucessfully" +else + echo "⏭️ Skipped installation of GAMA" +fi + + + +echo "" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo " 📦 Step 5: Running npm install" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + +if [[ ! -d "$PROJECT_DIR" ]]; then + echo "❌ ERROR: Project folder not found at:" + echo " $PROJECT_DIR" + echo " Please make sure the folder exists and try again." + exit 1 +fi + +cd "$PROJECT_DIR" +npm install +echo "✅ npm install complete." + + +echo "" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo " 📦 Step 6: intializing .env file" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + +if [[ -f ".env" ]]; then + echo "✅ .env already existing, skipping..." +elif [[ -f ".env.example" ]]; then + cp .env.example .env + echo "✅ .env initialized from .env.example file" +else + echo "⚠️ couldn't find .env.example, skipping..." +fi + + + +echo "" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo " 🚀 Step 7: Starting the app (npm start)" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +cd ~/Documents/simple.webplatform +npm start & +sleep 3 +open -a Safari http://localhost:8000 \ No newline at end of file diff --git a/software/scripts/startup_script.command b/software/scripts/startup_script.command index ed43c38..817363a 100644 --- a/software/scripts/startup_script.command +++ b/software/scripts/startup_script.command @@ -1,4 +1,5 @@ -# READ THE INSTRUCTIONS FIRST -#!/bin/bash -cd path/to/application -/usr/local/bin/npm start \ No newline at end of file +export PATH="/usr/local/bin:/opt/homebrew/bin:$PATH" # define the path value to be able to run the application (node, adb, etc) +cd ~/Documents/simple.webplatform +npm start & # start the application, and in parallel: +sleep 3 +open -a Safari http://localhost:8000 # wait 3 seconds and open the URL of the main page of the app \ No newline at end of file