Avatar for Frida

Frida

Member since Sep 2013 • Last active Jul 2020
  • 25 conversations
  • 202 comments

Most recent activity

  • in ESP8266
    Avatar for Frida
    // lan-test00 - esp8266_01
    
    var ver = 'ver = V1.0';
    
    function onInit(a) {
      debug = (typeof a==='undefined')?0:a;
      var wlan     = require("Wifi");
      var http     = require("http");
      var logon    = require('LOGON');
    
    
      wlan.stopAP();
      wlan.disconnect();
    
    
      var boola;
      function lan() {
        //wlan.connect(yourssid, {password: yourpassword}, function (s) {
        wlan.connect(logon.ssid, {password: logon.pass}, function (s) {
          boola = true;
          if(s==='bad password') {
            if(debug)console.log('restart lan');
            lan();
          }
        });
    
        if(debug)console.log("Frida is my watchdog");
        if(debug)console.log(wlan.getIP().ip);
      } // end lan()
      setTimeout(lan,400);
    
    
      wlan.on('connected', function(s) {
        if(debug)console.log('Starter test', wlan.getIP().ip);
        if(boola) {
          boola = false;
          //do what you need to do.
          if(debug)console.log('tilsluttet lan');
        }
      });
    
    } // end onInit()
    
    onInit(2); // comment or remove before save
    
    
    
    

    You should not use logon and use your own logon values instead. That's because I have my logon values in a module.
    I use debug until the program runs properly.

  • in ESP8266
    Avatar for Frida

    That mistake I had several years ago
    It turned out that one of my routers was teasing.
    I use the showed up start and since then there have been no problems.
    The other routers have no problems.

      function lan() {
        wlan.connect(logon.ssid, {password: logon.pass}, function (s) {
          boola = true;
          if(s==='bad password') {
            if(debug>0) {console.log('restart lan');}
            lan();
          }
        });
    
        if(debug)console.log("Frida is my watchdog");
        if(debug)console.log(wlan.getIP().ip);
      } // end lan()
    
      setTimeout(lan,400);
    
      
      wlan.on('connected', function(s) {
        if(debug)console.log('Starter test', wlan.getIP().ip);
        if(boola) {
          boola = false;
          startTimeServer();
          //httpSrv.listen(80);
        }
      });
    
    
  • in Bangle.js
    Avatar for Frida

    The menu wraps around, but the time setting doesn't.
    Eg. 55 to 10, I have to push backwards 45 times.
    Eg. 5 to 50, I have to press forwards 45 times.

  • in Bangle.js
    Avatar for Frida

    Vibrator works.
    Beep does not work.

  • in ESP8266
    Avatar for Frida

    I use function() instead of ()=>, because it doesn't work in my browser.
    And to stop analogWrite, use digatalRead.

    // sinus.js
    
    //setInterval( ()=> {analogWrite(D2, (Math.sin(getTime()) / 2.01) + 0.5 );},10);
    
    
    //setInterval( function() {analogWrite(D2, (Math.sin(getTime()) / 2.001) + 0.5 );},10);
    
    analogWrite(D2, 0.5, {freq:1000});
    
    //setTimeout(function() {analogWrite(D2, 0);},1700);
    
    setTimeout(function() {digitalRead(D2);},10);
    
    
  • in General
    Avatar for Frida

    WARNING: Flash size arguments in megabits like '4m' are deprecated.
    Please use the equivalent size '512KB'.
    As you can see '4m' is megabits
    and '512KB' is in kilobytes
    as 1 byte is 8 bit.

    Happy coding.

  • in General
    Avatar for Frida

    And I grab it from here:

    http://www.espruino.com/binaries/travis/­master/
    
  • in General
    Avatar for Frida

    I use this:

    *** To flash a 512KB esp8266 (e.g. esp-01) using the serial port use:
    esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash \
      --flash_freq 40m --flash_mode qio --flash_size 4m \
      0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin \
      0x7C000 esp_init_data_default.bin 0x7E000 blank.bin
    
    

    because it is only 512KB

Actions