From 27da7410051451f63f3bfd9c00bc8a78f2b7c8e9 Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Mon, 24 Jul 2023 19:47:15 +0200 Subject: [PATCH] Edited to make AI work Signed-off-by: Jeroen Oudshoorn --- builder/data/usr/bin/pwnagotchi-launcher | 4 ++-- pwnagotchi/ai/gym.py | 4 ++-- pwnagotchi/plugins/__init__.py | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/builder/data/usr/bin/pwnagotchi-launcher b/builder/data/usr/bin/pwnagotchi-launcher index ea30cf39..a56665f9 100755 --- a/builder/data/usr/bin/pwnagotchi-launcher +++ b/builder/data/usr/bin/pwnagotchi-launcher @@ -13,7 +13,7 @@ fi blink_led 10 & if is_auto_mode; then - /usr/local/bin/pwnagotchi --debug + /usr/local/bin/pwnagotchi else - /usr/local/bin/pwnagotchi --manual --debug + /usr/local/bin/pwnagotchi --manual fi diff --git a/pwnagotchi/ai/gym.py b/pwnagotchi/ai/gym.py index 23eb1c5c..7134628b 100644 --- a/pwnagotchi/ai/gym.py +++ b/pwnagotchi/ai/gym.py @@ -36,7 +36,7 @@ class Environment(gym.Env): # see https://github.com/evilsocket/pwnagotchi/issues/583 self._supported_channels = agent.supported_channels() - self._extended_spectrum = any(ch > 140 for ch in self._supported_channels) + self._extended_spectrum = any(ch > 150 for ch in self._supported_channels) self._histogram_size, self._observation_shape = featurizer.describe(self._extended_spectrum) Environment.params += [ @@ -147,4 +147,4 @@ class Environment(gym.Env): for name, value in self.last['state'].items(): if 'histogram' in name: logging.info(" %s" % name.replace('_histogram', '')) - self._render_histogram(value) \ No newline at end of file + self._render_histogram(value) diff --git a/pwnagotchi/plugins/__init__.py b/pwnagotchi/plugins/__init__.py index 53ee9342..21a5bc9f 100644 --- a/pwnagotchi/plugins/__init__.py +++ b/pwnagotchi/plugins/__init__.py @@ -6,7 +6,6 @@ import importlib, importlib.util import logging - default_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "default") loaded = {} database = {} @@ -44,7 +43,7 @@ def toggle_plugin(name, enable=True): global loaded, database if pwnagotchi.config: - if not name in pwnagotchi.config['main']['plugins']: + if name not in pwnagotchi.config['main']['plugins']: pwnagotchi.config['main']['plugins'][name] = dict() pwnagotchi.config['main']['plugins'][name]['enabled'] = enable save_config(pwnagotchi.config, '/etc/pwnagotchi/config.toml')