Proper way to do UART re-init in the code? #11651
-
|
I made simple asynchronous driver for a Neo6M GPS module -> https://github.com/divergentti/Micropython-for-ESP32/blob/main/esp32-gps/GPS_AS.py The code seems to perform quite ok, but every now and then communication is silent or the module keeps responding "GPTXT,01,01,02,HW UBX-G60xx 00040007 FF7FFFFFp" or GPRMC messages. I presume this problem is related to UART somehow and I implemented self.moduleUart.init() at the end of the async loop, but that does not fix the problem. Is there other ways to reset the UART? HW is ESP32 with esp32-ota-20230426-v1.20.0.bin |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
|
form what You said, is seems that Neo6M GPS module is resenting. What Vcc did to connected to the module (3.3 or 5 V)? |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for your help. The code seems to perform just fine. No crashes, no module inits. I set latest reply as answer to original quesion. 73's 1 ---------MCU------------- 1 --- RMC debug --- 1 ---------MCU------------- 1 1 ---------MCU------------- 1 --- RMC debug --- 1 ---------MCU------------- 1 --- RMC debug --- |
Beta Was this translation helpful? Give feedback.
If You mean current date field from $GPRMC
then:
( “Doomsday Algorithm.”)
will return day no: 0 (Sunday) ,1 (Monday) ....
, for example :
will return value 2 (i.e Tuesday)
note that y = 23 (2023) , whole year y=2023 will also work