Context not working for name

It caught me for a while then I remembered the device name is set in the settings.js file.

So, when I look at my `context on a new machine I see this:

Screenshot from 2020-08-05 11-08-31

I'm confused.

This is what the settings.js file looks like:

Why isn't myDeviceName seen in the context?

NR 1.1.2

Stopping and starting Node-Red I see this:

To find more nodes and example flows - go to http://flows.nodered.org
 
Starting as a systemd service.
5 Aug 11:18:14 - [info]
Welcome to Node-RED
===================
5 Aug 11:18:14 - [info] Node-RED version: v1.1.2
5 Aug 11:18:14 - [info] Node.js  version: v10.22.0
5 Aug 11:18:14 - [info] Linux 4.19.118+ arm LE
5 Aug 11:18:24 - [info] Loading palette nodes
5 Aug 11:18:56 - [info] Dashboard version 2.23.0 started at /ui
5 Aug 11:18:59 - [info] Settings file  : /home/pi/.node-red/settings.js
5 Aug 11:18:59 - [info] HTTP Static    : /home/pi/.node-red/public
5 Aug 11:18:59 - [info] Context store  : 'default' [module=memory]
5 Aug 11:18:59 - [info] User directory : /home/pi/.node-red
5 Aug 11:18:59 - [warn] Projects disabled : editorTheme.projects.enabled=false
5 Aug 11:18:59 - [info] Flows file     : /home/pi/.node-red/flows_LCDPi.json
5 Aug 11:19:01 - [info] Server now running at http://127.0.0.1:1880/
5 Aug 11:19:01 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
5 Aug 11:19:02 - [info] Starting flows
5 Aug 11:19:06 - [info] Started flows
5 Aug 11:19:06 - [info] [mqtt-broker:MQTT host] Connected to broker: mqtt://192.168.0.99:1883
5 Aug 11:19:08 - [warn] [function:Variable repeat time] Value set
5 Aug 11:19:10 - [error] [gate:7fcdf90.f234588] Invalid command

The last line is work in progress. But nothing to indicate it is not happy with the name.

EDIT: Sorry, forget, I think my example is not relevant to yours

All visible here for me. Doesn't help but just to verify they should


Read the section underneath the part you marked with the red triangle.

// global.keys() returns a list of all properties set in global context.
// This allows them to be displayed in the Context Sidebar within the editor.
// In some circumstances it is not desirable to expose them to the editor. The
// following property can be used to hide any property set in functionGlobalContext
// from being list by global.keys().
// By default, the property is set to false to avoid accidental exposure of
// their values. Setting this to true will cause the keys to be listed.
exportGlobalContextKeys: false,

Change exportGlobalContextKeys to true.

See also the discussion here

1 Like

I'm guessing this was introduced in a recent update.

Yeah, RTFM.

Thanks.

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