Avatar for jimr1603

jimr1603

Member since Nov 2021 • Last active Feb 2022
  • 5 conversations
  • 10 comments

Most recent activity

  • in ESP8266
    Avatar for jimr1603

    I might try turning this into a full-blown tutorial for the pages, but in case that never gets started, here's the code I've copy-pasted together:

    
    var temperature;
    var humidity;
    
    var dht = require("DHT22").connect(D2);
    
    function onPage(req, res){
      var page = temperature + "," + humidity;
        res.writeHead(200, {'Content-Type': 'text/html'});
        res.end(page);
    }
    
    function writeScreen(){
      g.clear();
     g.drawString(temperature, 0, 0); 
      g.drawString(humidity, 0, 30);
     g.flip();
    }
    // I2C
    I2C1.setup({scl:D5,sda:D4});
    var g = require("SSD1306").connect(I2C1, writeScreen);
    g.setFont("4x6", 5);
    
    function readDHT(){
      dht.read(function(a) {
       temperature = a.temp.toString();
        humidity = a.rh.toString();
        console.log("Temp is "+a.temp.toString()+" and RH is "+a.rh.toString());
      });
      writeScreen();
    }
    
    
    setInterval(readDHT, 2000);
    
    require("http").createServer(onPage).lisĀ­ten(80);
    
    

    My node.red asks http://esp_hostname.local for the page, and parses it as csv.

  • started
    • 3 comments
    • 1,038 views
  • in ESP8266
    Avatar for jimr1603

    After getting the bangle 2, I realised I like this event-based loop more than arduino coding style, so I took a bit of yesterday afternoon to reprogram my home environment monitors to be espurinos.

    Hardware-wise 8266 + dht22 + cheap screen.

    I'm on the wrong pc right now, I'll copy-paste the code I threw on them, it's about 3 tutorials sewn together.

    They were sending mqtt to an internal mosquitto server, but it kept falling over and it's a pain to unplug all 3 to fix them wired in. Now the node-red box queries them with the super tiny webserver the espurino can hold. Bonus - I can reprogram them over the air, at least when I'm at the right computer.

  • in Bangle.js
    Avatar for jimr1603

    Success-ish - factory reset the watch, paired with Gadgetbridge 0.63.0. When I get a breather I'm going to attempt to upgrade GB and see if it still works.

  • in Bangle.js
    Avatar for jimr1603

    I'm on GB 0.63.1. Downgrading to 0.63.0 now...
    0.63.1 has in the changelog: bangle.js: fix crashes when playing music with some players.
    So they might have tweaked a setting that makes the android app invisible, or something.

  • in Bangle.js
    Avatar for jimr1603

    Awesome. If there was a props button I'd be spamming it - I could not get my head around 3 bit colour when I cracked open my first app.

  • in Bangle.js
    Avatar for jimr1603

    Hiya, in the last few days alerts have not appeared on my bangle2, and my (android) phone tells me the gadgetbridge app/plugin isn't on the watch.

    I was running the android app on the watch, successfully, until the last couple of days.

    For now I've 'fixed' it by shifting back to the gadgetbridge app.

    Have I messed up a setting, need to update something, or missed something easy?

  • in Bangle.js
    Avatar for jimr1603

    I've tweaked the example first app for something else that I wanted/needed - a 3 minute timer for my rest periods in the gym. Except I did it in binary for nerd cred and a random FB chat I was involved in.

    JS file attached, MIT licence as usual.

    • I think I've not got the button-press for reset registered entirely correctly, but putting that line anywhere else in the code made it not reset on countdown & out of time
    • next step would be throwing the reset time into the settings app - can anyone point me at the documentation for hooking up with settings? I'm failing at site navigtion.
Actions