Interfacing between Neo-6m gps sensor with Fipy
-
Hello Team,
We are trying to interface the neo-6m gps sensor with fipy board using default and undefault UART connections. How to interface neo-6m gps with Fipy using serial.Thank You
-
@archana-kadam I looke dagain at you request. What I cannot understand is, why you do not simple set the respberry Pi to 115200 baud.
Besides that, you can free UART0 from the REPL and reconfigure it to any speed you like, e.g. for 9600 baud:import uos from machine import UART uos.dupterm(None) uart0 = UART(0, 9600)
Be aware, that after the "uos.dupterm(None)", the REPL and print etc. is on telnet only.
-
Hello Team,
Kindly any one can reply to the above questionThank you
-
@robert-hh
Ok thank you
-
@archana-kadam I'm a user like you and not a PyCom member. My time slots for tests are evenings and weekends. I will surely look into your question, maybe this evening.
-
@robert-hh
Kindly reply for the above question
Thank you
-
@robert-hh
We have checked with the code which you had provided, but the need is we are have connected gps sensor at uart1 which works at baudrate of 9600, and raspberry pi we have connected to uart0.But the problem is uart0's baudrate is 115200 so only we are not receiving the gps data as it is at uart0.Basically we need both the uart to be setup at 9600. How to to it??
Screen shot of the data output from fipy as well as raspberry is attached. This image is about raspberry pi output connected to the Uart 0.
This image is about Gps output connected to the Uart 1Thank You
-
@archana-kadam I'll verify this night, but in your code the order of statements seem wrong. I suggest it is:
import time from machine import UART import machine import os msg = '' os.dupterm(None) uart0 = UART(0, baudrate=115200) uart1 = UART(1, baudrate=9600) while True: time.sleep(3) msg = uart1.readall() print(msg) uart0.write(str(msg))
If it is just to print the data form the GPS sensor, you can simply keep REPL and use print.
P.S.: For code to look nicely, enclose it in lines with three backquotes (```).
P.P.S.: I upvoted three of your comments, such that you can pretty print code and respond faster.
-
@robert-hh
Hello,Am using below code to read on both the uarts of fipy, on uart0 i have connected GPS sensor and on uart1 i have connected raspberry pi, am reading the GPS data from uart0 and writing the same data on the uart1 i,e on raspberry pi. But the below code is not working as i wanted. Kindly help with this.
import time
from machine import UART
import machine
import osmsg = ''
uart1 = machine.UART(0, baudrate=115200)
os.dupterm(None)
uart1 = UART(1, baudrate=9600, pins=('P1','P0'))uart = UART(1, baudrate=9600)
while True:
msg = uart1.readall()
time.sleep(3)
print(msg)
uart.write(str(msg))
print(msg)Thank You
-
@robert-hh
can you send the full code to disconnect REPL from uart0 and use it to read any uart sensor. And also after disconnecting on what baudrate it will work.
-
@archana-kadam UART0 is connected to the REPL. If you want to disconnect REPL from UART0, you have to use the statement os.dupterm(None). After that, you can use it like UART1 and configure it as needed.
For REPL, you may then use Telnet.
-
@robert-hh
Hello,We have already checked with the linked you have suggested, but in that they have only explained about the uart 1 example. Can you provide us the example of how to read both the uart 0 and uart 1 in the same code.
Also how to change the default baud rate of uart1 and uart 0.
Thank You
-
-
Hello Team
We are using two UART sensor, we have connected UART 0 and UART 1 i,e UART 0 (pins G1 and G2) and UART 1 (pins G11 and G24)
How we can get the readings of both the UART connections in a single code and how we can set the boudrate of Fipy UART Connection.Please reply as soon as possible
Thank you
-
Hello Team,
Can u share the interfacing between Neo-6m gps sensor with Fipy using serial communication.Thank You