[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: serial communication
From: |
Andreas Weber |
Subject: |
Re: serial communication |
Date: |
Fri, 23 Jun 2017 08:44:58 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
I've also answered to your other, almost same question. I'll stick know
on this thread.
Am 22.06.2017 um 09:17 schrieb iceyj21:
> Heres my code. Using cutecom to monitor the serial output of the rfid reader
> that I'm sending the hex values to I found that its receiving the
> "auto_read" command and then sending hex values out. What I'm facing now is
> the inability to read those hex values with srl_read. the port is correct
> and there is data that should be received but I'm not sure why octave isn't.
> When looking at the variable values "tag" isn't being assigned anything form
> the srl_write function.
>
> ...
>
> s3 = serial("/dev/cu.SLAB_USBtoUART",115200,2);
Try to increase the timeout (2 -> 20)
> set(s3, "dataterminalready", "off");
> set(s3, "requesttosend", "off");
Not needed since it's the default setting
> pkt = [0xBB, 0x00, 0x08, 0x00, 0x00, 0x7E, 0x0B, 0x96];
Does this include the correct CRC16?
> srl_write(s3,uint8(pkt(i)));
Just use srl_write(s3,uint8(pkt)); no need for the loop
> srl_write(s3,uint8(auto_read(j)));
Why do you send two commands?
> [tag,n] = srl_read(s3,1000000);
As I said in the other thread: make a hardware loopback between RX and
TX (pin 2+3) and see if you receive the same string as you are sending.
-- Andy