Page 3 of 3

Re: Phidget22 Node-RED Module Released

Posted: Mon Mar 07, 2022 5:42 am
by lingvo
Hello

I started to get strange problem in Nodered Phidget Module with HUB5000+ADP1000 Adapter:
At some point VoltageInput Node starts to output

Code: Select all

{"code":4105,"description":"Saturation Detected."}
while in +-2V Mode (ORP Electrode connected)
The VoltageInput node settings are:
ORP.png
If I then go to Phydgets control panel in Web - it shows +-400mV range even if I didn't change it anywhere!
ORP2.png
If I manually change range to +-2V it starts working again and also in Node-RED - till next time.
ORP3.png
ORP3.png (56.2 KiB) Viewed 38182 times
What goes wrong here? Does HUB5000 reset itself and changes the range? How to make it always select +-2V range in Node-RED?

Re: Phidget22 Node-RED Module Released

Posted: Mon Mar 07, 2022 12:31 pm
by mparadis
Hi Lingvo,

I tried to change the voltage range on the ADP1000 on my computer and had no issues- in fact, I can open the web control panel window while the flow is running and see the voltage range change from 400mV to 2V and back again when I change the node configuration and restart the flow.

The default option for voltage range on the ADP1000 is 400mV, so any time you newly open the channel it will default to that. But as long as 2V is selected in your VoltageInput node, it will change the range to 2V when your flow starts. If you stop node-red and open it in the control panel, it will re-open the channel and it'll be back to the 400mV default again.

On an unrelated note, you can keep the SensorType configuration to "VOLTAGE", because the "PN_1130_ORP" setting is only for the 1130 pH/ORP sensor. (This isn't causing any problems in your code, just creates an additional error when the flow starts since you can't set SensorType on this device)

Re: Phidget22 Node-RED Module Released

Posted: Tue Mar 08, 2022 12:38 am
by lingvo
Hi mparadis
Thanks for quick reply.

In my case changing the Voltage Range in VoltageInput Node and restarting the flow doesn't have any effect for some reason. But I remember it did work at start when I was making the flow. I did FW upgrade of HUB5000 couple of times since then. Any ways to debug this?

I also tried to set voltage range manually by injecting topic

Code: Select all

setVoltageRange 
with Payload

Code: Select all

{"voltageRange":7}
into VoltageInput node.

But while this was working before, now it generates an error:

Code: Select all

setVoltageRange failed:PhidgetError: Device not Attached
Perhaps this has something to do with my problem?

Currently this range resetting happens almost every day and is very annoying.

Re: Phidget22 Node-RED Module Released

Posted: Wed Mar 09, 2022 1:03 pm
by mparadis
If you're getting a "device not attached" error when trying to send a message in, the channel must have detached at some point, or it never attached to begin with. If you click on the "debug messages" box in the VoltageInput configuration, you should see a message "VoltageInput Opened" when you start the flow, if it successfully opens. If you get "Open failed:PhidgetError: Open Timed out" then it probably means the channel is being held by another program. Sometimes I've found that node-red itself can somehow lock up a channel at which point terminating the node-red process and restarting it can sometimes help.

Re: Phidget22 Node-RED Module Released

Posted: Mon Mar 21, 2022 6:09 am
by lingvo
mparadis wrote: If you get "Open failed:PhidgetError: Open Timed out" then it probably means the channel is being held by another program. Sometimes I've found that node-red itself can somehow lock up a channel at which point terminating the node-red process and restarting it can sometimes help.
Yes I get it often. Is it possible to add automated restoring of that channel in node-red when it locks? Or some retry mechanism?

At least I never get such issues in Node-red with other lockable hardware, like serial port for example.

Re: Phidget22 Node-RED Module Released

Posted: Mon Aug 08, 2022 1:59 am
by lingvo
Found another problem with Node-RED module:

If wireless VINT hub (I use HUB5000) drops off the network (for example loss of power) and then returns back, node-RED module doesn't re-establish connection to it automatically. I have to manually restart Node-RED instance, which is annoying.

Is it possible to fix it? I don't see much activity on Phidget Node-RED Module. Is is still supported by developers?

Re: Phidget22 Node-RED Module Released

Posted: Wed Apr 12, 2023 10:59 am
by kcamenzind
Hi, would it be possible to put the node-red-contrib-phidget22 source code publicly on github so that it can be contributed to? I am interested in making some improvements (at a minimum, fixing the issue of not being able to reconnect to the server), and it would be nice to integrate the fix into the existing package rather than creating a fork / needing to publish as a different npm package to install from the palette.

If this isn't possible, please let me know! Thanks!

Re: Phidget22 Node-RED Module Released

Posted: Thu Apr 13, 2023 8:23 am
by mparadis
You can find the source code at:
https://www.npmjs.com/package/node-red- ... -phidget22

If you want to contribute, tell me your npm account and I can add you as a collaborator.

Re: Phidget22 Node-RED Module Released

Posted: Wed Aug 28, 2024 12:31 am
by nsmaree
Hi mparadis

I'm using Node-Red in an industrial application. I have, on occasion, found that a certain node disconnects. Is there a way of reconnecting a node or the entire connection on timeout?

Thanks, Neil

Re: Phidget22 Node-RED Module Released

Posted: Fri Aug 30, 2024 8:44 am
by mparadis
Normally when a channel disconnects, it will reconnect automatically once the channel becomes available again. For example, if you try unplugging and plugging back in a device, it should come back without restarting the flow.

If the node disconnects and stays that way, there must be something else causing the channel to be unavailable. Make sure all of your devices are on the newest firmware version and ensure there are no other programs running that may be looking to open the channel when it becomes available.