I am having issues communicatong to UART1 of my Beaglebone Black with python
My code on Python3 is as follows:
import Adafruit_BBIO.ADC as ADC
import Adafruit_BBIO.GPIO as GPIO
from time import sleep
import Adafruit_BBIO.UART as UART
import serial
ser = serial.Serial(port = "/dev/ttyO1", baudrate=9600)
print("Open")
ser.write(("Hello").encode)
print("message sent")
ser.read()
However, the beaglebone is sending me back:
Open
Traceback (most recent call last):
File "GPIO60.py", line 14, in ser.write(("Hello").encode) File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 518, in write d = to_bytes(data)
File "/usr/lib/python3/dist-packages/serial/serialutil.py", line 66, in to_bytes return (bytes(bytearray(seq)))
TypeError: 'builtin_function_or_method' object is not iterable
I have searched solutions for this type of error but have found nothing.
Any help would be appreciated! Thanks