Node-red-contrib-amazon-echo and running NR in root at bootup

System:
NR: v20.5
HW: pi3b+
Use: Home automation; Alexa, Broadlink, Wemo, Environ monitor

Problem: node-red-contrib-alexa-local no longer works

What to achieve: Restore use of Alexa functions with minimal disruption to exiting system

Context:
Everything works great till Amazon changed something and after searching forum, found node-red-contrib-alexa-local will not work now.

Decide to use node-red-contrib-amazon-echo

However for node-red-contrib-amazon-echo to work the requirement is that NR has to be run in root ie "sudo node-red-start"

So I first node-red-stop to stop NR and sudo node-red-start

NR started but seems to be a different NR instance as all my nodes and tabs are not there, seems to be a new NR instance. I installed node-red-contrib-amazon-echo and it works, however all my other nodes and tabs are not there.

Can someone clarify:

  1. Is it a different NR instance when I "sudo node-red-start" (are there two separate NR instances or just different config and nodes files?)

  2. How do I automatically start NR running as root on bootup. Currently I use sudo systemctl enable nodered.service to start NR on boot but obviously this is not running in root.

Thanks,

  1. How do I automatically start NR running as root on bootup. Currently I use sudo systemctl enable nodered.service to start NR on boot but obviously this is not running in root.

Follow the instructions
https://nodered.org/docs/getting-started/raspberrypi

After further digging in the Forum, it is not recommended to run NR in root.
Also found found this topic "Amazon Echo Hub". Followed instructions with iptables and redirect, still device not discovered by Alexa.
However running as root works.

Hi KenKoknz,
Have a look through this tutorial as it includes details of using Amazon Echo Hub in a flow.
You do not need to start NR as root - NOT recommended, just forward a port.
This pair of nodes work really well and still work as of 8th Oct 2019.
Let me know if you need further details.

Hi DynamicDave,

Thanks for that, as mentioned before I have been trying forwarding the port and redirect 80 to 8980 as prescribed, but Alexa simply will not discover the device.

After few frustrating hours, I was wondering if the sequence is important, ie should port redirct be done first, then install the node-red-contrib-amazon-echo?

To try that I deleted node-red-contrib-amazon-echo and reinstall (as I have already done the redirect bit, and it started working, Alexa discover the device!

On a different note, I sometimes use lan and wifi on the same pi, I presume I can run both the scripts (for wifi and lan) with any repercussions?

Anyway my flow is to control a sonoff (flashed with espeasy).
image

Whilst I have been using Alexa home skill (cloud dependent) in the interim when Alexa local was not working it is good to have a Alexa working in local node again.

Lets hope Amazon does not disrupt or change things too much again with Alexa.

Thanks,
Ken

Hi Ken,
Sounds as if you've got it working - well done.

I only use the ethernet connection on my RPi(es), so can't really comment about running both scripts.
There may be other people on this 'forum' who are more experienced on networking than I am, so hopefully they might respond.

I'm currently writing a Tutorial Guide about using miniature IR detectors (in my car at night to keep it safe on the drive). I'm using the Amazon Alexa Hub and Device to activate and deactivate the system, as well as the Telegram node to send 'status' messages to my mobile phone.

Should have the Guide finished in the next couple of days.

PS:
Although I use ESP-Easy on all my Wemos D1 Minis, I find it easier to control the Sonoff S20 switches using MQTT (and to flash the S20 with Tasmota).