From 654752bf428adbc82a55de81c4b735802f11ffbf Mon Sep 17 00:00:00 2001 From: Hugvey Central Command Date: Fri, 15 Nov 2019 17:37:43 +0100 Subject: [PATCH 1/2] Fix #78 - load files from different server --- hugvey/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hugvey/client.py b/hugvey/client.py index 4bb1b8b..af26730 100644 --- a/hugvey/client.py +++ b/hugvey/client.py @@ -310,7 +310,7 @@ class CommandHandler(object): #: var response: http.client.HTTPResponse response = urllib.request.urlopen(file, timeout=4) fetchend = time.time() - logger.info("Fetched {} in {}s".format(file, fetchend-start)) + logger.info("Fetched {} in {:.4f}s".format(file, fetchend-start)) if fetchend-start > 1: logger.warning("Super slow fetching of {} in {}s".format(file, fetchend-start)) if response.getcode() != 200: From f422e49d1f76e72df691d9adbfab1cd661fa485c Mon Sep 17 00:00:00 2001 From: Hugvey Central Command Date: Fri, 15 Nov 2019 23:39:22 +0100 Subject: [PATCH 2/2] Static ip for clients and separate file server --- README.md | 14 ++++++++++++++ client_config.yml | 7 +++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e82f078..726ee87 100644 --- a/README.md +++ b/README.md @@ -259,3 +259,17 @@ Block size : 1024 Delay, msec : 50 + +## Static file server + +To prevent the hugveys from waiting for a suboptimal tornado server, static files can be fetched from a serparate lighttpd server. + +Installed with `apt install lighttpd`. + +In `/etc/lighttpd/lighttpd.conf` set port to `8889` and add an alias for the local dir: + +``` +alias.url = ("/local/" => "/home/hugvey/hugvey/local/") +``` + + diff --git a/client_config.yml b/client_config.yml index a5f3586..963e85e 100644 --- a/client_config.yml +++ b/client_config.yml @@ -1,7 +1,6 @@ events: - cmd_address: "tcp://hugveycmd.local:5555" - publish_address: "tcp://hugveycmd.local:5556" - remote_ip: "192.168.1.1" # for stuf not on the Hugvey network, set it to eg. 8.8.8.8 + cmd_address: "tcp://192.168.1.155:5555" + publish_address: "tcp://192.168.1.155:5556" voice: input_rate: 44100 target_rate: 16000 @@ -12,5 +11,5 @@ voice: output_mixer: 'PCM' input_volume: 100 output_volume: 60 - file_address: "http://hugveycmd.local:8888" + file_address: "http://192.168.1.155:8889" output_driver: pulseaudio