vs missing in response to video request
Currently trying to push video to netreceiver, but sending is failing due to a response error "vs missing". Note that Jack and I modified the http sender code such that it is doing a video request rather than a poll request, because, with a poll request there was an invalid pin error, presumably as a result from changes for new video handling functionality.
Comments (8)
-
-
reporter Apologies if It seemed I implied the problem lies in net-receiver - I actually thought it might be either netreceiver or netsender. From another look, I believe it might be an edit Jack and I made to netsender that was not thought out enough. We didn't consider the following in netsender.go:Send()
// extract var sum, which should be an integer, except when returned with vars var vs int if requestType == RequestVars { var val string val, err = extractJsonString(reply, "vs") if err != nil { return reply, reconfig, errors.New("vs missing") } vs, err = strconv.Atoi(val) if err != nil { return reply, reconfig, errors.New("vs not an integer") } } else { vs, err = extractJsonInt(reply, "vs") if err != nil { return reply, reconfig, errors.New("vs missing") } }
because we're using "RequestVideo" we're hitting the else, so the vs is wrongly being checked. I can have a go at fixing ?
-
We added in a request type called RequestVideo that used the /send URL for video (this might get changed in a PR). In the above mentioned code snippet we could change the else statement to be:
} else { if requestType != RequestVideo { vs, err = extractJsonInt(reply, "vs") if err != nil { return reply, reconfig, errors.New("vs missing") } } }
This will avoid the check. If you're happy with this I'll make the change.
-
The fix needs to be more general than that, since it is not just video requests that skip the varsum, but all requests for "vector data" (i.e., data that is more than a single scalar/number).
What I had in mind is that scalar data (A, D, X) continue to use /poll while vector data (V, B, T) use the new /recv.
Vidgrind already implements /recv, but I need to back port it to NetReceiver.
So: - Generalize RequestVideo to RecquestRecv - And use /recv for V, B, and T data
-
Not a problem, Easy fix.
-
Change made in commit 63bb1e1
https://bitbucket.org/ausocean/iot/commits/63bb1e122bef69a2c05c38a1d749ab56c75baca6
Will make a PR for the change once Saxon tests with revid
-
And I will update NetReciver to use /recv for T(ext), B(inary) and V(ideo) data.
-
reporter - changed status to resolved
Fix has been tested and merged.
- Log in to comment
The varsum (vs) is not supposed to be included in video requests, since it is an expensive operation. So this is a client issue, not a NetReceiver issue.