# Node-Red to manage garage door and send SMS stopped sending SMS

**URL:** https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108
**Category:** General
**Created:** [22 December 2024 18:23 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108 "2024-12-22T18:23:12Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![JasGot](https://avatars.discourse-cdn.com/v4/letter/j/c4cdca/32.png) [@JasGot](https://discourse.nodered.org/u/JasGot)
#### Post date: [22 December 2024 18:23 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108/1 "2024-12-22T18:23:12Z")

</div>

I have a Raspberry-Pi that hosts some HTML and uses GPIO to open and close my garage door. It also sends an sms (twilio) message when the door opens and when the door closes.

On Dec 10 the SMS portion stopped working. I have been chasing possible problems and fixes for 12 days and now find myself with no html ui either.

I had proper html access to the UI until I ran this to try and get the SMS working: node-red-contrib-sms-twilio

After running, I rebooted the pi, and now I have lost the UI.  
I can't get to my Garage Door ui or to the Node-Red ui at :1880

I'm so far into this black hole, I feel like I have never written a line of code in my life. Totally stuck and sad... ☹

I could use some pointers on how to get this going again.  
Hoping for a happy holiday.....  
Thanks.

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [22 December 2024 18:35 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108/2 "2024-12-22T18:35:57Z")

</div>

First thing is first:

Start node red in safe mode:  
`node-red --safe` (in terminal)

If this happened after you installed `node-red-contrib-sms-twilio`  
Whilst in safe mode - you can uninstall it (after removing any of its nodes/configs you added to your flow)

This Node hasn't been updated in 8+ years... sounds to me, this might have caused the issue.

Safe Mode, stops all flows from running, and by extension, Nodes that are breaking things.

You can also uninstall it by going to` ~/.node-red` and running:  
`npm uninstall node-red-contrib-sms-twilio` (in terminal)

then trying to start Node red again

**EDIT**

* * *

Oh... reading again, you have always used it?  
Strange how the SMS part has stopped - and now your Node RED isn't working 🤔

Using Safe Mode, you will be able to (hopefully) pinpoint whats going on

---

<div class="post-metadata">

### Author: ![JasGot](https://avatars.discourse-cdn.com/v4/letter/j/c4cdca/32.png) [@JasGot](https://discourse.nodered.org/u/JasGot)
#### Post date: [22 December 2024 19:05 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108/3 "2024-12-22T19:05:09Z")

</div>

> [@marcus-j-davies](#):
>
> node-red --safe

No joy, but maybe more info?

```auto
pi@garagedoor:/home $ node-red --safe
/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:797
    if (sendEvent?.destination?.node) {
                  ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/index.js:19:12)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
pi@garagedoor:/home $

```

---

<div class="post-metadata">

### Author: ![JasGot](https://avatars.discourse-cdn.com/v4/letter/j/c4cdca/32.png) [@JasGot](https://discourse.nodered.org/u/JasGot)
#### Post date: [22 December 2024 19:07 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108/4 "2024-12-22T19:07:14Z")

</div>

Also, what is serving the html pages? Apache? HTTPD? or something else? I can't seem to find any config or services for Apache2.

I'm running Debian:  
PRETTY\_NAME="Raspbian GNU/Linux 11 (bullseye)"  
NAME="Raspbian GNU/Linux"  
VERSION\_ID="11"  
VERSION="11 (bullseye)"  
VERSION\_CODENAME=bullseye  
ID=raspbian  
ID\_LIKE=debian  
HOME\_URL="[http://www.raspbian.org/](http://www.raspbian.org/)"  
SUPPORT\_URL="[RaspbianForums - Raspbian](http://www.raspbian.org/RaspbianForums)"  
BUG\_REPORT\_URL="[RaspbianBugs - Raspbian](http://www.raspbian.org/RaspbianBugs)"

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [22 December 2024 19:17 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108/5 "2024-12-22T19:17:40Z")

</div>

Node RED's UI uses express - its not a fully fledged web server, and its not "installed"  
Node RED its self is hosting the "web server" via express.

> **[Express - Node.js web application framework](https://expressjs.com)**
>
> Express is a fast, unopinionated, minimalist web framework for Node.js, providing a robust set of features for web and mobile applications.

As for the error.  
Its complaining that the **optional chaining** operator is not recognised.

**optional chaining** was added in node version 14 (I think) - so it would appear you are using an old version of Node? -do you use a Node version manager like `nvm`?

Have you made any changes to the Node Version?

`node -v`

---

<div class="post-metadata">

### Author: ![JasGot](https://avatars.discourse-cdn.com/v4/letter/j/c4cdca/32.png) [@JasGot](https://discourse.nodered.org/u/JasGot)
#### Post date: [22 December 2024 19:48 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108/6 "2024-12-22T19:48:42Z")

</div>

I may have. I tried updating everything, Thinking I would get lucky.

```auto
pi@garagedoor:/home $ node -v
v12.22.12
pi@garagedoor:/home $

```

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [22 December 2024 19:50 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108/7 "2024-12-22T19:50:02Z")

</div>

That is indeed too old for Node RED.  
The latest version on Node RED requires 20.x

---

<div class="post-metadata">

### Author: ![JasGot](https://avatars.discourse-cdn.com/v4/letter/j/c4cdca/32.png) [@JasGot](https://discourse.nodered.org/u/JasGot)
#### Post date: [22 December 2024 19:50 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108/8 "2024-12-22T19:50:40Z")

</div>

This may be helpful.....  
Looks like nodered.service is stuck on activating.

```auto
UNIT LOAD ACTIVE >
  alsa-restore.service loaded active >
  avahi-daemon.service loaded active >
  console-setup.service loaded active >
  cron.service loaded active >
  dbus.service loaded active >
  dhcpcd.service loaded active >
  dphys-swapfile.service loaded active >
  fake-hwclock.service loaded active >
  getty@tty1.service loaded active >
  ifupdown-pre.service loaded active >
  keyboard-setup.service loaded active >
  kmod-static-nodes.service loaded active >
  networking.service loaded active >
  nodered.service loaded activating>
  polkit.service loaded active >
  raspi-config.service loaded active >
  rc-local.service loaded active >
  rng-tools-debian.service loaded active >
  rpi-eeprom-update.service loaded active >
  rsyslog.service loaded active >
  serial-getty@ttyAMA0.service loaded active >
  ssh.service loaded active

```

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [22 December 2024 19:54 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108/9 "2024-12-22T19:54:26Z")

</div>

My current advise will be to update to at least Node 20, and reboot.  
I wouldn't use Node Version managers (if of course you are) - they can be problematic.

You may need to re-install your Node Modules, but isn't that big of a step - its pretty easy to do via command line - it uses your package file, in `~/.node-red` as some modules are compiled against the Node Version

---

<div class="post-metadata">

### Author: ![JasGot](https://avatars.discourse-cdn.com/v4/letter/j/c4cdca/32.png) [@JasGot](https://discourse.nodered.org/u/JasGot)
#### Post date: [22 December 2024 20:06 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108/10 "2024-12-22T20:06:29Z")

</div>

Working through this now.

---

<div class="post-metadata">

### Author: ![JasGot](https://avatars.discourse-cdn.com/v4/letter/j/c4cdca/32.png) [@JasGot](https://discourse.nodered.org/u/JasGot)
#### Post date: [22 December 2024 20:07 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108/11 "2024-12-22T20:07:30Z")

</div>

You mean NodeJS, to version 20, right?

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [22 December 2024 20:12 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108/12 "2024-12-22T20:12:41Z")

</div>

Yup - NodeJS 20+  
Restart the Pi after.

run `node -v` after to confirm the version, then in theory Node RED should sprint back to life.  
providing no funky `nvm` magic gets in the way

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [22 December 2024 20:22 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108/13 "2024-12-22T20:22:48Z")

</div>

Run `which node` and see if it is picking up nodejs from a `.nvm` folder. If it is then delete that folder and uninstall nvm. Then re-run the install script (see below) to install nodejs 20

Otherwise, did you use the [recommended script](https://nodered.org/docs/getting-started/raspberrypi) to install/update node-red? If not, then run that script, with `--node20` on the end to update node red and install nodejs 20.

---

<div class="post-metadata">

### Author: ![JasGot](https://avatars.discourse-cdn.com/v4/letter/j/c4cdca/32.png) [@JasGot](https://discourse.nodered.org/u/JasGot)
#### Post date: [22 December 2024 20:43 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108/14 "2024-12-22T20:43:43Z")

</div>

```auto
pi@garagedoor:/home $ which node
/usr/bin/node
pi@garagedoor:/home $

```

---

<div class="post-metadata">

### Author: ![JasGot](https://avatars.discourse-cdn.com/v4/letter/j/c4cdca/32.png) [@JasGot](https://discourse.nodered.org/u/JasGot)
#### Post date: [22 December 2024 20:46 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108/15 "2024-12-22T20:46:06Z")

</div>

I think the installer running now is putting it in a .nvm folder ☹

```auto
pi@garagedoor:~ $ nvm install 20
Downloading and installing node v20.18.1...
Downloading https://nodejs.org/dist/v20.18.1/node-v20.18.1-linux-armv6l.tar.xz.. .
curl: (22) The requested URL returned error: 404

download from https://nodejs.org/dist/v20.18.1/node-v20.18.1-linux-armv6l.tar.xz failed
grep: /home/pi/.nvm/.cache/bin/node-v20.18.1-linux-armv6l/node-v20.18.1-linux-ar mv6l.tar.xz: No such file or directory
Provided file to checksum does not exist.
Binary download failed, trying source.
Detected that you have 1 CPU core(s)
Number of CPU core(s) less than or equal to 2, running in single-threaded mode
Additional options while compiling: --without-snapshot
Downloading https://nodejs.org/dist/v20.18.1/node-v20.18.1.tar.xz...
######################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!

```

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [22 December 2024 21:41 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108/16 "2024-12-22T21:41:35Z")

</div>

> [@JasGot](#):
>
> I think the installer running now is putting it in a .nvm folder ☹
> 
> ```auto
> pi@garagedoor:~ $ nvm install 20
> 
> ```

You were supposed to be uninstalling nvm and deleting the .nvm folder if it existed.

> [@JasGot](#):
>
> ```auto
> pi@garagedoor:/home $ which node
> /usr/bin/node
> 
> ```

So it was (before you used nvm) running nodejs from the correct place. My suggestion was to run the node red install script, but instead you ran nvm. I think you are not reading the posts carefully enough.

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [22 December 2024 22:12 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108/17 "2024-12-22T22:12:24Z")

</div>

> [@JasGot](#):
>
> I have a Raspberry-Pi

> [@JasGot](#):
>
> ```auto
> pi@garagedoor:~ $ nvm install 20
> ...
> Detected that you have 1 CPU core(s)
> 
> ```

What model Raspberry Pi do you have?  
`cat /sys/firmware/devicetree/base/model`  
What operating system does it run?  
`grep PRETTY_NAME /etc/os-release`

---

<div class="post-metadata">

### Author: ![JasGot](https://avatars.discourse-cdn.com/v4/letter/j/c4cdca/32.png) [@JasGot](https://discourse.nodered.org/u/JasGot)
#### Post date: [23 December 2024 03:21 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108/18 "2024-12-23T03:21:06Z")

</div>

It's not that I can't read carefully. I started installing Node 20 from the only method I know how after I read [marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies) post.

Is it advisable to uninstall and runt the script you linked to?

---

<div class="post-metadata">

### Author: ![JasGot](https://avatars.discourse-cdn.com/v4/letter/j/c4cdca/32.png) [@JasGot](https://discourse.nodered.org/u/JasGot)
#### Post date: [23 December 2024 03:46 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108/19 "2024-12-23T03:46:25Z")

</div>

> [@jbudd](#):
>
> cat /sys/firmware/devicetree/base/model

Raspberry Pi Model B Plus Rev 1.2  
PRETTY\_NAME="Raspbian GNU/Linux 11 (bullseye)"

---

<div class="post-metadata">

### Author: ![JasGot](https://avatars.discourse-cdn.com/v4/letter/j/c4cdca/32.png) [@JasGot](https://discourse.nodered.org/u/JasGot)
#### Post date: [23 December 2024 03:47 UTC](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108/20 "2024-12-23T03:47:49Z")

</div>

I've uninstalled NVM and renamed the .nvm folder

The script from your comment above is running now. all green hearts so far.

[Next page](https://discourse.nodered.org/t/node-red-to-manage-garage-door-and-send-sms-stopped-sending-sms/94108.md?page=2)
