Page 1 of 1

Allocate more CPU to Project/Programs SBC4

Posted: Sat Mar 19, 2022 5:09 pm
by llarkin
Hello,

I am utilizing your SBC4 as a MQTT client device for supplemental command and control of an AGV. It essentially reads incoming traffic it is subscribed to and pushes that information to a second script that then interprets and changes applicable variables the servo controller picks up each loop and commands the AGV accordingly; IE turn left, turn right, spin, stop, etc. While I am sure my code needs some optimization I was also wondering if you could suggest a means to give the Project and its subsequent programs more CPU. Is LINIX nice() and renice() a possibility? IF SO what root and directory would I target? Do you have an alternative less "brute" force method?

Regards,

Liam Larkin
FRED Automation Inc.

Re: Allocate more CPU to Project/Programs SBC4

Posted: Fri Mar 25, 2022 12:54 pm
by llarkin
######UPDATE######
I was able to nice my .py via the putty linux terminal. At first I set it to -20 and a bit to much slowed everything else way down eventually the processor would puke. Anyway backed that off -10 and it appears to be able to handle that as well as other process's. Looking at a live $top its eating up about 80% of the CPU. Still looking for better suggestions if anyone has any. Also so you know my code is written in python and as said before two loops run 1 that handles the broker MQTT side and the other that handles the servo communication via serial.

Still seeing a buildup of messages that the processor has a tough time dealing with