Open NEXT-JP opened 2 years ago
The get method returns the number of bytes written to the VE Direct device, in this case 11 bytes in the message. The system is asynchronous to allow for response messages getting mixed up. The callback function should look for the response to your request and print the value. Note that request 0x0201 needs to be implemented in the library and it's probably good to give it a name, like VEDirect_kDeviceState.
void mpptCallback(uint16_t id, int32_t value)
{
if (id == 0x0201)
{
Serial.println(value);
}
}
I am unable to successfully use the GET command (
mppt.get(id)
). A value of11
is always returned, regardless of the value for id I provide.Example code, basically just a modified version of the example.