WG18A02 FAQ

Q:

this is code im using

 import time

import serial

import binascii

 

 

 

ser = serial.Serial(

        port='/dev/ttyS0',

        baudrate = 9600,

        parity=serial.PARITY_NONE,

        stopbits=1,

        bytesize=serial.EIGHTBITS,

        timeout=1

)

 

while 1:

    ser.write(b'\x01\x03\x00\x00\x00\x03\x05\xCB')

    x=ser.readline()

  

    hex_string = binascii.hexlify(x).decode('utf-8')

    res= str(hex_string)

    print(res)

its Python

 im connecting Raspberry Pi4 to UART (serial0) pins

and this script give me answer \x7f~\xbe\xff\xff\xfb\xff\xf9\x7f\t

 

A :

Please use the intuitive serial port assistant for debugging.

 

Q: 

Is a any difference in the operation of WG18A02  etween 5 and 12 volts? Im asking because i need to connect max around 160 devices and wonder about voltage

A:

It is recommended to use the 12V version, 12V is more stable

Back to blog

Leave a comment