Git Product home page Git Product logo

ovos-skill-node-red's Introduction

NodeRed mycroft skill

Node Red - Mycroft interface

beginners and non technical users can now leverage visual programming and easily extend mycroft functionality

Platform support

  • ✔️ - tested and confirmed working
  • ❌ - incompatible/non-functional
  • ❓ - untested
  • 🚧 - partial support
platform status tag version last tested
Chatterbox dev never
HolmesV dev never
LocalHive dev never
Mycroft Mark1 dev never
Mycroft Mark2 dev never
NeonGecko dev never
OVOS dev never
Picroft dev never
Plasma Bigscreen dev never
  • tag - link to github release / branch / commit
  • version - link to release/commit of platform repo where this was tested

Additional Setup

This skill requires Mycroft HiveMind Skill

After installing the node red skill you need to deploy some flows in node red

Installing node red

read the Node Red Getting Started Guide

you might need to install

apt-get install libssl-dev libffi-dev

Firewall

Node red can be running in any machine, does not need to run in same place as mycroft, if this is the case open port 6789 in mycroft

sudo ufw allow 6789

Note that it is node red that starts a connection to mycroft, not the other way around

Launch Node red

node red must be running, it can be started with

 node-red-start

or made into a system service

sudo systemctl enable nodered.service
sudo service nodered start

verify that node-red is running at http://noderedip:1880

Import base flows

  • Copy the JSON text from base_flows.json
  • Go to http://noderedip:1880
  • In the upper righthand corner menu, choose... Import > Clipboard
  • This will open the "Import nodes window"
  • Paste the contents from the sample_flow.txt
  • Click on Import and the flow should appear
  • Next click on Deploy
  • After you deploy, the websocket nodes should say 'connected' if the skill was properly configured

Configure Websocket

NodeRed will open a websocket connection to communicate with mycroft

ws://username:[email protected]:6789

username can be anything, secret is set in web ui of the skill

You need to edit mycroft-in and mycroft-out websocket nodes with the correct secret and mycroft's ip address

Build Intents

Edit intents flow to add your node red intents

Extra functionality

There are 2 flows providing extra functionality

Webui

A basic webchat is provided, you can access it at http://noderedip:1880/ui

Debug

Test different payload with the debug flow

ovos-skill-node-red's People

Contributors

emphasize avatar jarbasal avatar rdelange avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ovos-skill-node-red's Issues

Picroft Install failing

Working with the latest version of Mycroft-core (10.2.10) on a Raspi 3B. Node red installs fine, however trying to install the skill:

pi@picroft:~ $ sudo msm install https://github.com/JarbasAl/fallback-node-red

produces the following:

Traceback (most recent call last):
File "/usr/local/bin/msm", line 9, in <module>
load_entry_point('msm==0.5.14', 'console_scripts', 'msm')()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 356, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2476, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2190, in load
['__name__'])
File "/usr/local/lib/python2.7/dist-packages/msm/__init__.py", line 22, in <module>
from .exceptions import *
File "/usr/local/lib/python2.7/dist-packages/msm/exceptions.py", line 24, in <module>
from future.utils import raise_from
ImportError: No module named future.utils

Install Failed

Hi there,

I really want to handle fallback with node-red so your project seams perfect!

Unfortunately , i can't use it.

I'm using the last MSM / Mycroft version

and i've try a lot of way

I use mycroft as Pi user (raspberry Pi 4) with Reaspeaker 4mic linear

source mycroft-core/.venv/bin/activate
sudo mycroft-core/.venv/bin/msm install https://github.com/JarbasAl/fallback-node-red

FileNotFoundError: [Errno 2] No such file or directory: '/root/.mycroft/skills.json'

So i create a symlink between /root/.mycroft/skills.json and /home/pi/.mycroft/skills.json
And it works !

But still , msm update failed

ERROR - Error running update_skill on fallback-node-red.jarbasal: MergeConflict

Can you please help me to install correctly your project ?

Regards

Error loading skill on Linux Mycroft

Hi,

I successfully installed the skill but when Mycroft tryes to load the skill I get this error

17:49:47.639 - mycroft.skills.core:load_skill:119 - INFO - ATTEMPTING TO LOAD SKILL: fallback-node-red.jarbasal with ID fallback-node-red.jarbasal
~~~~.skills.core:default_shutdown:1453 - ERROR - Skill specific shutdown function encountered an error: RuntimeError('cannot join thread before it is started',)
17:49:52.812 - mycroft.skills.core:load_skill:166 - ERROR - Failed to load skill: fallback-node-red.jarbasal
Traceback (most recent call last):
  File "/opt/mycroft-core/mycroft/skills/core.py", line 146, in load_skill
    raise e
  File "/opt/mycroft-core/mycroft/skills/core.py", line 142, in load_skill
    skill.initialize()
  File "/opt/mycroft/skills/fallback-node-red.jarbasal/__init__.py", line 97, in initialize
    self.factory.bind(self.emitter)
