You are reading a single comment by @user91917 and its replies.
Click here to read the full conversation.
-
Sorry I should've been more clear about size, the idea of powering them from power banks would be doable with my size requirements I think. Preferably they would be smaller than the amazon echo buttons.
I haven't coded any of the server for testing, but I can tomorrow with the URL and request format. It would be something like this:
const express = require('express'); const app = express(); const parser = require('body-parser'); let variableToChange = 0; app.use(parser.json()); app.use(express.static('client/build')); app.listen(8080, console.log('Listening on 3000')); app.get('/theEndPoint', (req, res) => { functionThatChangesVariable() .then(() => { res.send("CHANGED"); }) })
Espruino-WiFi can also run as a http server... simultaneously with sending http requests (posts/gets). On boot up of the button devices, they could register with your node.js server, so status could then be sent to just all of the button devices.
My question about the frequency was because of power supply. With expected frequency and expected minimal latency, disconnecting and powering off of wifi, and on button press, powering on wifi and reconnecting is not an option. I would have to measure stand-by power consumption... From reading between the lines and absence of any requirements regarding physical size, mobility, disconnection from a wall outlet, though, I assume power is not an issue....
Is your node.js server and its function - or a test version of it - Web accessible? If so I can give it a shot, shoot a clip and post. i need only the url and what to post... I can even post the phone no for the sms you want to send so it is sending it to that me.