Skip to content

rickgode/Windows-RotorHazard-Install

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 

Repository files navigation

Windows RotorHazard Install

The RotorHazard server may be run on any computer with an operating system that supports Python. In these alternate configurations, one or more hardware nodes may be connected via USB -- see doc/USB Nodes.md for more information. The server may also be run using simulated (mock) nodes.

Some Prerequisites

  1. If the computer does not already have Python installed, download and install Python from https://www.python.org/downloads/windows/. For RotorHazard 4.0.0 you MUST INSTALL Python 3.11.7 (or earlier)  The minimum version of Python needed for RotorHazard is 3.7. To check if Python is installed and the version, open up a command prompt and enter [python –version]  If you installed Python 3.12 you might get errors
  2. The next thing you will need to install is the Visual Studio Installer.  In the Workloads tab on the top make sure and check “Desktop Development with C++ and install that.

Visual Studio Install

  1. You will also need a USB Node, see doc/USB Nodes.md for more information. USB Node USB Node

  2. Or you can use the PCB board I designed. Download the gerber file here.

USB Node PCB

  1. Once you have your USB Node, plug it in your computer, go to the device manager and make note of the com port (you'll need it later)

COM Port

Install the RotorHazard server on Windows:

  1. From the RotorHazard Releases page on github, download the "Source code (zip)" file.
  2. Unzip the downloaded file into a directory (aka folder) on the computer.  I suggest C:\Users\{username}\
  3. Open up windows file explorer and navigate to where you unzipped the RotorHazard server I suggest C:\Users\{username}\RotorHazard\ directory then click in the address bar and type “cmd” it will open a command prompt in the correct directory.

CMD

  1. Activate the Python virtual environment 'venv'
python -m venv venv
venv\Scripts\activate.bat
  1. Using the command prompt, navigate to the src/server directory.
cd src\server
  1. Install the RotorHazard server dependencies using the 'reqsNonPi.txt' file, using the command below. (Note that this command may require administrator access to the computer, and the command may take a few minutes to finish).
python -m pip install -r reqsNonPi.txt
  1. Copy Config File

In the "src/server" directory, copy the config-dist.json file to config.json:

copy config-dist.json config.json
  1. Edit the Config file

You can open up notepad with a command to edit the config.json file.

notepad config.json

Edit the config.json file and modify the ADMIN_USERNAME and ADMIN_PASSWORD values. These are the login credentials you will need to enter (in the browser popup window) to access the pages reserved for the race director (i.e., the Settings and Run pages).

The attached USB node will be referenced with a serial port name like "COM3". The current ports may be viewed in the Windows Device Manager under "Ports (COM & LPT)" -- when the USB node is plugged in, its entry should appear. It may be necessary to install or update its driver (named something like "USB-SERIAL"). The "src/server/config.json" file should contain an entry like this:

	"SERIAL_PORTS": ["COM3"],

Multiple USB nodes would be configured like this:

	"SERIAL_PORTS": ["COM3","COM4"],
  1. save the config.json file

Create a shortcut to start the RotorHazard server in Windows:

  1. Right click on the desktop and choose new shortcut
  2. For the location of the item copy and paste this but change your {username}.
C:\Windows\System32\cmd.exe /K "cd C:\Users\{username}\RotorHazard\ && python -m venv venv && venv\Scripts\activate.bat && cd src\server && server.py
  1. Click Next
  2. Give your shortcut a name, maybe RotorHazard
  3. Click Finish Your shortcut should be created, but the icon will just be a black cmd box. Let's fix that
  4. Right Click on your shortcut and select properties
  5. Click the button that says change icon
  6. Click browse
  7. Navigate to C:\Users{username}\RotorHazard\src\server\static\image\favicon.ico
  8. Click OK

To stop the RotorHazard Server

  1. In the cmd window press ctrl + c

Update an existing RotorHazard server on Windows:

  1. From the RotorHazard Releases page on github, download the "Source code (zip)" file. https://github.com/RotorHazard/RotorHazard/releases
  2. Unzip the downloaded file into the RotorHazard directory (aka folder) on the computer, overwriting the existing version. I suggest C:\Users{username}\
  3. Using the command prompt, navigate to the topmost RotorHazard directory.
  4. Activate the Python virtual environment 'venv'
python -m venv venv
venv\Scripts\activate.bat
  1. Using the command prompt, navigate to the src/server directory.
cd src\server
  1. Enter the update command:
python -m pip install --upgrade --no-cache-dir -r reqsNonPi.txt

About

How to install RotorHazard Server on Windows

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published