A
A
Andrey Turyansky2014-03-13 00:17:36
Serial port
Andrey Turyansky, 2014-03-13 00:17:36

How to fix error when sending data via uart from OpenWrt?

Hello.
I've been scratching my head for 2 days.
I need to send a byte via UART from a TP-LINK WR703N router, OpenWrt installed
Wrote a python script
import serial
ser = serial.Serial('/dev/ttyS0', 115200, dsrdtr = 1,timeout = 0)
ser.write('12345 ')
But when I run the script via ssh, I get this rubbish:
[email protected]:/home/ftp# python recieve.py
Traceback (most recent call last):
File "recieve.py", line 16, in
ser.write ('12345')
File "/usr/lib/python2.7/site-packages/serial/serialposix.py", line 361, in write
if self.fd is None: raise portNotOpenError
serial.serialutil.SerialException: Port not open
uart not through usb, but from the router itself.
Didn't find a solution. What does it mean that the port is not open if the router boot log is regularly poured into the terminal?
In general, suddenly someone knows what can be done? I would be very grateful.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Petr Beklemishev, 2014-03-13
@Vasia529

Probably the port is occupied just by the boot log.
wiki.openwrt.org/doc/recipes/terminate.console.on.... - maybe this will help you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question