MycroftAI / mycroft-gui

The Graphical User Interface used by the Mycroft Mark II and more
Apache License 2.0
166 stars 55 forks source link

Doesn't seem to be working (remote server) #78

Open CactiChameleon9 opened 3 years ago

CactiChameleon9 commented 3 years ago

Describe the bug Mycroft GUI does not seem to work properly with a remote mycroft server

To Reproduce Steps to reproduce the behavior:

  1. Change the setting to a non-local server, and error are produced frequently saying it cannot access the pairing file

Expected behavior It should all work properly

Log files Client end running log:

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-daniel'
QtWebEngine::initialize() called with QCoreApplication object already created and should be call before. This is depreciated and may fail in the future.
Attribute Qt::AA_ShareOpenGLContexts must be set before QCoreApplication is created.
Cyclic dependency detected between "file:///usr/lib/qt/qml/org/kde/kirigami.2/Units.qml" and "file:///usr/lib/qt/qml/org/kde/kirigami.2/Units.qml"
file:///usr/lib/qt/qml/org/kde/kirigami.2/styles/Material/Theme.qml:14:1: QML Theme: Binding loop detected for property "textColor"
qrc:/main.qml:297:17: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
qrc:/qml/StatusIndicator.qml:165:5: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
qrc:/qml/SkillView.qml:55:5: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
qrc:/RemoteStt.qml:34:5: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
qrc:/main.qml:329:21: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
file:///usr/lib/qt/qml/org/kde/kirigami.2/templates/AbstractApplicationHeader.qml:153:9: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
file:///usr/lib/qt/qml/org/kde/kirigami.2/templates/AbstractApplicationHeader.qml:83:5: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
file:///usr/lib/qt/qml/org/kde/kirigami.2/templates/AbstractApplicationHeader.qml:102:9: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
qrc:/main.qml:101:5: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
qrc:/main.qml:60:5: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
file:///usr/lib/qt/qml/org/kde/kirigami.2/templates/OverlayDrawer.qml:291:5: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
file:///usr/lib/qt/qml/org/kde/kirigami.2/private/globaltoolbar/PageRowGlobalToolBarUI.qml:50:9: QML PrivateActionToolButton: Binding loop detected for property "checkable"
file:///usr/lib/qt/qml/org/kde/kirigami.2/templates/AbstractApplicationHeader.qml:153:9: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
file:///usr/lib/qt/qml/org/kde/kirigami.2/templates/AbstractApplicationHeader.qml:102:9: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
file:///usr/lib/qt/qml/org/kde/kirigami.2/templates/AbstractApplicationHeader.qml:83:5: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
qml: Trying to connect to Mycroft
qrc:/main.qml:38:5: Unable to assign [undefined] to int
qrc:/main.qml:37:5: Unable to assign [undefined] to int
qrc:/main.qml:36:5: Unable to assign [undefined] to int
qrc:/main.qml:35:5: Unable to assign [undefined] to int
qrc:/main.qml:34:5: Unable to assign [undefined] to int
qrc:/main.qml:33:5: Unable to assign [undefined] to int
qrc:/main.qml:249:17: Unable to assign null to QStringList
file:///usr/lib/qt/qml/org/kde/kirigami.2/GlobalDrawer.qml:493:33: QML GlobalDrawerActionItem: Binding loop detected for property "implicitWidth"
file:///usr/lib/qt/qml/org/kde/kirigami.2/GlobalDrawer.qml:493:33: QML GlobalDrawerActionItem: Binding loop detected for property "implicitWidth"
file:///usr/lib/qt/qml/org/kde/kirigami.2/GlobalDrawer.qml:493:33: QML GlobalDrawerActionItem: Binding loop detected for property "implicitWidth"
qrc:/main.qml:38:5: Unable to assign [undefined] to int
qrc:/main.qml:37:5: Unable to assign [undefined] to int
qrc:/main.qml:36:5: Unable to assign [undefined] to int
qrc:/main.qml:35:5: Unable to assign [undefined] to int
qrc:/main.qml:34:5: Unable to assign [undefined] to int
qrc:/main.qml:33:5: Unable to assign [undefined] to int
qrc:/main.qml:249:17: Unable to assign null to QStringList
Main Socket connected, trying to connect gui
Received port 18181 for gui "{1a994bb0-4209-49aa-abe2-29cde7ae3561}"
qrc:/qml/SkillView.qml:216:21: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
ERROR Loading QML file QUrl("file:///mnt/dietpi_userdata/mycroft-data/skills/mycroft-pairing.mycroftai/ui/pairing_start.qml")
"file:///mnt/dietpi_userdata/mycroft-data/skills/mycroft-pairing.mycroftai/ui/pairing_start.qml: No such file or directory"
ERROR Loading QML file QUrl("file:///mnt/dietpi_userdata/mycroft-data/skills/mycroft-pairing.mycroftai/ui/pairing.qml")
"file:///mnt/dietpi_userdata/mycroft-data/skills/mycroft-pairing.mycroftai/ui/pairing.qml: No such file or directory"
QQuickItem::stackBefore: Cannot stack Control_QMLTYPE_72_QML_85(0x55713ed77410, parent=0x55713f000ab0, geometry=0,0 713x374) before QQuickRepeater(0x55713efec950), which must be a sibling
qrc:/main.qml:292: TypeError: Cannot read property 'longDuration' of undefined
Current intent: ""

If you are running Mycroft, the Support Skill helps to automate gathering this information. Simply say "Create a support ticket" and the Skill will put together a support package and email it to you.

Environment (please complete the following information):

Additional context Fresh install, trying the start-mycroft.sh all manually doesn't help. I think the issue is a client issue rather than a server issue, as the file trying to reference is there and it is stating that the syntax is wrong (I think)

Please think carefully about whether you have modified anything in Mycroft's code or configuration files. If so, can you reproduce this on a clean installation of Mycroft? Many "bugs" turn out to be non-standard configuration errors.

forslund commented 3 years ago

Hi, remote serving requires some tweaks on the device hosting mycroft-core. @AIIX has most experience of this but as I recall it the mycroft.conf need to be configured with a remote_url key with the external url. In addition an http server needs to be set up serving the /opt folder so a gui page is available at http://MY_EXTERNAL_URL/opt/mycroft/skills/THE_SKILL/ui/PAGE.qml

CactiChameleon9 commented 3 years ago

Why isn't that mentions in the README.md bit? any specific reason

CactiChameleon9 commented 3 years ago

I think I know what I did wrong, mycroft-gui needs to be installed and running on the remote bit too?

AIIX commented 3 years ago

To run Mycroft Core remotely with Mycroft GUI on another device:

Remote System Hosting Mycroft Core:

  1. Install mycroft-core normally
  2. Install apache web server
  3. Create a soft link to /opt in /var/www/html/
  4. Add a "mycroft.conf" configuration file in /etc/mycroft/ (create folder if doesn't exist) with the following settings:
    {
    "remote": true,
    "remote-server": "https://ip-or-name-address-where-mycroft-server-is-hosted/"
    }

Host System Where Mycroft-GUI is hosted:

  1. open settings
  2. edit "ws://0.0.0.0" to "https://ip-or-name-address-where-mycroft-server-is-hosted/"
  3. click apply
CactiChameleon9 commented 3 years ago

Thank you so much that makes a ton more sense. I am using nginx, but the principle is the same. This also makes it easier to do remotely - my next plan of action. Is that safe to do with ssl/https?

AIIX commented 3 years ago

it should work with https fine I believe, what really matters is that the qml file path is readable/downloadable over the network

CactiChameleon9 commented 3 years ago

OK, in theory I have done it all correctly - however it doesn't seem to be working? I now have a different error: Mycroft is running but the connection failed for some reason. Kill Mycroft manually.

I had to do a bit of tweaking for my setup: The config file I added to the end of (with the correct syntax, so inside the {} and removing the {} from what you gave me and adding a comma) of /mnt/dietpi_userdata/mycroft-core/mycroft/configuration/mycroft.conf

With nginx I made a folders in /var/www/mycroft/opt/mycroft(linkfolder), making an new nginx config based off the default one with /var/www/mycroft as the root, and I download a file from the directory structure listed (checked with ls to find a specific file to try)

Have I done anything wrong that you can see?