Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting broken pipe error #1

Open
sharibansari opened this issue Dec 9, 2019 · 9 comments
Open

Getting broken pipe error #1

sharibansari opened this issue Dec 9, 2019 · 9 comments

Comments

@sharibansari
Copy link

sharibansari commented Dec 9, 2019

Hi Will,

When I am trying to run a single-read.py in the example I am getting the following error.

File "single-read.py", line 21, in
reader_info = ReaderInfoFrame(runner.run(get_reader_info))
File "{PYTHONPATH}:$(pwd)/chafon_rfid/base.py", line 31, in run
self.transport.write(command.serialize())
File "{PYTHONPATH}:$(pwd)//chafon_rfid/transport.py", line 33, in write
self.write_bytes(byte_array)
File "{PYTHONPATH}:$(pwd)//chafon_rfid/transport.py", line 55, in write_bytes
self.socket.sendall(byte_array)
BrokenPipeError: [Errno 32] Broken pipe

Could you please explain the usage of the examples in brief ?

Thanks

@wabson
Copy link
Owner

wabson commented Dec 11, 2019

By default the examples try to connect to a reader over the network, but you can also use serial.

The error you are getting BrokenPipeError: [Errno 32] Broken pipe in single-read.py implies that your device is not accessible at the hard-coded IP 192.168.1.190. You need to change this on line 18 to the address of the reader, or use serial communication instead (if your reader is connected that way), e.g.

transport = SerialTransport(device='/dev/ttyUSB0')

Hope that helps

@anas-gif
Copy link

Hi Will,

When I am trying to run a single-read.py I am finding this error.

<base.CommandRunner object at 0xb64707f0>
Traceback (most recent call last):
File "code3.py", line 21, in
reader_info = ReaderInfoFrame(runner.run(get_reader_info))
File "/home/pi/chafon-rfid-master/chafon_rfid/base.py", line 32, in run
return self.transport.read_frame()
File "/home/pi/chafon-rfid-master/chafon_rfid/transport.py", line 28, in read_frame
frame_length = length_bytes[0]
IndexError: bytearray index out of range

I was used serial communication instead transport e.g.
transport = SerialTransport(device='/dev/ttyUSB0')

Could you explain where and how to solve the problem?

Thank you

@anas-gif
Copy link

This : <base.CommandRunner object at 0xb64707f0> is because I have written
runner = CommandRunner(transport)
print(runner)

@wabson
Copy link
Owner

wabson commented Feb 13, 2020

@anas-gif normally you should open a separate issue unless you are sure your problem is related. But since I didn't close this issue yet, let's continue here.

Could you post the output of dmesg | grep tty? It may be that /dev/ttyUSB0 is not the correct device name, but the output should indicate which serial ports you have in use.

@anas-gif
Copy link

[ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 cma=64M cma=256M video=HDMI-A-1:1920x1080M@60,margin_left=48,margin_right=48,margin_top=48,margin_bottom=48 smsc95xx.macaddr=DC:A6:32:57:19:19 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 console=tty1 root=PARTUUID=d9b3f436-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
[ 0.000258] console [tty1] enabled
[ 0.434975] fe201000.serial: ttyAMA0 at MMIO 0xfe201000 (irq = 34, base_baud = 0) is a PL011 rev2
[ 0.438246] fe215040.serial: ttyS0 at MMIO 0x0 (irq = 37, base_baud = 62500000) is a 16550
[ 4.914043] usb 1-1.2: cp210x converter now attached to ttyUSB0

@anas-gif
Copy link

I have replaced /dev/ttyUSB0 by /dev/ttyAMA0 and the programme no post nothing.

I connecte my RFID with Raspberry by wires TXD of RFID with RXD of Raspberry and RXD of RFID with TXD of Raspberry.
And I connecte my RFID also with Raspberry by cable USB (UHF RFID Desktop Reader and Writer Modèle: CF-RU5202) you can see the http://fr.chafontech.com/rfid-uhf-reader/uhf-reader-and-writer/diy-uhf-rfid-reader.html

@anas-gif
Copy link

can you help me please

@darklifeform
Copy link

darklifeform commented Feb 23, 2020

Hi @wabson
I have the same issue while trying to connect to RU6403 reader via network. In the example single-reader.py I've changed IP address and port of reader and Im getting BrokenPipeError: [Errno 32] Broken pipe on line reader_info = ReaderInfoFrame(runner.run(get_reader_info)).

I checked connectivity using tools included in reader's SDK and successfully connected to reader

I'm not very experienced in TCP connections, so any help in debugging that issue will be very helpful.
Screenshot 2020-02-23 at 18 16 14

@gmvidooly
Copy link

please try auto_connect=True in transport.py or manually connect with socket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants