![]() |
|
rs485 port with kc868-a16s. - Printable Version +- Smart Home Automation Forum (https://www.kincony.com/forum) +-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20) +--- Forum: KC868-A16S (https://www.kincony.com/forum/forumdisplay.php?fid=47) +--- Thread: rs485 port with kc868-a16s. (/showthread.php?tid=6863) |
rs485 port with kc868-a16s. - Alfred - 10-11-2024 i want to receive 16 bytes data through rs485 port with kc868-a16s. but the received value is strange. please le me know what should i check. #define A16S_RS485_RX 32 #define A16S_RS485_TX 33 void setup() { Serial.begin(115200); Serial2.begin(19200,SERIAL_8N1,A16S_RS485_RX,A16S_RS485_TX); //A16S Serial.println("A16S RS485 OK"); } void loop() { if (Serial2.available() > 0) { Serial.print("rs485 received value : "); Serial.println(Serial2.read()); } delay(1000); } 18:57:15.956 -> rs485 received value : 1 18:57:16.936 -> rs485 received value : 134 18:57:17.966 -> rs485 received value : 160 18:57:19.011 -> rs485 received value : 255 18:57:19.932 -> rs485 received value : 255 18:57:20.964 -> rs485 received value : 255 18:57:21.944 -> rs485 received value : 240 18:57:22.973 -> rs485 received value : 0 18:57:23.950 -> rs485 received value : 0 18:57:24.938 -> rs485 received value : 0 18:57:25.967 -> rs485 received value : 30 18:57:26.948 -> rs485 received value : 165 sending data attached. RE: rs485 port with kc868-a16s. - admin - 10-12-2024 if you have connect with RS485 device (maybe you are monitor the battery), i suggest you connect a USB-RS485 adapter to see what have received firstly. Then you can compare with the data if received by KC868-A16S. RE: rs485 port with kc868-a16s. - Alfred - 10-13-2024 (10-12-2024, 12:48 AM)admin Wrote: if you have connect with RS485 device (maybe you are monitor the battery), i suggest you connect a USB-RS485 adapter to see what have received firstly. Then you can compare with the data if received by KC868-A16S. now ok. thank you! RE: rs485 port with kc868-a16s. - admin - 10-13-2024 ok, good. |