Unable to read data from GPS using UART

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
nikhiledutech
Posts: 118
Joined: Wed Dec 27, 2017 8:52 am

Unable to read data from GPS using UART

Post by nikhiledutech » Thu Jan 25, 2018 10:31 am

Hello,
I am currently using micro python on STM32Fdisc board, attempting to interface with GPS module. I have tried your code and also tested my code but i am unable to read data from GPS.
Do you have any idea about this problem, why it happen ?

Here is the code:
import pyb
import pyb,micropython
from pyb import LED, Pin, UART


rx = bytearray(250)
i = None
uart = UART(2,115200)


data = bytearray(255)
j = 0
#Capture Data in the Rx buffer
for i in range(255):
uart.readinto(rx)
print(rx)
# x = uart.readchar()
# print(x)
if i == 255:
break
I printed the buffer and the value is 0. So do you have any idea what can be the reason ? I have checked the GPS module its working using C/C++ and also the UART is working fine.

Post Reply