Skip to content

GET command always returns '11' #6

@NEXT-JP

Description

@NEXT-JP

I am unable to successfully use the GET command (mppt.get(id)). A value of 11 is always returned, regardless of the value for id I provide.

Example code, basically just a modified version of the example.

#include "VEDirect.h"

void mpptCallback(uint16_t id, int32_t value);
VEDirect mppt(Serial1, mpptCallback);

uint16_t panelVoltage = 0;
uint16_t panelPower = 0;
uint16_t chargeVoltage = 0;
uint16_t chargeCurrent = 0;
uint16_t loadVoltage = 0;
uint16_t loadCurrent = 0;
uint16_t loadOnOff = 0;
uint16_t batterySense = 0;

void setup()
{
  Serial.begin(115200);
  mppt.begin();
  delay(1000);
}

void loop()
{
  static unsigned long secondsTimer = 0;
  mppt.update();
  unsigned long m = millis();
  if (m - secondsTimer > 1000L)
  {
    secondsTimer = m;
    Serial.println(mppt.get(0x0201)); // this prints 11 for any value of id!

    mppt.ping(); // send ping every second
  }
}

void mpptCallback(uint16_t id, int32_t value)
{


  if (id == VEDirect_kPanelVoltage)
  {
    panelVoltage = value;
  }
  if (id == VEDirect_kChargeCurrent)
  {
    chargeCurrent = value;
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions