Home/Support/Support Forum/[Errno 0] Error when trying to open asy00 on python
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

[Errno 0] Error when trying to open asy00 on python

0 votes
I'm trying to write a script to process serial port input. When running the script on a WR31 the above error appears

Full Code:
import sys, select, socket

fr = open("asy/00", "r")
fw = socket.socket( socket.AF_INET, socket.SOCK_STREAM)
fw.connect(('104.152.164.20',1999));
input = [fr]
while 1:
inputready,outputready,exceptready = select.select(input,[],[], 1.1)

for d in inputready:
if d == fr:
data = d.read()
if data:
fw.write(data) #Echo the data that was read
fw.flush() #Send the data to the serial port

print("tick")
asked Jan 2 in Python by JasonL84 New to the Community (0 points)

Please log in or register to answer this question.

1 Answer

0 votes
Hi i tried this on my wr31 here

the script is a bit wrong as i think you had FW,write / flush was for the serial interface and not the socket.

this worked for me do you have something else locking the serial or the socket you are using.

regards

James
answered Jan 10 by James.Wilson Veteran of the Digi Community (1,225 points)
...