esp8266-gps不斷重啟

想請問我現在用出來的亂碼查資料,查到是電源的問題(ESP8266 - 12E in infinite reset loop with wdt reset [RESOLVED] - MicroPython Forum),但是已經改供電並共地,同時加上1N4148在TX線上,一開始有出新的亂碼(接訊號線之前),但後面都一樣,還是會一再重啟
參考書:https://www.books.com.tw/products/0010786530

程式碼如下
from machine import UART
com=UART(0,9600)
com.init(9600)

from machine import I2C, Pin
from esp8266_i2c_lcd import I2cLcd

i2c=I2C(scl=Pin(5),sda=Pin(4),freq=400000)
lcd=I2cLcd(i2c, 0x27, 2, 16)

gpsStr=b’’
gpsReading=False
def displayGPS(lat,long,today,now):
#lat=‘Lat:’+lat
#long=‘Long:’+long
print(today+" “+now+”\n"+lat+" “+long+”\n")
lcd.putstr(today+" “+now+”\n"+lat+" “+long+”\n")

def latitude(d,h):
if d==’’:
return ‘0’
hemi=’‘if h==‘N’else’-’
deg=d[0:2]
min=str(float(d[2:])/60)[1:]

return hemi+deg+min

def longitude(d,h):
if d==’’:
return ‘0’
hemi=’‘if h==‘E’else’-’
deg=d[0:3]
min=str(float(d[3:])/60)[1:]

return hemi+deg+min

def utcDate(dateStr):
if dateStr==’’:
return ‘’
day=dateStr[0:2]
month=dateStr[2:4]
year=dateStr[4:6]

return '20'+year+'/'+month+'/'+day

def utcTime(timeStr):
if timeStr==’’:
return ‘’
hr=timeStr[0:2]
min=timeStr[2:4]
sec=timeStr[4:6]

return hr+':'+min+':'+sec

def convertGPS(gpsStr):
gps=gpsStr.split(b’\r\n’)[0].decode(‘ascii’).split(’,’)

lat=latitude(gps[3],gps[4])
long=longitude(gps[5],gps[6])
today=utcDate(gps[9])
now=utcTime(gps[1])

return (lat,long,today,now)

while True:
lcd.putstr(“read”)
data=com.readline()
print(data+’\n’)
if data and (gpsReading or(’$GPRMC’ in data)):
gpsStr+=data
print(gpsStr+’\n’)
if ‘\n’ in data:
gpsReading=False
lat,long,today,now=convertGPS(gpsStr)
lcd.clear()
displayGPS(lat,long,today,now)
gpsStr=b’’
else:
gpsReading=True
lcd.putstr(“reading”)