NGRP / node-red-contrib-viseo

Node-RED nodes OpenSourced by VISEO Technologies
Apache License 2.0
227 stars 83 forks source link

Help for installing Sarah #99

Closed godestalbin closed 5 years ago

godestalbin commented 5 years ago

Hello, I am stuck with the installation of Sarah. I have go through the installation of Getting Started. I created a VM in Google Cloud. I created my first flows in Viseo framework using node-red tutorials. Bot services are now in Azure. I created a Bot Channels Registration (is it right? other choices are Web app bot and Function bots). I connected my bot in Node-RED and it displays connected. I also installed node-red-contrib-viseo-sarah. I am stuck with these instructions: To define your "messaging endpoint", edit your app settings and enter for messaging endpoint https://[your server url]/api/v1/messages I put the IP@ of my VM (checked port 443 is enabled). When I test my bot in Azure (Tester dans une discussion web) it fails to send the message: There was an error sending this message to your bot. I understand that my issue is that nothing is answering behing https://[your server url]/api/v1/messages but how to get something ?

Klervix commented 5 years ago

Hello! I'm not sure about the error, but this is how I would do:

godestalbin commented 5 years ago

Hello Klervix, Thank you for your help. So it seems my problem is that I cannot access https://[Public IP of my GCP VM]/api/v1/messages So I try to follow the instruction in Advanced-Usages but I have another issue: I created the file /etc/nginx/sites-available/[Public IP of my GCP VM] with the content server { listen 80; #server name or ip address server_name demo.[Public IP of my GCP VM]; location '/.well-known/acme-challenge' { root /var/www/html; } }` When I run sudo certbot --nginx certonly I got the following error: No names were found in your configuration files. Please enter in your domain name(s) (comma and/or space separated) (Enter 'c' to cancel): Is there a way to get a certificate without a domain name ?

godestalbin commented 5 years ago

I moved a little bit further: Certbot does not work with an IP@ (community.letsencrypt.org), you must have a domain name. So I got a domain name from freedns.afraid.org. I can now access Viseo framework at http://my-brand-new-domain.org:1880 Then I managed to get the certificate for my domain:

Congratulations! Your certificate and chain have been saved...

I updated the file ~/[bot]/bot/conf/nginx.conf #server name server_name my-brand-new-domain.org; I don't see anything else to be modified in this file. I did not noticed it at first but nginx could not restart after my modification. It was also necessary to update the lines with ssl_certificate and ssl_certificate_key with files generated when the certificate was issued. Now I can access https://my-brand-new-domain.org/api/v1/messages and I got the answer:

Hello I'm a Bot !

When I test my Azure bot in a discussion the message seems to be sent, no more error message. But I cannot get the message sent from Azure bot in the debug node. How do I restart node-red server server ? How to put an empty node ?

godestalbin commented 5 years ago

I put an Empty function as you recommended. Finally I got the message sent from the test bot to Sarah but I cannot receive the answer. I put a message card after the empty function and then a debug. I see the sentence sent from the bot conversation in the debug window but do not receive answer [ { "id": "ce1fb813.e40f08", "type": "bot", "z": "6e65afe9.c045a", "name": "", "project": "", "port": "", "x": 146, "y": 93, "wires": [ [ "89233324.8586d" ] ] }, { "id": "cc26020b.721c1", "type": "debug", "z": "6e65afe9.c045a", "name": "", "active": true, "console": "false", "complete": "payload", "x": 670, "y": 60, "wires": [] }, { "id": "89233324.8586d", "type": "function", "z": "6e65afe9.c045a", "name": "Empty", "func": "\nreturn msg;", "outputs": 1, "noerr": 0, "x": 293.1000061035156, "y": 144.1999969482422, "wires": [ [ "897bd71e.e0f018" ] ] }, { "id": "897bd71e.e0f018", "type": "send-card", "z": "6e65afe9.c045a", "name": "", "labels": [ "Default output" ], "nodeid": "SEND_1541107002453", "delay": "0", "repeat": "0", "outputs": 1, "btnOutput": false, "quickOutput": false, "prompt": false, "promptText": "prompt.text", "promptTextType": "msg", "speech": true, "speechText": "", "sendType": "text", "text": "Bonjour, j'ai bien reçu votre message", "random": false, "media": "", "mediaType": "str", "eventName": "", "eventValue": "", "eventValueType": "str", "title": "Received", "titleType": "str", "subtitle": "Received", "attach": "", "attachType": "str", "carousel": false, "buttons": [ { "title": "", "action": "postBack", "value": "", "regexp": "" } ], "quicktext": "", "quickreplies": [ { "title": "", "action": "postBack", "value": "", "regexp": "" } ], "signintext": "", "signintitle": "", "signintitleType": "str", "signinurl": "", "signinurlType": "str", "shcardtext": "", "shcardtitle": "", "shcardtitleType": "str", "shcardimage": "", "shcardimageType": "str", "shcardbutton": "", "shcardbuttonType": "str", "shcardurl": "", "shcardurlType": "str", "x": 546.1000366210938, "y": 233.80001831054688, "wires": [ [ "cc26020b.721c1" ] ] } ]

godestalbin commented 5 years ago

Wowww !!! Finally I got it working. For the issue with the answer, I followed the answer from Jean-Philippe in this issue Problem to receive a response to the web client [bot-framework] #79. The next challenge is to get Sarah to hear voice commands and to talk (I have no Google home). The available documentation is a little bit scarce. Some hints on how to get it working will be appreciated. Before I spend some money in a Google home device, I would try to use the Google assistant from my Android phone.

godestalbin commented 5 years ago

I will open a new issue to track down my experimentation with Dialogflow.