Do I understand the error correctly?
If so how would implement my solution or is there a better one?
Alternatively is there a better alternative library suited to my needs?
Hardware
My project consists of multiple adruino controlled cartesian robots. All of these robots are connected via the USB serial connections to a computer.
Software
I am using simpleRPC but have encountered a problem. If there are too many commands sent at one time it does not send all the commands. I have taken an excerpt of my code to highlight the problem.
Server code:
#include <simpleRPC.h>
#include <Servo.h>
Servo Servo1;
void setup() {
Serial.begin(9600);
Servo1.attach(4);
}
void loop() {
interface(
Serial,
delay,
"delay: How to cause a delay in ms. @ms: Milliseconds of delay",
pack(&Servo1, &Servo::write),
"servoMove: Angle to move servo ");
}
Client code:
from simple_rpc import SerialInterface
interface = SerialInterface("COM5", baudrate=9600)
if __name__ == '__main__':
for x in range(10):
interface.servoMove(0)
interface.delay(1000)
interface.servoMove(90)
interface.delay(1000)
With this code I am trying to move a servo back and forth from 0 to 90 degrees and repeat this 10 times. It completes the first 3 loops of movement but then just stops.
This is also true with other commands involving movement of stepper motors and I find it will only do a small number of moves before it either stops or does something erroneous.
I don't fully understand how the simpleRPC package works but I'm guessing that it tries to send all the remote procedure calls at once and there is a limit which I am exceeding?
Is the solution to only send one remote procedure call at time and if so how would i do that?
Is there a better way to do this?