opengd / solar-sis

solar serial inverter system
MIT License
33 stars 15 forks source link

Numbers truncated #26

Closed danielschramm closed 3 years ago

danielschramm commented 4 years ago

Hello,

I'm just testing the program and like the functionality very much. But there are always some "spikes" over the day in some data read. So I stepped deeper into the code to find the reason

Best to reproduce is reading total energy generated which gave in my example interesting readings: 235, 235, 23, 235, 2, 23, 235 ..... Single stepping to "Response Remove Header" showed that that function is not fault tolerant enough in cases of receive problems. A quick and dirty fix is to add a check if str.substring(0,1) matches commandConfig.response_start and ignore the line if not.

Perhaps you find a more sophisticated fix.

Thanks,

Daniel

daromer2 commented 3 years ago

Feel free to create a pull request. Currently im not doing much maintaining here im afraid since i cant test it currently.