w4tsn / node-red-contrib-modbus-api

An API like node-red implementation of the modbus-serial package.
BSD 3-Clause "New" or "Revised" License
7 stars 3 forks source link

Modbus server host field reporting a fault #20

Open SteffenWG opened 2 years ago

SteffenWG commented 2 years ago

Fault After updating nodejs and node-red the "modubs in" node has started to complain. The Modbus Server field is marked red. When entering edit modbus server panel the field Host :Port is red. Data entered in the field is 0.0.0.0 and the port field is 1502. When hovering with the pointer I get: "host: validation error: modbus server, [some node id]: o.test is not a function"

The node works though. I can read modbus registers and such. Just a bug.

nodejs -v: 18.9.0 node-red: 3.0.2 node-red-contrib-modbus-api: V0.3.0

gemini86 commented 2 years ago

https://github.com/w4tsn/node-red-contrib-modbus-api/blob/77f3efc848ba8866b63d302ec22f78037d715d74/src/nodes/modbusServer.html#L5

This looks to be the source of the error although I do not know how to fix the validation, if it's in the RED.validators function or if it's simply a regex mistake. I don't mess with regex 🤪

SteffenWG commented 2 years ago

It looks like it is a problem with the regex function. So I removed the validate param and restarted node-red. No more errors.

gemini86 commented 2 years ago

I've tried to update the regex expression to some newer examples with no luck.

w4tsn commented 2 years ago

Thanks for reporting this. I'll look into it in the next couple o days

AdrienAdB commented 10 months ago

Hi @w4tsn, pull request created: https://github.com/w4tsn/node-red-contrib-modbus-api/pull/27