Page 1 of 1

Z-UNO 2 RS-485

Posted: 08 Feb 2025 21:00
by luhrern
I am trying to makde and install a sketch for a flowmeter that communicate with RS-485.

Are using the new configurator and select like this picture con1.jpg (attached)

I get the SKECTH below.

I am uploading thsi to the Z-UNO 2 in Arduino 1.8.19 version using the 3.0.10 version of the boards manager.

Then I pair the Z-UNO 2 board with my Z-WAY system version v4.0.3

The pairing of the device is successful. But the device show no measurements, see enclosed file device.jpg.



**SKETCH START

/*
* This code was generated using the configurator
* https://z-uno.z-wave.me/configurator/#/ ... l=XKyjz0A7
*/

#include "ZUNO_SHIELD.h" // Shield library





ZUNOShield shield; // Shield object

void setup() {
Serial1.begin(9600);
pinMode(2, OUTPUT);
digitalWrite(2, LOW);
}

void loop() {
// read values



// check rules



// set values and send reports


}


// Functions
char readByteRS485() {
while(Serial1.available() <= 0) delay(1);
return Serial1.read();
}

void writeRS485(char b) {
digitalWrite(2, HIGH);
delay(5);
Serial1.write(b);
delay(5);
digitalWrite(2, LOW);
}
**SKETCH END

Re: Z-UNO 2 RS-485

Posted: 14 Feb 2025 01:39
by PoltoS
Hello!

The RS-485 is just a physical layer. You should fill the RS-485 logic using writeRS485 and readRS485 functions and a channel (check the documentation how to add a channel or use the configurator and then decouple it from the pin (remove digitalRead or whatever is added)