EdgeMode Robot Gateway (portable)
=================================

Connects the EdgeMode Robot Studio web app to your robots (Wi-Fi or USB).
Nothing to install: this folder contains everything, including its own Python.
Every program file in it is digitally signed (Python Software Foundation / Microsoft), so Windows
Smart App Control allows it, also when downloaded.

START
  1. Unzip this folder anywhere (e.g. Documents\EdgeModeGateway).
  2. Double-click EdgeModeGateway.bat.
     - A small window "EdgeMode Robot Gateway" opens: it shows the gateway is running.
     - The gateway's Robot and Settings pages open in your web browser.
  3. In the gateway's Settings > Web connection you see a 6-digit code.
  4. In the EdgeMode web app: click "Connect gateway" and enter the code.
  5. Set up your robots on the gateway's Robot page (Add robot / Edit).

CONNECTION: USB, WI-FI OR BOTH
  Each robot has a connection setting (top bar, or Edit on its card):
    USB    (default) commands go over the USB cable. Works anywhere, no Wi-Fi needed.
    Wi-Fi  commands go over the network; this PC and the robot must be on the same Wi-Fi.
    Both   USB when the robot is plugged in, otherwise Wi-Fi.
  Live sensors and the arrow buttons need Wi-Fi; programs from the web app work over both.

ROBOT ON USB
  Plug the robot in, then on the Robot page click "Detect robots on USB": the gateway finds which
  robot it is and sets its USB port.
  If Windows has no driver for the robot's USB chip, the Robot page says so and offers:
    - "Install driver from Windows Update" (Windows asks for administrator approval), or
    - "Download from Silicon Labs": download "CP210x Universal Windows Driver", then click
      "Install from Downloads". The gateway only installs drivers signed by Microsoft.

ADD A ROBOT TO YOUR WI-FI
  With the robot plugged in by USB, on the Robot page under "Add robot to Wi-Fi":
    1. Click "Find Wi-Fi networks": the robot lists the networks it can reach (2.4 GHz only),
       strongest first; this PC's network is pre-selected if the robot sees it.
    2. Pick a network (or "Other network..." for a hidden one) and type its password.
    3. Click "Check password & add": the robot first tries to join. If the password is wrong,
       nothing is saved and you can try again. If it works, the network is saved on the robot,
       it restarts, and its connection is set to Both. The password goes only to the robot.
  Protected robots (e.g. AsomeBot) are not changed.

Keep the small gateway window open while you use the web app.
Close it to stop the gateway: any running robot program is stopped too.
To reopen the Robot/Settings pages, use the address shown in the gateway window.

IF SOMETHING GOES WRONG
  The gateway window shows the error. Details are in %APPDATA%\EdgeModeGateway\gateway.log

FOLDERS
  EdgeModeGateway.bat   start the gateway
  app\                  the gateway program
  python\               bundled Python 3.12
  robot-files\          files you can upload to a robot over USB (Robot > Upload)

Settings are kept in %APPDATA%\EdgeModeGateway (they stay when you update this folder).

NEEDS
  Windows 10 or 11 (64-bit) and a web browser.
