BiancoRoyal/node-red-contrib-modbus

Modbus Flex FC - Loading Codes Issue

innoagg opened this issue · 6 comments

Which node-red-contrib-modbus version are you using?

5.30.0

What happened?

Trying to use the Modbus Flex FC node. I want to define my own map file and load it into the UI. I am not having success. The drop down never populates.

Server

None/This is related to a node that doesn't connect to a server

How can this be reproduced?

Ensure a codes.json file exists in the search path defined in the node:

image

A valid file exists but the function code selection does not populate.

What did you expect to happen?

No response

Other Information

No response

@grewek can you check that for us?

See the post below this one :)

Hi,

here is a little workaround for the issue, i will of course fix the issue as soon as i can. You can put the file inside the current working directory (cwd) of NODE-Red (the place where you started Node-Red). The issue is that we don't have access to the filesystem only to files that are under the cwd as far as i know.

So for example

#Create a example directory where we will start node-red
$ mkdir node-red-cwd
#Get into that directory with cd
$ cd node-red-cwd
#Create a customMaps folder where we will put our codes.json file
$ mkdir customMaps
#Copy the file over into the customMaps directory
$ cp some_custom_codes.json customMaps/codes.json
#Run node-red, the executable has now access to the customMaps folder
$ node-red

You can then access the file by putting an relative path into the path textbox of the node:
./customMaps

You can also put the file directly into the cwd then a . is sufficient for the path textbox

Hope that helps for now.

Thanks for the above. I did try this with no success. Permissions are correct. Perhaps some UI feedback when you are able to push a fix so we can see what errors are raised if any.