moe1983 发表于 2022-8-2 18:56:38

moe1983 发表于 2022-8-2 18:52
把yaml里面debug打#的去掉,编译后看看串口输出,可能你的2410是新固件,输出合适有变化 ...

因为我是旧固件,只有工程模式,具体判断在h文件37行,0x23是工程模式的,可以修改这里。或者第47行,把bytes的判断去掉,应该就可以了

moe1983 发表于 2022-8-2 18:58:02

moe1983 发表于 2022-8-2 18:56
因为我是旧固件,只有工程模式,具体判断在h文件37行,0x23是工程模式的,可以修改这里。或者第47行,把b ...

行数不对,具体看headermatch那段,不要判断bytes

Tj8888 发表于 2022-8-2 20:37:38

本帖最后由 Tj8888 于 2022-8-2 20:43 编辑

moe1983 发表于 2022-8-2 18:52
把yaml里面debug打#的去掉,编译后看看串口输出,可能你的2410是新固件,输出合适有变化 ...
#我移除啦! 調其他設定時串口都有輸出且正確, 但是開關run_RTA串口沒有任何輸出!
對了, 我沒有光感應器和IR, 用#點掉些相關的code, 會是跟這有關嗎?
補充 : 剛試過把光感應器的code加回來, 仍是unknown.

happp 发表于 2022-8-2 21:09:29

谢谢分享学习一下

Tj8888 发表于 2022-8-2 21:23:35

本帖最后由 Tj8888 于 2022-8-2 22:07 编辑

moe1983 发表于 2022-8-2 18:58
行数不对,具体看headermatch那段,不要判断bytes
你說的是這段code嗎? 不好意思! 可否能再明確一點指導一下改哪裡嗎?, 感謝!
void loop() override
    {
      static int data_count = 0;
      static bool presence_state = true;//无人时不监控,节省运算量

      while (available() > 0)// && (id(run_rta).state || id(config_mode).state)
      {
            bytes.push_back(read());
            if (bytes.size() < 6 + 3)    //多取3位,用于判断是否有人
            {
                continue;
            }

            if (HeaderMatched(bytes, header_data) && id(run_rta).state)
            {
                if (bytes)
                {
                  if (bytes.size() < 6 + sizeof(LDDATA))
                  {
                        continue;
                  }

還是這段........

    std::vector<uint8_t> bytes;   std::vector<uint8_t> header_parameter = {0xFD, 0xFC, 0xFB, 0xFA,0x1C, 0x00, 0x61, 0x01, 0x00, 0x00, 0xAA};   std::vector<uint8_t> header_data = {0xF4, 0xF3, 0xF2, 0xF1, 0x23,0x00};//调试用    std::vector<uint8_t> header_feedback= {0xFD, 0xFC, 0xFB, 0xFA, 0x04, 0x00};

    boolHeaderMatched(std::vector<uint8_t> bytes, std::vector<uint8_t>header)    {      if(bytes != header || bytes != header || bytes != header ||bytes != header)      {         return false;      }      returnbytes == header && bytes == header;          }

moe1983 发表于 2022-8-3 00:39:27

Tj8888 发表于 2022-8-2 21:23
你說的是這段code嗎? 不好意思! 可否能再明確一點指導一下改哪裡嗎?, 感謝!
void loop() override
    {


新固件的暂时把   std::vector<uint8_t> header_data = {0xF4, 0xF3, 0xF2, 0xF1, 0x23,0x00}; 修改成:
   std::vector<uint8_t> header_data = {0xF4, 0xF3, 0xF2, 0xF1, 0x0D,0x00};
然后重新OTA一次。我刚拿到新版本,有空完善更新一下

Tj8888 发表于 2022-8-3 07:41:45

moe1983 发表于 2022-8-3 00:39
新固件的暂时把   std::vector header_data = {0xF4, 0xF3, 0xF2, 0xF1, 0x23,0x00}; 修改成:
   std::v ...

Header改後數據讀出來了! 問題解決了, 也學習了, 太感謝樓主無私地分享和耐心的指導!
期待你的新固件優化, 到時再來體驗!

520key 发表于 2022-8-3 13:41:34

支持群友分享

q360130 发表于 2022-8-3 22:28:43

谢谢分享

silversucks 发表于 2022-8-4 08:23:45

学习一下
页: 2 3 4 5 6 7 8 9 10 11 [12] 13 14 15 16 17 18 19 20 21
查看完整版本: 【更新3】无线调试、监控人体存在感应雷达数据(LD2410H)