I used following sketch to connect my NEO 6M GPS module to laptop.
import serial
try:
gps = serial.Serial('com4',9600)
while True:
ser_bytes = gps.readline()
decoded_data = ser_bytes.decode("utf-8")
data = decoded_data.split(",")
print(data)
except serial.serialException:
print("Error")
In this case I used my Arduino NANO as USB to serial converter (No code uploaded toArduino and not used Arduino IDE when using Pycharm). I used correct com port and burd rate but following error code is showing.
AttributeError: module ‘serial’ has no attribute ‘serialException’
I had imported serial interpreter to this project. So how to solve this problem. Please give me tour ideas because I’m very new to python.
Thank You.
Hello, @Indula, and welcome to Python Software Foundation Discourse!
Python is case-sensitive. You need to be looking for a serial.SerialException.
EDIT:
After you correct that line, and execute the code again, you may see the following displayed in the output, and then would need to continue to diagnose the problem: