Avatar for user91917

user91917

Member since Jul 2018 • Last active Aug 2018
  • 1 conversations
  • 4 comments

Most recent activity

  • in Projects
    Avatar for user91917

    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");
           })
    
    })
    
  • in Projects
    Avatar for user91917

    Thanks for responding! Great news about the easy setup of the button.

    Both buttons will be pressed pretty frequently. Maybe 10-20 times each per minute.
    Ideally the lag between a button press and the variable change is < 2 seconds.

    Twilio would be sending a basic SMS text message when the variable (integer) are at a specific value.

    EDIT: It would be awesome if the script could run locally on one of the boards if it minimized delay, but then I would somehow have one board send the HTTP request to the other board running as an Express server or something. Is this possible?

  • in Projects
    Avatar for user91917

    I need two battery powered buttons that will change the change the state of a variable within a single node js script.
    So what I'm currently planning is ordering two esp wifi units: https://shop.espruino.com/espruino-wifi

    Then figuring out how to power them, figure out how wire up a push button and having them each make an HTTP post request to a server running the script when each button is pressed. The script will be monitoring the state of the variables and use the Twilio API to send me a text when they are at a desired state.

    Is this the best solution? How hard would this be for someone with little to no electronics experience?

    I'm not familiar with how to power the boards, it's via pins? Any recommended push buttons?

Actions