1.设备选用了银尔达企业店的 M100PG(DTU固件)贴片卡-单北斗模块
https://item.taobao.com/item.htm?id=718803061339&mi_id=0000qaxoKpzXrjCqKjNVBO442w3_i_Vz_sY6iyO-vASV8-s&spm=tbpc.boughtlist.suborder_itempic.d718803061339.67002e8dTIrFEQ&sku_properties=-5%3A-13%3B-1%3A-14
2.我ESP32-S3代码如下(语言ardoino) ,也可一使用串口测试工具先测试完成。
3.如果只返回精度维度的数据直接与DTU串口通信即可,如果还需要返回海拔/速度数据需要再 DTU配置平台:https://dtu.yinerda.com 配置一个任务,我的代码如下:
function sys.wait(15000)local taskname="userTask"log.info(taskname,"start")local nid=1local uid=1local netsta =0while true do local d ={}d.datetime=os.date("%Y-%m-%d %H:%M:%S")d.csq=mobile.csq()d.imei=mobile.imei()d.iccid = PerGetIccid()d.vbatt=PerGetVbattV()d.gps={}d.gps.isFix=libgnss.isFix()if libgnss.isFix() then local tg =libgnss.getRmc(2)local ga =libgnss.getGga(2)d.gps.lat=tg.latd.gps.lng=tg.lngd.gps.speed=tg.speed --速度d.gps.altitude=ga.altitude --海拔local t = {year=tg.year,month=tg.month,day=tg.day,hour=tg.hour,min=tg.min,sec=tg.sec} --GPS TIMEd.gps.gpstime=os.date("%Y-%m-%d %H:%M:%S",os.time(t))d.gps.variation=tg.variation --航向end LbsCheckLbs()d.lbs={}d.lbs.lbslat,d.lbs.lbslng = GetLbs()local updata = json.encode(d)local netsta = PronetGetNetSta(nid)log.info(taskname,"updata",updata,"netsta",netsta)if updata and netsta ==1 then UartSetSendCh(nid,updata)endsys.wait(10000)end end
以上分享不足之处请留言,大家共同进步!!2025-09-15