Rflink, Node Red and Gladys

Hello @Psoy

From memory, Gladys’s Node-RED version is fixed; yours was updated to 4.0 because, outside of Gladys, it would be a plus to have the choice in Gladys of which version to install — from the currently fixed one up to latest — and also the fact that disabling deletes the Node-RED data.

Hello @cce66
I use Node_red outside Gladys, so when I installed it version 4 was installed; so I proceeded and tried to install my RFlink without downgrading the version and it works. As for the locked Node_Red version in Gladys, it’s a safety policy from Pierre-Gilles, so that we aren’t bothered if an update happens and breaks Node-red, I think. Gladys’s node-red version has stayed on V3. Version
1.0.1 of node-red-node-serialport does not work with V3, that’s for sure. However I haven’t tried installing node-red-node-serialport 2.0.3 under Node_red V3, maybe it works! Any daredevils willing to test? If it doesn’t work you have to stop node-red and reinstall the flows, but it’s true that it’s so much easier with Gladys, no need to rummage through the directories and delete files, it does it by itself :clap:

Hi @Psoy
For the reinstallation on my mini PC, I had the same problem as you when using the Node-Red version integrated into Gladys.
I did a fresh installation outside Gladys.
I ran sudo chown -R 1000:1000 /var/lib/node-red.
And everything worked (after reinstalling the MQTT broker, which had not been restored after restoring the backup).

Indeed, even MQTT didn’t start, same thing. But I wonder if Gladys’s Node-RED is blocking ports because even my Xiaomi gateway doesn’t work. It’s a shame because, as I said above, it’s so much easier to restart Node-RED when it’s integrated into Gladys when it crashes. I had an « access denied » error for dev/tty/USB1, where my Rflink was connected.

Good evening, I have the same problem accessing my RFLink on the usb1 port with Node-RED integrated into Gladys. There really is no way to resolve this problem without removing Node-RED from Gladys and reinstalling Node-RED separately.

Good evening @elfedagger
Did you manage to handle this problem?
Are you on Gladys’ Node-RED? I’m using Node-RED separately

Yes, I recently switched to the Gladys one and I can no longer connect to my RFLink. Node-RED cannot access the usb1 port where my RFLink is plugged in.

I’m about to redo an installation alongside Gladys. But I’d like to keep Gladys’ installation simpler to restart.

Yes that’s the problem, I couldn’t connect my RFLink and I also couldn’t connect my Xiaomi gateway anymore. Port closed, I couldn’t troubleshoot it. That’s why I switched back to an external Node-RED. But now with the updates, you no longer need to downgrade the serialport version (see the RFLink and Node-RED and Gladys tutorial), however you still need to run the command:

sudo chown -R 1000:1000 /var/lib/node-red

But I have this issue with the port connections that keeps reversing

Good evening,
I adapted the code below for negative temperatures

with this code :
code to copy :

let input = msg.payload[4];
var Sign = input.substring(5, 6); // to know if the temperature is \u003c 0
var Neg = 0; // digit to add at the start if temperature \u003c 0
var Temp = input.substring(5, 9);
var TempNeg = input.substring(6, 9); // we only take the relevant digits
// Handling negative temperatures
if (Sign == 8) {
    var CreationTempNeg = Neg.toString() + TempNeg;
    var NouvelleTempNeg = parseInt(CreationTempNeg, 16);
    msg.payload = -1 * (NouvelleTempNeg / 10);
}
// Handling positive temperatures
if (Sign == 0) {
    Temp = parseInt(Temp, 16);
    msg.payload = Temp / 10;
}
return msg;

msg.payload[4] corresponds to entry no. 4 of the array ; the first being no. 0
This therefore corresponds to TEMP=0010
Here, the temperature is therefore \u003e 0

["20","26","Oregon TempHygro","2D6D","TEMP=0010","HUM=61","HSTATUS=0","BAT=LOW","\\r\\n"]

Good evening @gaetanb76
Indeed, I didn’t account for negative temperature values — I’ll replace my code with yours in the tutorial.
Thank you for the correction

1 Like

[quote=« gaetanb76, post:97, topic:6844 »]
This therefore corresponds to TEMP=0010
Here,

Good evening @gaetanb76
Can you send me a format that includes the temperature? Thanks in advance

Sorry, didn’t see it.
I’ll put it in the freezer and send it to you.

1 Like

![2025-01-24_Node-RED_RFLink_temp_neg|244x346](upload://5E7WreudcBV2MllfVHQErbEeE

hello @gaetanb76
thanks, I’ll take a look at that
have a good day

Good evening @gaetanb76
j’ai un peu modified your code pour qu’il reste dans l’esprit du tuto, c’est à dire que je n’utilise pas de array pour transformer la frame reçue. I count the characters in the whole frame, which, incidentally, is much more complicated than your method. (By the way I’d like you to explain it to me, how do you transform the frame into an array?)
If you have time take a look at what I wrote and tell me if it’s okay with you (it’s located just above paragraph 7)
thanks in advance :smile:
good evening

Would it be possible to assign ports according to the hardware type?
For example:
Zigbee stick: USB10
RFlink stick: USB20
Z-Wave stick: USB30

This by testing the hardware

sudo udevadm info --query=all --name=ttyUSB0
N: ttyUSB0
S: serial/by-id/usb-RFXCOM_RFXtrx433_A13UZWY-if00-port0
E: DEVNAME=/dev/ttyUSB0
E: ID_VENDOR=RFXCOM
E: ID_VENDOR_ID=0403
E: ID_MODEL=RFXtrx433
E: ID_MODEL_ID=6001

sudo udevadm info --query=all --name=ttyACM0
N: ttyACM0
E: ID_VENDOR=0658
E: ID_MODEL=0200
E: ID_VENDOR_FROM_DATABASE=Sigma Designs, Inc.
E: ID_MODEL_FROM_DATABASE=Aeotec Z-Stick Gen5 (ZW090) - UZB

then by creating a gladys.rules file:
sudo nano /etc/udev/rules.d/gladys.rules

I did this in Domoticz, where I don’t have a Zigbee stick but RFlink and Z-Wave

SUBSYSTEM=="tty", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A13UZWY", SYMLINK+="ttyUSB10"
SUBSYSTEM=="tty", SUBSYSTEMS=="usb",  ATTRS{idVendor}=="0658", ATTRS{idProduct}=="0200", SYMLINK+="ttyUSB20"

That’s what I’d like to do, because every time the circuit breaker trips my ports get swapped :pray:

I also have this problem every time the power goes out.