New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove uncessary firmata traffic #58

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
7 participants
@monteslu
Copy link
Contributor

monteslu commented Apr 11, 2014

Currently it is difficult to use firmata.js with traffic over slower serial transports such as binary websockets.

This change only asks to reporting on existing pins and optionally turns down the sampleInterval before requesting data.

@@ -356,6 +358,7 @@ var Board = function(port, options, callback) {
};
}
var board = this;
board.options = options;

This comment has been minimized.

@rwaldron

rwaldron Apr 12, 2014

Collaborator

This should just be this.options = options;

@jacobrosenthal

This comment has been minimized.

Copy link

jacobrosenthal commented Apr 13, 2014

Big +1

@ghost

This comment has been minimized.

Copy link

ghost commented Apr 14, 2014

+1

@chrismatthieu

This comment has been minimized.

Copy link

chrismatthieu commented Apr 14, 2014

@skynet #IoT +1

@pctj101

This comment has been minimized.

Copy link

pctj101 commented Jun 22, 2014

+1 - High Analog traffic is making it nearly impossible to read digital changes on the Arduino Yun.

@achingbrain

This comment has been minimized.

Copy link
Contributor

achingbrain commented Jul 14, 2014

I'd love to see this merged. I had to make much the same amendment to get meatmon working over nRF24L01 wireless cards.

@rwaldron

This comment has been minimized.

Copy link
Collaborator

rwaldron commented Jul 15, 2014

I think @jgautier would be more likely to land this if there were tests supporting the change.

@jacobrosenthal jacobrosenthal referenced this pull request Jul 15, 2014

Closed

Fix digital report #65

@rwaldron

This comment has been minimized.

Copy link
Collaborator

rwaldron commented Jul 29, 2014

@monteslu can you add some tests for this?

@monteslu

This comment has been minimized.

Copy link
Contributor

monteslu commented Jul 29, 2014

@rwaldron will do

@rwaldron

This comment has been minimized.

Copy link
Collaborator

rwaldron commented Jul 29, 2014

@monteslu once you have them added and pushed I will land this—thanks!

@@ -175,6 +171,10 @@ SYSEX_RESPONSE[QUERY_FIRMWARE] = function (board) {
SYSEX_RESPONSE[CAPABILITY_RESPONSE] = function (board) {
var supportedModes = 0;

if (board.options.samplingInterval){
board.setSamplingInterval(board.options.samplingInterval);

This comment has been minimized.

@rwaldron

rwaldron Jul 29, 2014

Collaborator

This condition will evaluate as true and the consequent will be called every time SYSEX_RESPONSE[CAPABILITY_RESPONSE] is called, where can it be moved to avoid that?

This comment has been minimized.

@monteslu

monteslu Jul 30, 2014

Contributor

Good question.

When we don't skip the capability query, the default behavior is to tell the board first to turn on REPORT_DIGITAL for every pin, then to turn on REPORT_ANALOG for every pin.

According to http://firmata.org/wiki/V2.2ProtocolDetails the default reporting time is 19ms which is fine for USB, but may be very chatty over a network.

We may want to call board.setSamplingInterval(board.options.samplingInterval); whether or not we opt in for options.skipCapabilities as long as options.samplingInterval is set because someone could turn on reporting on a specific pin and their samplingInterval rate would be ignored.

I doesn't require a callback. Perhaps the call to set the sampling rate can be sent right after report version gets back?

This comment has been minimized.

@rwaldron

rwaldron Jul 30, 2014

Collaborator

Let's give that a try :)

rwaldron added a commit that referenced this pull request Aug 11, 2014

rwaldron added a commit that referenced this pull request Aug 11, 2014

rwaldron added a commit that referenced this pull request Aug 11, 2014

rwaldron added a commit that referenced this pull request Aug 11, 2014

rwaldron added a commit to rwaldron/firmata that referenced this pull request Aug 11, 2014

rwaldron added a commit to rwaldron/firmata that referenced this pull request Aug 11, 2014

rwaldron added a commit that referenced this pull request Aug 11, 2014

rwaldron added a commit that referenced this pull request Aug 12, 2014

Set port and pin reporting only when pinMode is INPUT or ANALOG. Fixes
…gh-69. Closes gh-65. Closes gh-58

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>

rwaldron added a commit that referenced this pull request Aug 12, 2014

Set port and pin reporting only when pinMode is INPUT or ANALOG. Fixes
…gh-69. Closes gh-65. Closes gh-58

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>

rwaldron added a commit to rwaldron/firmata that referenced this pull request Nov 3, 2014

@rwaldron rwaldron closed this in d58e195 Nov 3, 2014

jacobrosenthal pushed a commit to jacobrosenthal/firmata that referenced this pull request Jul 9, 2015

Merge pull request firmata#58 from soundanalogous/due-and-teensy3
Adds support for Arduino Due and Teensy 3.0 boards
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment