FirstLegoLeague / fllscoring

FLL Scoring app. See Demo:
http://firstlegoleague.github.io/fllscoring/
GNU General Public License v2.0
14 stars 19 forks source link

Think about QR communication between devices #17

Closed rikkertkoppes closed 6 years ago

rikkertkoppes commented 10 years ago

A low level peer 2 peer communication between devices may be done by QR codes.

For score transfer: encode all scores as a json map of team numbers and scores:

{
    12354: 209,
    53923: 305
}

Encode as QR, display, read by other device

For final ranking, we may do the same. Encode a small json ranking and transfer via QR to another device

Goal of this case

Research this a bit, there is a QR plugin for phonegap. We should also be able to generate a QR code locally, so no qoogle web service to generate it.

Then, implement it in the ranking tab.

Use case

I see this as a failover mechanism. Suppose you've gathered some scores on multiple devices. To be able to create a ranking, all these scores need to be combined. Then, all modes of communication fail. No wifi, no gsm.

The last option is to read scores from a device (with eyes) and write them (with hands) in one application to provide a final ranking (can be a device or computer). To speed this up a bit, we can transfer the information between camera enabled devices / laptops via qr code. This way, gathering all information to create a ranking is still possible.

rikkertkoppes commented 10 years ago

@nickygerritsen this may be a nice one for you to work on

kmeesters commented 10 years ago

A good suggestion, but QR codes are not always easility scanned on a laptop. Also know that the lighting/stress (shaking) circumstances might be prove challenging for scanning sometimes.

Which doesn't mean I don't like this idea, but there are some practilities we have the consider. I do defintly see added value in a tournament where the central application is run a mobile device. So you can merge all your devices in the central app.

nickygerritsen commented 10 years ago

Research this a bit, there is a QR plugin for phonegap. We should also be able to generate a QR code locally, so no qoogle web service to generate it.

There probably is a javascript library I guess. That way it works everywhere right?

A good suggestion, but QR codes are not always easility scanned on a laptop.

Scanning on a laptop is indeed a problem. I'm not sure how to solve this yet.

Also know that the lighting/stress (shaking) circumstances might be prove challenging for scanning sometimes.

I think we can assume the device that presents the QR code has a backlit display right? I don't there are that many non-backlit devices there anymore. In that case lighting will not be a big problem I guess. Stress can be an issue, but I think this will not be that big...

rikkertkoppes commented 10 years ago

There probably is a javascript library I guess. That way it works everywhere right?

Yes:

https://github.com/jeromeetienne/jquery-qrcode https://github.com/tobiasquinn/qrcoder/blob/master/js/qrcoder.js#L1-L18

nickygerritsen commented 10 years ago

I found some with bower:

http://sindresorhus.com/bower-components/#!/search/qrcode

One is using an angular directive

Edit: ah you added some too….

rikkertkoppes commented 10 years ago

There is also https://github.com/LazarSoft/jsqrcode which could make scanning work in node WebKit.

You could use the same approach as I did with the file system to abstract away different implementations for different platforms

nickygerritsen commented 10 years ago

Yes that is an idea. But scanning could also be the same on all platforms right? What other scanning would we do on iOS? The only difference is how we get the image? On mobile devices we use the phonegap camera app and on node webkit / local server we can use http://www.taboca.com/p/camcanvas/, as linked by the jsqrcode page

rikkertkoppes commented 10 years ago

The difference is that for scanning, phonegap can use native libs to scan, recognize and decode, while in a browser you can only use the above js implementation

I have been thinking about a webgl implementation in the browser to parallellize a scanner, but no success yet (the js scanner is pretty slow)

nickygerritsen commented 10 years ago

Ah yes of course you can use native code to decode QR codes on mobile devices :)

Edit: ah nice, there is a 3rd party phonegap plugin that does exactly that. So then indeed we could abstract away the exact implementation. On the desktop it would require a little bit more work as we would need to display the Ui ourselves.

nickygerritsen commented 10 years ago

So then the idea is two-sided:

rikkertkoppes commented 10 years ago

Yes

nickygerritsen commented 10 years ago

OK I will try to work on it soon. And you're right about node-webkit of course