1

I am using my Raspberry Pi 2 (buster, php 7.4.10) to communicate with an inverter in a small solar system. All the code is functional but it tends to crash/exit after a few hours. Looking at task manager I saw the process was consuming memory. After adding some "print (memory_get_usage())" statements, I narrowed the issue down to a call to dio_read(): $inchar=dio_read($fd,1);

which queries the serial port for the next byte. Each call seems to burn 8 bytes. I've tried upgrading the dio package to 0.2.0 (version 0.1.0 mentions fixing a memory leak) but the leak persists. I've also tried periodically closing, unsetting, and re-opening the port but that has no effect. Has anyone faced a similar issue and found a work-around?

Thanks, Markus

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.