-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
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;
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels