Hi - I think probably your best solution is to put literally just NRF.nfcURL('https://www.yourwebpage.com'); on the Puck.js
NRF.nfcURL('https://www.yourwebpage.com');
Then, the Student's device will load that webpage from the server - and that would trigger your PHP to run which could record the current time.
To stop the chances of a URL getting shared or reloaded, you could maybe do:
var counter = 0; NRF.nfcURL('https://www.yourwebpage.com?id='+counter); NRF.on('NFCoff', function() { counter++; NRF.nfcURL('https://www.yourwebpage.com?id='+counter); });
Note we do it on NFCoff - which will happen when the phone is away, so there is no 'race' between preparing the NFC packet and having it read.
That way your PHP could discount any IDs that were the same, and it also reduces the chances of the page getting cached and your PHP not getting run
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi - I think probably your best solution is to put literally just
NRF.nfcURL('https://www.yourwebpage.com');
on the Puck.jsThen, the Student's device will load that webpage from the server - and that would trigger your PHP to run which could record the current time.
To stop the chances of a URL getting shared or reloaded, you could maybe do:
Note we do it on NFCoff - which will happen when the phone is away, so there is no 'race' between preparing the NFC packet and having it read.
That way your PHP could discount any IDs that were the same, and it also reduces the chances of the page getting cached and your PHP not getting run