# GPSD appears to prevent system from loading

**URL:** <https://discourse.nodered.org/t/gpsd-appears-to-prevent-system-from-loading/45726>\
**Category:** General\
**Created:** [16 May 2021 16:09 UTC](https://discourse.nodered.org/t/gpsd-appears-to-prevent-system-from-loading/45726 "2021-05-16T16:09:15Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![NPT](https://avatars.discourse-cdn.com/v4/letter/n/9de053/32.png) [@NPT](https://discourse.nodered.org/u/NPT)\
**Post date:** [16 May 2021 16:09 UTC](https://discourse.nodered.org/t/gpsd-appears-to-prevent-system-from-loading/45726/1 "2021-05-16T16:09:15Z")

</div>

Hi,

I am fairly new to Pi despite years of Windows programming and after my first fairly intense day with the totally brilliant Node-RED, am marvelling at its usefulness.

Using Palette, I installed GPSD into a very successful flow and it appears to have messed up everything. Starting up Node-Red I get......

_16 May 16:44:53 - [info] Starting flows_  
_16 May 16:44:53 - [info] [gpsd:edcf736f.9623e8] Registering "tpv" event_  
_16 May 16:44:53 - [info] Started flows_  
_16 May 16:44:53 - [red] Uncaught Exception:_  
_16 May 16:44:53 - TypeError: Cannot read property 'log' of undefined_

- at log\_helper (/usr/lib/node\_modules/node-red/node\_modules/@node-red/runtime/lib/nodes/Node.js:496:16)\*
- at Object.Node.error (/usr/lib/node\_modules/node-red/node\_modules/@node-red/runtime/lib/nodes/Node.js:524:9)\*
- at Socket. (/home/pi/.node-red/node\_modules/node-gpsd/lib/gpsd.js:72:25)\*
- at Socket.emit (events.js:376:20)\*
- at emitErrorNT (internal/streams/destroy.js:106:8)\*
- at emitErrorCloseNT (internal/streams/destroy.js:74:3)\*
- at processTicksAndRejections (internal/process/task\_queues.js:82:21)\*  
_nodered.service: Main process exited, code=exited, status=1/FAILURE_  
_nodered.service: Failed with result 'exit-code'._

Can anyone please advise as to how I can remove GPSD from the system? Is there an editable file listing all the additional nodes introduced so I can stop the system looking for GPSD?

I really would like to keep the flow which I have created so far.

Many thanks for reading this - all guidance gratefully received!

---

<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:** [16 May 2021 16:23 UTC](https://discourse.nodered.org/t/gpsd-appears-to-prevent-system-from-loading/45726/2 "2021-05-16T16:23:57Z")

</div>

Welcome to the forum @NPT

If you start node-red in a terminal using the command  
`node-red --safe`  
then it will start it in safe mode without starting the flows. Then you should be able to do what you want. If node-red still crashes straight away then you will have to remove it from the command line. In that case tell us what you installed and exactly how.

---

<div class="post-metadata">

**Author:** ![NPT](https://avatars.discourse-cdn.com/v4/letter/n/9de053/32.png) [@NPT](https://discourse.nodered.org/u/NPT)\
**Post date:** [16 May 2021 16:48 UTC](https://discourse.nodered.org/t/gpsd-appears-to-prevent-system-from-loading/45726/3 "2021-05-16T16:48:21Z")

</div>

Hi Colin,

Many thanks for the speedy response!

Brilliant success with _Safe Mode_ and I was able to disable and remove the suspect GPSD node.

I shall experiment with it in a new flow. So much to learn and such little............

Cheers,

NPT

---

<div class="post-metadata">

**Author:** ![dvitrano](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@dvitrano](https://discourse.nodered.org/u/dvitrano)\
**Post date:** [28 May 2021 21:41 UTC](https://discourse.nodered.org/t/gpsd-appears-to-prevent-system-from-loading/45726/4 "2021-05-28T21:41:44Z")

</div>

Hi there - same issue here as well. An alternative workaround is also to navigate to  
"cd /home/pi/.node-red/"  
and restore the previous flow from backup  
"mv .flows\_raspberrypi.json.backup flows\_raspberrypi.json"

It is however a bit frustrating that only adding the gpsd node is breaking everything, regardless if it is added on a separate flow or in the main or whatever..  
Checking gpsd from outside node-red with gpsmon or cgps shows good looking data and 3D fix.

Any idea?

---

<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:** [29 May 2021 07:45 UTC](https://discourse.nodered.org/t/gpsd-appears-to-prevent-system-from-loading/45726/5 "2021-05-29T07:45:48Z")

</div>

Which node are you using? Possibly node-red-contrib-something.

---

<div class="post-metadata">

**Author:** ![dvitrano](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@dvitrano](https://discourse.nodered.org/u/dvitrano)\
**Post date:** [29 May 2021 08:22 UTC](https://discourse.nodered.org/t/gpsd-appears-to-prevent-system-from-loading/45726/6 "2021-05-29T08:22:41Z")

</div>

Hei Colin,  
I'm using node-red-contrib-gpsd  
not sure if there is anything better?

---

<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:** [29 May 2021 08:35 UTC](https://discourse.nodered.org/t/gpsd-appears-to-prevent-system-from-loading/45726/7 "2021-05-29T08:35:43Z")

</div>

> [@dvitrano](#):
>
> node-red-contrib-gpsd

It seems an [issue has been raised](https://github.com/damoclark/node-red-contrib-gpsd/issues/4) against the node for this problem, but it has not been addressed. The other two issues there have been open for more than a year and have also not been addressed so it seems the node is no longer supported. I don't know about alternatives.

---

<div class="post-metadata">

**Author:** ![dvitrano](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@dvitrano](https://discourse.nodered.org/u/dvitrano)\
**Post date:** [29 May 2021 09:16 UTC](https://discourse.nodered.org/t/gpsd-appears-to-prevent-system-from-loading/45726/8 "2021-05-29T09:16:12Z")

</div>

Thanks a lot Colin – I’ve tried logging a similar question into the Slack channel.

I’ll keep this issue posted If I get something out of it.

Domenico

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [29 May 2021 17:35 UTC](https://discourse.nodered.org/t/gpsd-appears-to-prevent-system-from-loading/45726/9 "2021-05-29T17:35:06Z")

</div>

While I've not tested this as I don't have my GPS setup at the moment the quick fix will be to comment out lines 55-59 of gpsd.js in the node-red-contrib-gpsd node.

I'll try and find time over the weekend to fix it properly and submit a PR to the node owner, but since it's not been touched in 5 years I'm not confident

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [29 May 2021 22:03 UTC](https://discourse.nodered.org/t/gpsd-appears-to-prevent-system-from-loading/45726/10 "2021-05-29T22:03:17Z")

</div>

Pull request submitted [Fix to work with Node-RED 1.3.x by hardillb · Pull Request #5 · damoclark/node-red-contrib-gpsd · GitHub](https://github.com/damoclark/node-red-contrib-gpsd/pull/5)

in the mean time you can install my fixed fork with

```auto
npm install hardillb/node-red-contrib-gpsd

```

Run that in your userDir (e.g. `~/.node-red`)

---

<div class="post-metadata">

**Author:** ![vikebo](https://avatars.discourse-cdn.com/v4/letter/v/6de8d8/32.png) [@vikebo](https://discourse.nodered.org/u/vikebo)\
**Post date:** [17 June 2021 15:46 UTC](https://discourse.nodered.org/t/gpsd-appears-to-prevent-system-from-loading/45726/11 "2021-06-17T15:46:23Z")

</div>

Also new to Node-Red, but have a project where I think it can be a good solution.  
Initially installed on RaspberryPi as included package and had the "gpsd example flow" from here working: [node-red-contrib-gpsd (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-gpsd) with gpsd installed from the palette.

Had problems getting a non-official 7" touch screen working (touch part of it) and updated the system which is now reported as Linux raspberrypi 5.10.17-v7+ #1421 SMP Thu May 27 13:59:01 BST 2021 armv7l GNU/Linux. The touch screen problem was power related and now sorted.

However, after the update I got the _TypeError: Cannot read property 'log' of undefined_ problem mentioned above.  
I've now uninstalled Node-Red and re-installed using the script here: [Running on Raspberry Pi : Node-RED](https://nodered.org/docs/getting-started/raspberrypi), the menu says v1.2.9. Also tried to install the fixed fork above, node-red-contrib-gpsd is 1.0.2 in palette.  
I now get a new error when I deploy the example flow mentioned above:  
17 Jun 17:36:01 - [info] Started flows  
17 Jun 17:36:01 - [info] [gpsd:Adafruit Ultimate GPS] Socket connected.  
17 Jun 17:36:01 - [info] [gpsd:Adafruit Ultimate GPS] Connected to gpsd  
17 Jun 17:36:01 - [red] Uncaught Exception:  
17 Jun 17:36:01 - ReferenceError: listener is not defined  
at /home/pi/.node-red/node\_modules/node-red-contrib-gpsd/gpsd/gpsd.js:188:4  
at Socket. (/home/pi/.node-red/node\_modules/node-gpsd/lib/gpsd.js:125:11)  
at Object.onceWrapper (events.js:481:28)  
at Socket.emit (events.js:387:35)  
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1134:10)

Not sure where to start troubleshooting. The fix from hardillb mentions Node-Red \>=1.3.0 and I have 1.2.9, the fix should also be 1.0.3 and not 1.0.2. Not sure to update Node-Red to a newer version, if the fix was really updated, or if it doesn't apply for 1.2.9.

Any ideas for the best way of solving this?

Thanks,  
Eivind

---

<div class="post-metadata">

**Author:** ![vikebo](https://avatars.discourse-cdn.com/v4/letter/v/6de8d8/32.png) [@vikebo](https://discourse.nodered.org/u/vikebo)\
**Post date:** [17 June 2021 18:08 UTC](https://discourse.nodered.org/t/gpsd-appears-to-prevent-system-from-loading/45726/12 "2021-06-17T18:08:57Z")

</div>

On starting after trying another update using the script I noticed tha v1.3.5 is actually installed. Not sure what v1.2.9 in the menu is.

7 Jun 20:03:54 - [info] Node-RED version: v1.3.5  
17 Jun 20:03:54 - [info] Node.js version: v14.17.1  
17 Jun 20:03:54 - [info] Linux 5.10.17-v7+ arm LE  
17 Jun 20:03:55 - [info] Loading palette nodes  
17 Jun 20:03:58 - [info] Worldmap version 2.15.0  
17 Jun 20:03:59 - [info] Dashboard version 2.29.1 started at /ui  
17 Jun 20:03:59 - [info] Settings file : /home/pi/.node-red/settings.js  
17 Jun 20:03:59 - [info] Context store : 'default' [module=memory]  
17 Jun 20:03:59 - [info] User directory : /home/pi/.node-red  
17 Jun 20:03:59 - [warn] Projects disabled : editorTheme.projects.enabled=false  
17 Jun 20:03:59 - [info] Flows file : /home/pi/.node-red/flows\_raspberrypi.json  
17 Jun 20:03:59 - [info] Server now running at [http://127.0.0.1:1880/](http://127.0.0.1:1880/)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [17 June 2021 23:29 UTC](https://discourse.nodered.org/t/gpsd-appears-to-prevent-system-from-loading/45726/13 "2021-06-17T23:29:28Z")

</div>

You are now running the latest non v2 of node-red. @hardillb fix should work on this release. From your last post, it looks like node-red is running, have you installed the node from his library? Is it still a problem?

---

<div class="post-metadata">

**Author:** ![vikebo](https://avatars.discourse-cdn.com/v4/letter/v/6de8d8/32.png) [@vikebo](https://discourse.nodered.org/u/vikebo)\
**Post date:** [18 June 2021 06:10 UTC](https://discourse.nodered.org/t/gpsd-appears-to-prevent-system-from-loading/45726/14 "2021-06-18T06:10:15Z")

</div>

Thank you for your reply.  
After a reboot of both the pi (and laptop where I see/operate the dashboard) I now have v1.3.5 in the Node-red menu and 1.0.3 in palette for node-red-contrib-gpsd. Not sure why, did several reboots of the pi earlier and don't think the laptop should matter.

Anyway, still have the same ReferenceError. May not be related to the initial TypeError and fix in this thread, but still related to gpsd. Will it be better to move this to a separate thread?

18 Jun 08:00:04 - [info] Starting flows  
18 Jun 08:00:04 - [info] [gpsd:Adafruit Ultimate GPS] Registering "tpv" event  
18 Jun 08:00:04 - [info] [gpsd:Adafruit Ultimate GPS] Registering "sky" event  
18 Jun 08:00:04 - [info] [gpsd:Adafruit Ultimate GPS] Registering "device" event  
18 Jun 08:00:04 - [info] Started flows  
18 Jun 08:00:04 - [info] [gpsd:Adafruit Ultimate GPS] Socket connected.  
18 Jun 08:00:04 - [info] [gpsd:Adafruit Ultimate GPS] Connected to gpsd  
18 Jun 08:00:04 - [red] Uncaught Exception:  
18 Jun 08:00:04 - ReferenceError: listener is not defined  
at /home/pi/.node-red/node\_modules/node-red-contrib-gpsd/gpsd/gpsd.js:188:4  
at Socket. (/home/pi/.node-red/node\_modules/node-gpsd/lib/gpsd.js:125:11)  
at Object.onceWrapper (events.js:481:28)  
at Socket.emit (events.js:387:35)  
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1134:10)

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [18 June 2021 06:14 UTC](https://discourse.nodered.org/t/gpsd-appears-to-prevent-system-from-loading/45726/15 "2021-06-18T06:14:24Z")

</div>

Edit line 188 of /home/pi/.node-red/node\_modules/node-red-contrib-gpsd/gpsd/gpsd.js to add `node.` before `listener.watch();`

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [18 June 2021 06:16 UTC](https://discourse.nodered.org/t/gpsd-appears-to-prevent-system-from-loading/45726/16 "2021-06-18T06:16:35Z")

</div>

This has already been fixed and published as 1.0.4

> <https://github.com/damoclark/node-red-contrib-gpsd/commit/4c5c64f743c51b6274f81153dd118d6ea6e1f063>

---

<div class="post-metadata">

**Author:** ![vikebo](https://avatars.discourse-cdn.com/v4/letter/v/6de8d8/32.png) [@vikebo](https://discourse.nodered.org/u/vikebo)\
**Post date:** [18 June 2021 07:20 UTC](https://discourse.nodered.org/t/gpsd-appears-to-prevent-system-from-loading/45726/17 "2021-06-18T07:20:23Z")

</div>

Thank you!  
Adding node. to the file made it work again.

I'll look into upgrading to 1.0.4 as well.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [17 August 2021 07:20 UTC](https://discourse.nodered.org/t/gpsd-appears-to-prevent-system-from-loading/45726/18 "2021-08-17T07:20:43Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
