Errors loading modbus nodes on RevPi

#1

Since my company considers using the Revolution Pi Connect in the future, I tried deploying our current flow on this hardware.

I've set up Node-RED by following the steps outlined in the installation guide, then loaded our project (after adjusting the settings file accordingly, of course) and installed the dependencies following Node-RED's complaints. Among these dependencies is the Modbus package, which installs, but keeps some nodes, notably flex-getters (which are used, among others, in our flow) disabled. I get some warnings displayed in the browser, but the node-red-log seems clean.

Running my browser from a terminal, I get the following:

** Message: console message: http://localhost:1880/red/red.min.js @16: Node-RED: 0.20.5
** Message: console message: http://localhost:1880/red/red.min.js @16: [node-red-contrib-modbus/Modbus-Client] SyntaxError: Unexpected identifier 'node'
** Message: console message: http://localhost:1880/red/red.min.js @16: [node-red-contrib-modbus/Modbus-Read] SyntaxError: Unexpected identifier 'nodeLabel'
** Message: console message: http://localhost:1880/red/red.min.js @16: [node-red-contrib-modbus/Modbus-Getter] SyntaxError: Unexpected identifier 'tabs'
** Message: console message: http://localhost:1880/red/red.min.js @16: [node-red-contrib-modbus/Modbus-Flex-Getter] SyntaxError: Unexpected identifier 'tabs'
** Message: console message: http://localhost:1880/red/red.min.js @16: [node-red-contrib-modbus/Modbus-Write] SyntaxError: Unexpected identifier 'previous'
** Message: console message: http://localhost:1880/red/red.min.js @16: [node-red-contrib-modbus/Modbus-Flex-Server] SyntaxError: Unexpected identifier 'node'
** Message: console message: http://localhost:1880/red/red.min.js @16: [node-red-contrib-modbus/Modbus-Response-Filter] SyntaxError: Unexpected identifier 'node'
** Message: console message: http://localhost:1880/red/red.min.js @16: [node-red-contrib-play-audio/play-audio] SyntaxError: Unexpected token ')'

which matches with the warnings that get shown in the Node-RED UI. I did not get these on a regular Raspberry Pi and a Windows machine.

Any clue what the problem could be here? Could it have to do with the RevPi using a modified Raspian version with RT kernel? Or is it perhaps only a browser problem (I'm ssh-ing into the machine and inspect the flow locally in Epiphany, because at the moment there are no other browsers installed)?

0 Likes

#2

Hm, seems to be a problem with Epiphany's JavaScript engine indeed. All works fine if I use Firefox (except Firefox itself, because its hunger for resources is apparently too much for the RevPi...)

0 Likes

#3

can you not point a browser from (say) a laptop at it instead ? no need to ssh in ... so the browser is then running on a more capable device.

0 Likes

#4

That's what I would like to do, but is (at least to my knowledge) unfortunately not compatible with OAuth callbacks (I use passport-gitlab for authentication on the system) unless every device running Node-RED eventually has its own URL which would also need to be known (i.e. most likely hard-coded somewhere) to the system whenever Node-RED is started - so that it can be filled in when the settings.js are read. Not to mention that this would also require a potentially very large URL whitelist on the Gitlab side of things for the callback mechanism.
Because we don't have URLs for all our individual devices, the only short-term feasible solution I could come up with was to set the callbacks to localhost:1880, but that then requires also the browser to be executed on the device, because localhost would otherwise not be the machine to which routing needs to go back after authentication.

0 Likes