You need to activate the serial port first.
http://beaglebone.cameon.net/home/serial-ports-uart

Am Mittwoch, 18. Mai 2016 22:46:20 UTC+2 schrieb Shaurabh Kumar Singh:
>
> I have been trying to communicate with a CNC machine through RS 232 to the 
> Beaglebone Black. 
> Following are the Serial Port settings at the Machine
> Baudrate=9600
> Databits=8
> Stopbits=1
> Parity=None
> CR only
>
> When i tried connecting it to my desktop(windows 10-using python) 
> directly(done without using BBB) and i set the same parameters i got the 
> response from the machine like i had expected.
>
> Although, when done using the BBB (debian), also using python, i just 
> received the string command i sent to the machine. Following is the python 
> code.
>
> import Adafruit_BBIO.UART as UART
>
> import serial, string
>
> UART.setup("UART1")
> with serial.Serial(port="/dev/ttyO0",baudrate=9600,timeout=2) as ser: #i 
> also tried mentioning databits and stopbits and other parameters but they 
> still did not work
>         ser.write(b"Q100\r")
>         c=ser.readline().decode("utf-8","ignore")
>         print(c)
>         ser.close()
>
> This works all fine in windows(gives the serial no. as the output) but 
> simply gives back     Q100    as output (same as input).
>
> I was wondering if it could be due to the different OS on my laptop and 
> BBB. Should i try installing windows ce on the BBB and work with that?
>
>
> Thank you
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/0b12d828-dd4b-46d0-89c5-9ed6ddd95431%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to