You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 20, 2019. It is now read-only.
Hi, as mentioned in this issue (#37) I have the problem of "command sync response was lost" when I use sprk+ on Mac OS as intended (issueing move commands while streaming all sensor data). Now, if I leave sensor data turned off then the sphero runs smoothly at a moderate but probably sufficient frequency of issuing roll commands.
Unfortunately, doing entirely without sensor data is not an option. So I am now trying to reduce the sensor data frequency or turn it on and off periodically, up to now without success.
What I've tried is
`function setUpSensorPolling(sfero, uuid) {
const sensorPollingDelay = 4000;
const sensorPollingInterval = 4000;
const sensorPollingPeriod = 2000;
sfero.on(VELOCITY, (data) => publishSensorData(VELOCITY, uuid, data));
// sfero.streamData = STREAM_DATA; // adapted to call 'once' instead of 'on'
setTimeout(() => {
setInterval(listener, sensorPollingInterval);
}, sensorPollingDelay)
}`
thus, reducing the frequency of sensor packets to 1 every 5 seconds
and still the connection is lost after some time
I also tried
the above reduced frequency
disabling the streaming with commented out streamVelocity(1, true). This doesn't work at all, and it adds another listener.
replacing 'on(..)' by 'once(..)' when adding the listener. This at least removes the listener after receiving a packet.
It all doesn't help. The connection is lost after some time.
Is there anyone who tried this?
Best,
David
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, as mentioned in this issue (#37) I have the problem of "command sync response was lost" when I use sprk+ on Mac OS as intended (issueing move commands while streaming all sensor data). Now, if I leave sensor data turned off then the sphero runs smoothly at a moderate but probably sufficient frequency of issuing roll commands.
Unfortunately, doing entirely without sensor data is not an option. So I am now trying to reduce the sensor data frequency or turn it on and off periodically, up to now without success.
What I've tried is
`function setUpSensorPolling(sfero, uuid) {
const sensorPollingDelay = 4000;
const sensorPollingInterval = 4000;
const sensorPollingPeriod = 2000;
sfero.on(VELOCITY, (data) => publishSensorData(VELOCITY, uuid, data));
// sfero.streamData = STREAM_DATA; // adapted to call 'once' instead of 'on'
const listener = function() {
console.log("+++ enable sensor stream")
sfero.streamVelocity(0.2, false);
// setTimeout(() => {
// sfero.removeListener("dataStreaming", listener);
// console.log("--- disable sensor stream")
// sfero.streamVelocity(1, true)
// }, sensorPollingPeriod);
};
setTimeout(() => {
setInterval(listener, sensorPollingInterval);
}, sensorPollingDelay)
}`
thus, reducing the frequency of sensor packets to 1 every 5 seconds
and still the connection is lost after some time
I also tried
It all doesn't help. The connection is lost after some time.
Is there anyone who tried this?
Best,
David
The text was updated successfully, but these errors were encountered: