cterwilliger / vedirectframehandler Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
it looks like victron change something in the communication, so the new devices send at the end and itemdaly after the checksum byte a Async Hex (i think broadcast)
it looks:
PID 0xA071
V 22000
I 0
VPV 0
PPV 0
MPPT 0
CS 0
OR 0x00000001
ERR 0
LOAD OFF
H19 1077
H20 0
H21 4
H22 117
H23 921
HSDS 16
Checksum โ:A2001002200000008
:ADBED00750806
:AD5ED009708EA
:A8DED00970832
so the code doesnt regonize the right end after the checksum byte.
any idea how to fix that?
Hi,
I am using your lib and want to point out a potential issue.
We had an issue with reading VE-Direct frames from the (software) serial buffer.
This caused strange behavior like existing label names in the public buffer being overwritten (and most possibly also crashes)
I tracked it down to frameIndex becoming larger then FRAME_LEN causing the tempBuffer to overflow (in the rare case where multiple partial frames without a checksum label were somehow stored in the serial buffer after each other. Possibly because I was not reading a circular buffer fast enough).
Maybe it is rare but this can easily be caught by only increasing frameIndex when frameIndex < FRAME_LEN:
void VeDirectFrameHandler::textRxEvent(char* name, char* value) {
if (frameIndex < FRAME_LEN) {
strcpy(tempName[frameIndex], name); // copy name to temporary buffer
strcpy(tempValue[frameIndex], value); // copy value to temporary buffer
frameIndex++;
} else {
log_w("temp buffer overrun!");
}
}
Regards,
Jeroen
This code looks to be just what I am looking for but on compiling it fails asking from framehandler.h file which I have researched and cannot find anywhere.
Not sure why but after a while the myve.veValue value does not change, Using an 8266 and software serial..
any ideas?
Anyone else experienced this? I was able to get it to run fine on a Particle Photon using both hardware serial and software serial, the latter as I needed the one free hw serial to do something else a little more intensive.
Seems like after somewhere between a minute and 5 minutes it'll just cease to read and my output to the arduino IDE serial monitor quits entirely.
probably not a issue for this library, but thought I would ask.
Im using on a Wemos d1 mini (along with 9 more), and only plugging into a BVM712. im Trying to read and send to MQTT server, which it does, and its great for a few seconds, then nearly all values start coming in as null.
object PID: "0XA381" V: null I: null P: null CE: null SOC: null TTG: "-1" ALARM: "OFF"
im not really doing anything crazy to the data, so Im just wondering if the timing is off? possbily with loop?
void ReadVEData() {
while ( Victron.available() ) {
myve.rxData(Victron.read());
}
yield();
}
void EverySecond() {
static unsigned long prev_millis;
if (millis() - prev_millis > 1000) {
SendData();
prev_millis = millis();
}
}
void SendData(){
String jsonstring;
for ( int i = 0; i < myve.veEnd; i++ ) {
json[myve.veName[i]] = myve.veValue[i];
}
serializeJson(json, jsonstring);
client.publish( "zorro/solar/bvm", jsonstring);
Serial.println(jsonstring);
}
`
I'd like to use this library in my project, however I see that there's no licence specified. I figured I'd ask to see if it's open-source and under what licence.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.