Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Serial communication
#1
Hi all, I need some help here.

The error I got is "device reports readiness to read but return no data. (Device disconnected or multiple access on ports)
As I'm trying to get the following code working. Anyone know how to fix it?

This is the following code:

import serial
ser = serial.Serial('/dev/ttyUSB0',9600,timeout=2)
                     #may need to use .../dev/ttyACM0...

ser.flushInput()

while True:
    mystring = str(ser.readline())
    mylist = mystring.split(",")

    if (len(mylist) >= 6) and (mylist[5]=="#"):
      print(mystring) # Should see something like this: 'Sender long address|*,"count",End Device 01,Router 02,Time: 03:04:05,#,#\r\n'
      print (mylist[2], " --> ", mylist[3]) # Should see something like this: End Device 01 --> Router 02
Reply
#2
check the TX and RX connections between devices, did you build the connecting cable yourself?
remember that the TX pin on device A connects to the RX pin on device B and vice versa.

Also look at DTR and DSR (if used) they must also be crossed (Device A DSR --> device B DTR)

see: www.chimica.unipd.it/luigino.feltre/pubblica/unix/rs232/rs232-cable-tech.pdf
Reply
#3
However, we're using usb for our connections.
These are the following device that we're using:

ZigBee ZE20s
Arduino UNO
Raspberry Pi
This is how it begins:
Firstly, our ZigBee End Device(ZED) is connected to the parent (ZigBee Router or ZR).
In the network, we have our ZigBee Coordinator (ZC), ZR and ZED.
With this, we're supposed to track ZED's location. ZED is supposed to join to one of the parent, (Eg. ZED1 -> ZR2)
Then from the coordinator, we can see the ZED's whereabouts.

The main thing is that ZC have the capability to carry the data to the Rasp Pi via the use of Arduino UNO (we actually programmed Arduino already).

Unfortunately, from here onwards we faced problems where it cant run the following python code as of written above.
Reply
#4
suggest you get your serial connection working between Arduino and Pi with putty first. (if you haven't done so already). This will eliminate the possibility of any hardware issues, and make you feel confident that it is a definately a software issue.

I'm no expert on zigbee, I worked with it some in the early 2000's, not since, so this is the extent of my usefulness here.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Server/client basic communication ebolisa 0 2,027 Sep-30-2021, 12:22 PM
Last Post: ebolisa
  Python 3 Serial communication need help jegatheesans 0 1,619 Mar-16-2020, 05:37 AM
Last Post: jegatheesans
  Serial toggles serial, but no data Saltwater 2 2,596 Sep-08-2019, 12:20 PM
Last Post: Saltwater

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020