[node-red-contrib-freemaster/PCM] Error: Cannot find module 'freemaster-client'

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

[node-red-contrib-freemaster/PCM] Error: Cannot find module 'freemaster-client'

2,100件の閲覧回数
EmbeddedExpert
Contributor II

Hi,

I wanted to add the FreeMaster components to node-red.

Therefore I extracted the two packages in the FreeMaster folder to different folders.

C:\NXP\FreeMASTER 3.1\FreeMASTER NodeJS Modules

extracted in:

package_client

package_contrib

and called installation command in a power shell as administrator.

npm install "C:\NXP\FreeMASTER 3.1\FreeMASTER NodeJS Modules\package_client"

npm install "C:\NXP\FreeMASTER 3.1\FreeMASTER NodeJS Modules\package_contrib"

seems to work but when I start the node red I get this failure message:

> node-red

...

25 Feb 12:26:43 - [info] Node-RED version: v2.2.2
25 Feb 12:26:43 - [info] Node.js version: v16.14.0
25 Feb 12:26:43 - [info] Windows_NT 10.0.18363 x64 LE
25 Feb 12:26:44 - [info] Loading palette nodes
25 Feb 12:26:45 - [warn] ------------------------------------------------------
25 Feb 12:26:45 - [warn] [node-red-contrib-freemaster/PCM] Error: Cannot find module 'freemaster-client'
Require stack:
- C:\NXP\FreeMASTER 3.1\FreeMASTER NodeJS Modules\package_contrib\nodes\01.01-PCM.js

...

25 Feb 12:26:45 - [info] Waiting for missing types to be registered:
25 Feb 12:26:45 - [info] - pcm

What is wrong?

By the way, it seems that the FreeMaster Light can connect via PCM (with started node) but FreeMaster fails because of missing PCM (with started / connected FreeMaster)

Regards

0 件の賞賛
返信
3 返答(返信)

2,069件の閲覧回数
EmbeddedExpert
Contributor II

Hi Iulian,

Seems to work better with the archives.

I was important to give the full file name.

npm install 'C:\NXP\FreeMASTER 3.1\FreeMASTER NodeJS Modules\node-red-contrib-freemaster-1.1.1.tgz'

Now the question is how the Running Freemaster application can connect with the PCM?

If the FreeMaster Application is running and connected to the board and the Node is started how does the Node know where to get the data from?

Any specific port or where is the setting?

Regards

0 件の賞賛
返信

2,061件の閲覧回数
iulian_stan
NXP Employee
NXP Employee

Hi Bernd,

In your case:

  • FreeMASTER/FreeMASTER Lite is a simple executor, once it is started it is basically ready to mediate the communication between a client (such as Node-RED) and the target board.
  • Node-RED (or to be precise your flow containing FreeMASTER nodes) is the client. Client has no knowledge about the target, it just delegates the commands to the executor and expects a response.

How the client connects to the executor - You need to specify service URL in the PCM node. The port number in case of FreeMASTER is 41000 (this is the default one, more details in User Guide in case you need to change it), in case of FreeMASTER Lite is the same as `port` property specified in the configuration file (default 8090).

Next step, not sure if that was part of your question, but just in case - how does the executor know about the target. In case of FreeMASTER you use the GUI to configure and connect to the board. And in case of FreeMASTER Lite you need to send the Connect command via the `StartComm` node and specify the connection friendly name specified in the configuration file.

Hope it helps,
Iulian

0 件の賞賛
返信

2,091件の閲覧回数
iulian_stan
NXP Employee
NXP Employee

Hi Bernd,

Please try installing the packages as archives. You don't need to unzip the packages. `node-red-contrib-freemaster` installs `freemaster-client` as dependency and expects the corresponding archive to be located next to it.

It's indeed ambiguous, we will update installation instruction for npm modules in the next release.

The `PCM` object is declared inside `freemaster-client` and seems to be not found as it failed to pull the dependency when `node-red-contrib-freemaster` was installed.

Regards,
Iulian 

0 件の賞賛
返信