You've already forked M5Module-LLM
mirror of
https://github.com/m5stack/M5Module-LLM.git
synced 2026-05-20 11:31:45 -07:00
Increase the timeout time of LLM setup. Update arduino lib version.
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
name=M5ModuleLLM
|
||||
version=1.0.0
|
||||
version=1.4.0
|
||||
author=M5Stack
|
||||
maintainer=M5Stack
|
||||
sentence=M5ModuleLLM is a library for M5ModuleLLM
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ String ApiLlm::setup(ApiLlmSetupConfig_t config, String request_id)
|
||||
// Copy work id
|
||||
llm_work_id = msg.work_id;
|
||||
},
|
||||
20000);
|
||||
30000);
|
||||
return llm_work_id;
|
||||
}
|
||||
|
||||
|
||||
+11
-2
@@ -7,6 +7,8 @@
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
using namespace m5_module_llm;
|
||||
const size_t JSON_BUFFER_SIZE = 2048;
|
||||
char jsonBuffer[JSON_BUFFER_SIZE];
|
||||
|
||||
bool ModuleComm::init(Stream* serialPort)
|
||||
{
|
||||
@@ -34,6 +36,7 @@ void ModuleComm::sendRaw(const uint8_t* data, size_t& raw_len)
|
||||
ModuleComm::Respond_t ModuleComm::getResponse(uint32_t timeout)
|
||||
{
|
||||
Respond_t ret;
|
||||
String buffer;
|
||||
|
||||
uint32_t time_out_count = millis();
|
||||
bool get_msg = false;
|
||||
@@ -43,7 +46,13 @@ ModuleComm::Respond_t ModuleComm::getResponse(uint32_t timeout)
|
||||
if (_serial->available()) {
|
||||
get_msg = true;
|
||||
while (_serial->available()) {
|
||||
ret.msg += (char)_serial->read();
|
||||
char c = (char)_serial->read();
|
||||
buffer += c;
|
||||
|
||||
if (c == '\n') {
|
||||
ret.msg = buffer;
|
||||
return ret;;
|
||||
}
|
||||
}
|
||||
get_msg_count = millis();
|
||||
time_out_count = millis();
|
||||
@@ -62,7 +71,7 @@ ModuleComm::Respond_t ModuleComm::getResponse(uint32_t timeout)
|
||||
break;
|
||||
}
|
||||
|
||||
delay(5);
|
||||
// delay(5);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user