AttributeError: 'NodeRedSkill' object has no attribute 'emitter'

actually there are 2 errors in there but I think the shutdown one is not important.

If you need more information on my particular installation please let me know.

Thank you.

conflict pyee with mycroft core

node red skill uses pyee-5.0.0 and mycroft core needs pyee-8.1.0.
on installation my cli crashes and after rebooting i get:
for meImportError: cannot import name 'ExecutorEventEmitter' from 'pyee' (/home/andreas/mycroft-core/.venv/lib/python3.8/site-packages/pyee/init.py)`

understanding node red skill

Mycroft decides what skill to trigger like this

pic

Node red skill acts as a bridge between a node red instance and mycroft, it works like a fallback skill

pic2

Converse method is now being integrated, you can handle the entire conversation inside node red this way

pic3

After reboot not falling back to node red anymore

Hi,
I have succesfully installed the fallback skill on the latest release of piCroft. Everything was running fine after first installation. (tried the 'what does verge say' question succesfully) After reboot of the Picroft though it is not falling back anymore to the node red skill. it tries Wolfram and then goes directly to the UnknownSkill.
Same behavior on my desktop install. It works directly after first installation, but it looks like that it is changing settings somewhere in the first run resulting in not working anymore after a restart (of skill services)
Just to be clear, it is only the fallback part. For instance 'ping node red' is still working, so the skill is loaded.

Any ideas?

Thanks

Error in debug flow

Hi,

Nice job for this skill, very usefull. Thank you

When you trigger the converse sequence in debug flow, mycroft says skill.error, is that normal?

I try to understant how converse works but you have made node example. Can you provide an example of a simple conversation pls, that would be very usefull.

So far i understand, all solution i found seems to huge to be correct. It's seems like you have a the node "filter" in the flow "bus" and you use a flow variable but the two possible way you add to this node point at the same place. I am lost :)

Thank you again.

Installing Error

I keep getting this error when trying to install. I tried flashing the core a few times but still keep getting this error. I do have libxml2 and libxslt installed... I do not understand what I need to do...

Thanks!!!


ERROR: Command errored out with exit status 1:
command: /home/pi/mycroft-core/.venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-q1yub_wl/lxml/setup.py'"'"'; file='"'"'/tmp/pip-install-q1yub_wl/lxml/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-q1yub_wl/lxml/pip-egg-info
cwd: /tmp/pip-install-q1yub_wl/lxml/
Complete output (3 lines):
Building lxml version 4.6.2.
Building without Cython.
Error: Please make sure the libxml2 and libxslt development packages are installed.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 20.0.2; however, version 20.3.3 is available.
You should consider upgrading via the '/home/pi/mycroft-core/.venv/bin/python -m pip install --upgrade pip' command.

Install Instructions Scratch

---updated---

I guess we need some help testing the install instructions, this is starting point

Installing the Node-Red Fallback Skill, Node-Red and the Sample Flow


Install the Node-Red Fallback Skill

For the Mark 1
sudo apt-get install libssl-dev libffi-dev
sudo msm install https://github.com/JarbasAl/fallback-node-red
sudo service mycroft-skills restart

For Picroft
sudo apt-get install libssl-dev libffi-dev
sudo msm install https://github.com/JarbasAl/fallback-node-red
sudo service mycroft-skills restart

For desktop Mycroft dev installations
cd /home/username/mycroft-core/msm
./msm install https://github.com/JarbasAl/fallback-node-red
./msm update


Install Node-Red

Official Node-Red install instructions https://nodered.org/docs/hardware/raspberrypi

bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

If on a Raspberry Pi, choose Pi specific install, this limits the max amount of memory to 256MB in the case a poorly configured flow

sudo systemctl enable nodered.service

This will automatically start node-red at boot time

sudo service nodered start

This starts Node-Red, check to see if it's running at http://127.0.0.1:1880 / http://mycroftaddress:1880 ...If you have a firewall, open port 1880


Importing the Sample Flow

Go to https://raw.githubusercontent.com/JarbasAl/fallback-node-red/master/sample_flow.txt
Copy the JSON text
Go to http://addressofmycroft:1880
In the upper righthand corner menu, choose... Import > Clipboard
This will open the "Import nodes" window
Paste in the contents from the sample_flow.txt
Click on Import and the flow should appear
Click on the workspace to place the flow
Click on Deploy in the upper-right

Next click on Deploy
After you deploy, the websocket nodes should say 'connected' if the the fallback
skill was installed properly
Check the 'intent' node to see what key words are being used to trigger a skill
Go to the Mycroft terminal to test the intents

Any way to connect remotely ?

I have a Mark1 and want to have this functionally, but nodered is running on my server, not on the mark1, is there any way to get this working like that ? (i've looked and can't see port 6789 listening on the network, i assume it's just listening on the loopback)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.