Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Solax X1] Increase receive buffer #22467

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tasmota/tasmota_xnrg_energy/xnrg_12_solaxX1.ino
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ void solaxX1_SwitchMeterMode(bool MeterMode) {
/*********************************************************************************************/

void solaxX1_CyclicTask(void) { // Every 100/250 milliseconds
uint8_t DataRead[80] = {0};
uint8_t DataRead[256] = {0};
uint8_t TempData[16] = {0};
char TempDataChar[32];
float TempFloat;
Expand Down Expand Up @@ -571,7 +571,7 @@ return;

void solaxX1_SnsInit(void) {
AddLog(LOG_LEVEL_INFO, PSTR("SX1: Init - RX-pin: %d, TX-pin: %d, RTS-pin: %d"), Pin(GPIO_SOLAXX1_RX), Pin(GPIO_SOLAXX1_TX), Pin(GPIO_SOLAXX1_RTS));
solaxX1Serial = new TasmotaSerial(Pin(GPIO_SOLAXX1_RX), Pin(GPIO_SOLAXX1_TX), 1);
solaxX1Serial = new TasmotaSerial(Pin(GPIO_SOLAXX1_RX), Pin(GPIO_SOLAXX1_TX), 1, 0, 256);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's saver to let the compiler compute the size. Just in case someone changes again.

solaxX1Serial = new TasmotaSerial(Pin(GPIO_SOLAXX1_RX), Pin(GPIO_SOLAXX1_TX), 1, 0, sizeof(DataRead));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the hint. Solved in another way. #22568.

if (solaxX1Serial->begin(SOLAXX1_SPEED)) {
if (solaxX1Serial->hardwareSerial()) { ClaimSerial(); }
#ifdef ESP32
Expand Down