HE910 Serial Comms

2 thoughts on “HE910 Serial Comms

  1. hi,

    I am trying to send/recieve data through the serial port to a logging device. I send a hex stream xF8xCDx0Dx00x00x0Ex5D to the device and receive a reponse. The code i am using is basically copied from the send_rcv.py example. However i am unable to get the data received fromt the device. I have set up a test using the RealTerm  serial capture program and with the settings  – 19200, 8N1 and no hardware control, the send and receive work correctly when the device is connected directly to the PC. Is there something very simple that i am missing when trying to get the module to do the same? The code is as follows:        

    import SER
    import time

    def SER_receive(timeout):
        res = ”
        start = time.time()
        while (time.time() – start < timeout):
            res = res + SER.read()
        return res

    data = ‘xF8xCDx0Dx00x00x0Ex5D’
    while (1 == 1):
        a = SER.send(data,0)
        b = SER_receive(10)
        print ‘answer’,b

     many thanks if you can help

    mark longden

    1. If the comms with a PC are going well of course you should look for the problem related with the logger. Check baudrate, serial properties.

      Is it that string or you should mean a string of bytes, ie really including 0x00 bytes? Maybe the answer has these too and the print will need to be implemented to be able to cope with them.