- Prepare Your SD Card with Raspberry Pi5 OS
- Setup Wi-Fi Router / Mobile Hotspot
- Copy ninjaWeb Code to Raspberry Pi
- SSH into Raspberry Pi
- Enable SPI kernal module
- Setup
data-server
andbokeh-server
Environments - Run ninjaWeb
Here's a step-by-step guide to preparing your SD card for Raspberry Pi OS:
Insert the SD card into your computer’s SD card reader.
Open your web browser and go to the Raspberry Pi Software download page.
Press the Download for Windows button. Once the download completes, run the .exe
file to install Raspberry Pi Imager on your system.
After installation, Raspberry Pi Imager will automatically open.
In the Imager interface, under Device, select Raspberry Pi 5.
Under Operating System, choose:
-
Raspberry Pi OS (other)
$\rightarrow$ Raspberry Pi OS Lite (64-bit).
Under Storage, choose the SD card that you inserted earlier.
Press Next to continue.
Click on Edit Settings to configure the Raspberry Pi’s network, hostname, and other settings. Enter the following:
General:
-
Set Hostname:
ninja-pi.local
-
Set Username:
NinjaNIRS
-
Set Password:
nn2022pidev
LAN Settings:
-
SSID (Wi-Fi network name):
ninjaGUIpy
-
Password:
ninjaGUIpy2023
-
Wireless LAN Country:
US
Set Time Zone:
- Configure the correct time zone (for example,
America/New_York
if you're in the Eastern Time Zone).
Enable SSH and select Use password authentication.
Uncheck Enable telemetry.
Once all settings are configured, press Save.
After saving, you'll be asked to confirm; press Yes to begin writing the Raspberry Pi OS to the SD card.
Wait for the process to finish. Once done, safely eject the SD card and insert it into your Raspberry Pi 5.
Your Raspberry Pi 5 is now set up with the ninjaWeb configuration. Proceed to power it up and connect it to the internet via LAN or Wi-Fi, and you should be good to go!
To ensure seamless connectivity, configure your Wi-Fi router or mobile hotspot with the following details:
- Wi-Fi Network Name:
ninjaGUIpy
- Password:
ninjaGUIpy2023
Insert the SD card into the ninjaNIRS
Raspberry Pi. Connect your computer's Wi-Fi to the same router.
You'll need to transfer the ninjaWeb
code from GitHub to your Raspberry Pi. Software like WinSCP is ideal for this.
Use the following connection details:
- Hostname:
ninja-pi.local
- Username:
NinjaNIRS
- Password:
nn2022pidev
To access your Raspberry Pi's command line, use an SSH client like PuTTY.
Here are the SSH details:
- Hostname:
ninja-pi.local
- Username:
NinjaNIRS
- Password:
nn2022pidev
Run sudo raspi-config
in the terminal, select interface options and Enable automatic loading of SPI kernal module.
Now run these commands to set up the data-server
and bokeh-server
environments:
cd ~/ninjaWeb/data-server/
python3 -m venv .
source ./bin/activate
pip install -r requirements.txt
deactivate
cd ~/ninjaWeb/bokeh-server/
python3 -m venv .
source ./bin/activate
pip install -r requirements.txt
deactivate
- Turn on the ninjaNIRS device.
- Ensure that both the ninjaNIRS system and the laptop running ninjaWeb are connected to the same Wi-Fi network.
Open two putty terminal windows on the computer and ssh into raspberry pi
cd ~/ninjaWeb/data-server/
source ./bin/activate
python3 nn_data_server_main.py
cd ~/ninjaWeb/bokeh-server/
source ./bin/activate
bokeh serve web-app --allow-websocket-origin=ninja-pi.local:5006
These two processes can be automatically launched when the Raspberry Pi boots up.
- Open a web browser and navigate to:
http://ninja-pi.local:5006/web-app
- Click the “Date and Time” button to sync the system clock on ninjaNIRS.
🔹 The button will fade to gray once the time is set successfully.
🔹 If the router is connected to the internet, the time may already be set.
- Click the "Enable Power Calibration" button to activate calibration controls.
- Complete the power calibration process and press Return button
- After calibration, click the “Run” button to begin data collection.