From 310052d71d5e587750ffddd358ab1509b7e5aaab Mon Sep 17 00:00:00 2001 From: Ty Fiero Date: Wed, 20 Mar 2024 22:53:44 -0700 Subject: [PATCH] Change port number to 10001 --- 01OS/01OS/clients/base_device.py | 4 ++-- 01OS/01OS/clients/esp32/src/client/client.ino | 2 +- 01OS/01OS/server/i.py | 5 +---- 01OS/01OS/server/server.py | 2 +- 01OS/01OS/server/skills/schedule.py | 2 +- 01OS/01OS/server/tunnel.py | 2 +- 01OS/start.py | 4 ++-- archive/.env.example | 6 +++--- archive/tunnel.sh | 4 ++-- docs/server/setup.mdx | 2 +- 10 files changed, 15 insertions(+), 18 deletions(-) diff --git a/01OS/01OS/clients/base_device.py b/01OS/01OS/clients/base_device.py index 883d41e1..c05b4906 100644 --- a/01OS/01OS/clients/base_device.py +++ b/01OS/01OS/clients/base_device.py @@ -255,9 +255,9 @@ async def websocket_communication(self, WS_URL): try: async with websockets.connect(WS_URL) as websocket: if CAMERA_ENABLED: - print("Press the spacebar to start/stop recording. Press 'c' to capture an image from the camera. Press CTRL-C to exit.") + print("\nPress the spacebar to start/stop recording. Press 'c' to capture an image from the camera. Press CTRL-C to exit.") else: - print("Press the spacebar to start/stop recording. Press CTRL-C to exit.") + print("\nPress the spacebar to start/stop recording. Press CTRL-C to exit.") asyncio.create_task(self.message_sender(websocket)) diff --git a/01OS/01OS/clients/esp32/src/client/client.ino b/01OS/01OS/clients/esp32/src/client/client.ino index e7941d40..ee18163d 100644 --- a/01OS/01OS/clients/esp32/src/client/client.ino +++ b/01OS/01OS/clients/esp32/src/client/client.ino @@ -13,7 +13,7 @@ #include String server_domain = ""; -int server_port = 8000; +int server_port = 10001; // ----------------------- START OF WIFI CAPTIVE PORTAL ------------------- diff --git a/01OS/01OS/server/i.py b/01OS/01OS/server/i.py index cb110cc0..79ac3418 100644 --- a/01OS/01OS/server/i.py +++ b/01OS/01OS/server/i.py @@ -325,10 +325,7 @@ def configure_interpreter(interpreter: OpenInterpreter): with open(file, "r") as f: code_to_run += f.read() + "\n" - print("IMPORTING SKILLS:\n", code_to_run) - - for line in interpreter.computer.run("python", code_to_run, stream=True): - print(line) + interpreter.computer.run("python", code_to_run) interpreter.computer.save_skills = True diff --git a/01OS/01OS/server/server.py b/01OS/01OS/server/server.py index 7bade3cc..52d5a975 100644 --- a/01OS/01OS/server/server.py +++ b/01OS/01OS/server/server.py @@ -48,7 +48,7 @@ app_dir = user_data_dir('01') conversation_history_path = os.path.join(app_dir, 'conversations', 'user.json') -SERVER_LOCAL_PORT = int(os.getenv('SERVER_LOCAL_PORT', 8000)) +SERVER_LOCAL_PORT = int(os.getenv('SERVER_LOCAL_PORT', 10001)) # This is so we only say() full sentences diff --git a/01OS/01OS/server/skills/schedule.py b/01OS/01OS/server/skills/schedule.py index 85c37bbc..f351c592 100644 --- a/01OS/01OS/server/skills/schedule.py +++ b/01OS/01OS/server/skills/schedule.py @@ -29,7 +29,7 @@ def schedule(message="", start=None, interval=None) -> None: escaped_question = prefixed_message.replace('"', '\\"') json_data = f"{{\\\"text\\\": \\\"{escaped_question}\\\"}}" - command = f'''bash -c 'if [ "$(cat "{session_file_path}")" == "{file_session_value}" ]; then /usr/bin/curl -X POST -H "Content-Type: application/json" -d "{json_data}" http://localhost:8000/; fi' ''' + command = f'''bash -c 'if [ "$(cat "{session_file_path}")" == "{file_session_value}" ]; then /usr/bin/curl -X POST -H "Content-Type: application/json" -d "{json_data}" http://localhost:10001/; fi' ''' cron = CronTab(user=True) job = cron.new(command=command) diff --git a/01OS/01OS/server/tunnel.py b/01OS/01OS/server/tunnel.py index 69716877..5d55a97c 100644 --- a/01OS/01OS/server/tunnel.py +++ b/01OS/01OS/server/tunnel.py @@ -5,7 +5,7 @@ import time from ..utils.print_markdown import print_markdown -def create_tunnel(tunnel_method='ngrok', server_host='localhost', server_port=8000): +def create_tunnel(tunnel_method='ngrok', server_host='localhost', server_port=10001): print_markdown(f"Exposing server to the internet...") if tunnel_method == "bore": diff --git a/01OS/start.py b/01OS/start.py index 759698aa..f7da8438 100644 --- a/01OS/start.py +++ b/01OS/start.py @@ -13,7 +13,7 @@ def run( server: bool = typer.Option(False, "--server", help="Run server"), server_host: str = typer.Option("0.0.0.0", "--server-host", help="Specify the server host where the server will deploy"), - server_port: int = typer.Option(8000, "--server-port", help="Specify the server port where the server will deploy"), + server_port: int = typer.Option(10001, "--server-port", help="Specify the server port where the server will deploy"), tunnel_service: str = typer.Option("ngrok", "--tunnel-service", help="Specify the tunnel service"), expose: bool = typer.Option(False, "--expose", help="Expose server to internet"), @@ -62,7 +62,7 @@ def run( def _run( server: bool = False, server_host: str = "0.0.0.0", - server_port: int = 8000, + server_port: int = 10001, tunnel_service: str = "bore", expose: bool = False, diff --git a/archive/.env.example b/archive/.env.example index 19a8c68b..65670b58 100644 --- a/archive/.env.example +++ b/archive/.env.example @@ -18,13 +18,13 @@ PIPER_VOICE_NAME="en_US-lessac-medium.onnx" # If SERVER_START, this is where we'll serve the server. # If CLIENT_START, this is where the client expects the server to be. -# SERVER_URL=ws://localhost:8000/ -SERVER_URL=ws://0.0.0.0:8000/ +# SERVER_URL=ws://localhost:10001/ +SERVER_URL=ws://0.0.0.0:10001/ SERVER_START=True CLIENT_START=True # The port to start the local server on -SERVER_LOCAL_PORT=8000 +SERVER_LOCAL_PORT=10001 # Explicitly set the client type (macos, rpi) CLIENT_TYPE=auto diff --git a/archive/tunnel.sh b/archive/tunnel.sh index 564acf93..bc86dfdf 100755 --- a/archive/tunnel.sh +++ b/archive/tunnel.sh @@ -7,8 +7,8 @@ # - ngrok TUNNEL_METHOD=${TUNNEL_METHOD:-bore} -# Get the SERVER_PORT environment variable, but default to 8000 -SERVER_LOCAL_PORT=${SERVER_LOCAL_PORT:-8000} +# Get the SERVER_PORT environment variable, but default to 10001 +SERVER_LOCAL_PORT=${SERVER_LOCAL_PORT:-10001} echo "Using $TUNNEL_METHOD to expose port $SERVER_LOCAL_PORT on localhost..." diff --git a/docs/server/setup.mdx b/docs/server/setup.mdx index deff6ace..44804c3d 100644 --- a/docs/server/setup.mdx +++ b/docs/server/setup.mdx @@ -53,7 +53,7 @@ For more information, please read about speec - `--server-port INTEGER` Specify the server port where the server will deploy. - Default: `8000`. + Default: `10001`. - `--tunnel-service TEXT` Specify the tunnel service.