Avatar for werty1st

werty1st

Member since Sep 2015 • Last active Mar 2018
  • 2 conversations
  • 17 comments

Most recent activity

  • in Puck.js, Pixl.js and MDBT42
    Avatar for werty1st

    just an info how far i am. no help required.

    i think the puck crashes. i have to attach a serial console.

    Puck:

    var IrData = [];
    
    function setService(){
      NRF.setServices({
        0xBCDE : {
          
          0xFF01 : { /*clear buffer*/
            writable : true,
            onWrite : function(evt) {
              //digitalWrite([LED3,LED2,LED1], evt.data[0]);
              if (evt.data[0]==255){
                IrData = [];
                LED3.set();
                setTimeout(()=>{LED3.reset();},1000);
              }
            }
          },
          0xFF02 : { /*fill buffer*/
            writable : true,
            onWrite : function(evt) {
              var array1 = new Uint8Array(evt.data);
              array1.map(val=>{
                IrData.push(val/10);
              });
            }
          },
          0xFF03 : { /*exec buffer*/
            writable : true,
            onWrite : function(evt) {
              if (evt.data[0]==255){
                LED2.set();
                setTimeout(()=>{LED2.reset();},1000);
              }
              //Puck.IR(IrData);
            }
          },
          0xFF04 : { /*reserved*/
            writable : true,
            onWrite : function(evt) {
              console.log( new Uint8Array(evt.data));
            }
          }
        }
      });
    }
    
    setService();
    
    function advertise()
    {
      var voltage = Math.round( NRF.getBattery() * 1000)/1000 ;
      voltage = voltage.toString();
    
      var data = {
        0x180F : [Puck.getBatteryPercentage()],
        0x1801 : [ voltage.split('') ],
        0x1809 : [Math.round(E.getTemperature()+1 /*device specific offset*/)]
      };
    
      var options = {
        name: "Puck2",
        interval: 1000
      };
    
      NRF.setAdvertising(data,options);
    }
    advertise();
    

    Node Red send IR Payload in chunks

     msg.payload = [ 8.9111328125, 4.5166015625, 0.48828125, 0.6103515625, 0.48828125, 1.77001953125, 0.48828125, 0.6103515625, 0.48828125, 1.77001953125, 0.48828125, 1.77001953125, 0.45776367187, 1.77001953125, 0.48828125, 0.6103515625, 0.48828125, 1.77001953125, 0.45776367187, 0.64086914062, 0.48828125, 0.64086914062, 0.48828125, 0.6103515625, 0.48828125, 0.64086914062, 0.48828125, 0.64086914062, 0.48828125, 1.73950195312, 0.48828125, 0.64086914062, 0.48828125, 1.73950195312, 0.48828125, 0.64086914062, 0.48828125, 0.6103515625, 0.48828125, 1.77001953125, 0.48828125, 1.77001953125, 0.45776367187, 0.64086914062, 0.48828125, 0.6103515625, 0.48828125, 1.77001953125, 0.48828125, 0.6103515625, 0.54931640625, 1.708984375, 0.48828125, 1.77001953125, 0.45776367187, 0.64086914062, 0.48828125, 0.6103515625, 0.48828125, 1.77001953125, 0.48828125, 1.77001953125, 0.45776367187, 0.64086914062, 0.48828125, 1.77001953125, 0.45776367187, 41.015625, 8.94165039062, 4.48608398437, 0.51879882812, 0.57983398437, 0.48828125, 1.77001953125, 0.51879882812, 0.57983398437, 0.54931640625, 1.708984375, 0.51879882812, 1.73950195312, 0.45776367187, 1.77001953125, 0.51879882812, 0.57983398437, 0.54931640625, 1.67846679687, 0.48828125, 0.64086914062, 0.54931640625, 0.57983398437, 0.51879882812, 0.57983398437, 0.54931640625, 0.57983398437, 0.54931640625, 0.57983398437, 0.51879882812, 1.708984375, 0.54931640625, 0.57983398437, 0.48828125, 1.73950195312 ];
    
    var data = msg.payload;
    
    //return if no array
    if (!Array.isArray(data)){
        msg.payload = [];
        return msg;
    }
    
    //float to byte
    var byteArray = data.map(i=> Math.min(Math.max( Math.round(i*10), 1), 255) );
    
    var len = byteArray.length;
    var steps = Math.floor(len / 20);
    var outArrays = [];
    var i = 0;
    while (i < len) {
        outArrays.push(byteArray.slice(i, i += 20));
    }
    
    outArrays.map(data=>{
        msg.payload = data;
        node.send(msg);
    })
    
    

    EspruinoHub
    commit 97871d43d66edaefd47fb4f577008aedd82b1035­
    Author: Gordon Williams gw@pur3.co.uk
    Date: Tue Feb 20 10:17:05 2018 +0000

    <MQTT> Connected
    <HTTPProxy> Bleno State poweredOn
    <HTTPProxy> Bleno.startAdvertising Success
    <HTTPProxy> Bleno.setServices Success
    <Discover> Starting scan...
    <Discover> Scanning started.
    <MQTT> /ble/write/e9:05:8c:a7:64:ab/BCDE/FF01 => "255"
    <Discover> Scanning stopped.
    <Connect> e9:05:8c:a7:64:ab: Connecting...
    <Connect> Connected.
    <Connect> e9:05:8c:a7:64:ab: Getting Service...
    <MQTT> /ble/write/e9:05:8c:a7:64:ab/BCDE/FF01 => "255"
    <Connect> e9:05:8c:a7:64:ab: found service: bcde
    <Connect> e9:05:8c:a7:64:ab: found characteristic: ff01
    <Connect> e9:05:8c:a7:64:ab: Written.
    <Connect> e9:05:8c:a7:64:ab: Written.
    <MQTT> /ble/write/e9:05:8c:a7:64:ab/BCDE/FF02 => "[89,45,5,6,5,18,5,6,5,18,5,18,5,18,5,6,­5,18,5,6]"
    <Connect> e9:05:8c:a7:64:ab: Getting Service...
    <MQTT> /ble/write/e9:05:8c:a7:64:ab/BCDE/FF02 => "[5,6,5,6,5,6,5,6,5,17,5,6,5,17,5,6,5,6,­5,18]"
    <MQTT> /ble/write/e9:05:8c:a7:64:ab/BCDE/FF02 => "[5,18,5,6,5,6,5,18,5,6,5,17,5,18,5,6,5,­6,5,18]"
    <MQTT> /ble/write/e9:05:8c:a7:64:ab/BCDE/FF02 => "[5,18,5,6,5,18,5,89,45,5,6,5,18,5,6,5,1­7,5,17,5]"
    <MQTT> /ble/write/e9:05:8c:a7:64:ab/BCDE/FF02 => "[18,5,6,5,17,5,6,5,6,5,6,5,6,5,6,5,17,5­,6,5]"
    <MQTT> /ble/write/e9:05:8c:a7:64:ab/BCDE/FF02 => "[17,5,6,5,6,5,18,5,18,5,6,5,6,5,18,5,6,­5,18,5]"
    <MQTT> /ble/write/e9:05:8c:a7:64:ab/BCDE/FF02 => "[17,5,6,5,6,5,18,5,18,5,6,5,18,5,255,89­,45,5,6,5]"
    <MQTT> /ble/write/e9:05:8c:a7:64:ab/BCDE/FF02 => "[18,5,6,5,18,5,18,5,18,5,6,5,18,5,6,5,6­,5,6,5]"
    <MQTT> /ble/write/e9:05:8c:a7:64:ab/BCDE/FF02 => "[6,5,6,5,18,5,6,5,18,5,6,5,6,5,17,5,18,­5,6,5]"
    <MQTT> /ble/write/e9:05:8c:a7:64:ab/BCDE/FF02 => "[6,5,18,5,6,5,18,5,18,5,6,5,6,5,18,5,18­,5,6,5]"
    <MQTT> /ble/write/e9:05:8c:a7:64:ab/BCDE/FF02 => "[18,5,3,6,1,42]"
    <Connect> e9:05:8c:a7:64:ab: found characteristic: ff02
    <MQTT> /ble/write/e9:05:8c:a7:64:ab/BCDE/FF03 => "255"
    <Connect> e9:05:8c:a7:64:ab: Disconnecting due to lack of use (after 10 secs)
    <Connect> e9:05:8c:a7:64:ab: Disconnecting.
    <Connect> e9:05:8c:a7:64:ab: Disconnected
    
    Wed Feb 21 2018 22:20:01 GMT+0100 (CET)
    
    45:68:9e:41:77:b4 - ? (RSSI -58)
      fe9f => {"type":"Buffer","data":[0,0,0,0,0,0,0,0­,0,0,0,0,0,0,0,0,0,0,0,0]}
    69:23:86:23:8f:47 - ? (RSSI -62)
      fe9f => {"type":"Buffer","data":[0,0,0,0,0,0,0,0­,0,0,0,0,0,0,0,0,0,0,0,0]}
    6e:d0:2f:84:f7:06 - ? (RSSI -87)
      fe9f => {"type":"Buffer","data":[0,0,0,0,0,0,0,0­,0,0,0,0,0,0,0,0,0,0,0,0]}
    6f:c6:f2:d8:2a:93 - ? (RSSI -71)
      fe9f => {"type":"Buffer","data":[0,0,0,0,0,0,0,0­,0,0,0,0,0,0,0,0,0,0,0,0]}
    googlB - ? (RSSI -83)
      fe9f => {"type":"Buffer","data":[0,0,0,0,0,0,0,0­,0,0,0,0,0,0,0,0,0,0,0,0]}
    Puck1 - Puck1 (RSSI -88)
      1801 => {"type":"Buffer","data":[51,46,53,57,57]­}
      1809 => {"temp":19}
      180f => {"battery":100}
    Puck2 - Puck2 (RSSI -87)
      1801 => {"type":"Buffer","data":[50,46,55,52,49]­}
      1809 => {"temp":23}
      180f => {"battery":89}
    
    
    • 3 comments
    • 340 views
  • in Puck.js, Pixl.js and MDBT42
    Avatar for werty1st

    Hi,

    i try to send some IR Codes via nodered + mqtt + puck to turn on my soundbar on chromecast activity.

    msg.payload =  [ 8.9111328125, 4.5166015625, 0.48828125, 0.6103515625, 0.48828125, 1.77001953125, 0.48828125, 0.6103515625, 0.48828125, 1.77001953125, 0.48828125, 1.77001953125, 0.45776367187, 1.77001953125, 0.48828125, 0.6103515625, 0.48828125, 1.77001953125, 0.45776367187, 0.64086914062, 0.48828125, 0.64086914062, 0.48828125, 0.6103515625, 0.48828125, 0.64086914062, 0.48828125, 0.64086914062, 0.48828125, 1.73950195312, 0.48828125, 0.64086914062, 0.48828125, 1.73950195312, 0.48828125, 0.64086914062, 0.48828125, 0.6103515625, 0.48828125, 1.77001953125, 0.48828125, 1.77001953125, 0.45776367187, 0.64086914062, 0.48828125, 0.6103515625, 0.48828125, 1.77001953125, 0.48828125, 0.6103515625, 0.54931640625, 1.708984375, 0.48828125, 1.77001953125, 0.45776367187, 0.64086914062, 0.48828125, 0.6103515625, 0.48828125 ];
    

    Topic:

    /ble/write/e9:05:8c:a7:64:ab/BCDE/ABCE
    

    The Problem is that the EspruinoHub crashes after it receives the message:

    <MQTT> /ble/write/e9:05:8c:a7:64:ab/BCDE/ABCE => "[8.9111328125,4.5166015625,0.48828125,0­.6103515625,0.48828125,1.77001953125,0.4­8828125,0.6103515625,0.48828125,1.770019­53125,0.48828125,1.77001953125,0.4577636­7187,1.77001953125,0.48828125,0.61035156­25,0.48828125,1.77001953125,0.4577636718­7,0.64086914062,0.48828125,0.64086914062­,0.48828125,0.6103515625,0.48828125,0.64­086914062,0.48828125,0.64086914062,0.488­28125,1.73950195312,0.48828125,0.6408691­4062,0.48828125,1.73950195312,0.48828125­,0.64086914062,0.48828125,0.6103515625,0­.48828125,1.77001953125,0.48828125,1.770­01953125,0.45776367187,0.64086914062,0.4­8828125,0.6103515625,0.48828125,1.770019­53125,0.48828125,0.6103515625,0.54931640­625,1.708984375,0.48828125,1.77001953125­,0.45776367187,0.64086914062,0.48828125,­0.6103515625,0.48828125]"
    <Discover> Scanning stopped.
    <Connect> e9:05:8c:a7:64:ab: Connecting...
    <Connect> Connected.
    <Connect> e9:05:8c:a7:64:ab: Getting Service...
    <Connect> e9:05:8c:a7:64:ab: found service: bcde
    <Connect> e9:05:8c:a7:64:ab: found characteristic: abce
    /home/pi/EspruinoHub/lib/util.js:36
        buf.writeUInt8(o.charCodeAt(i), i);
                         ^
    
    TypeError: o.charCodeAt is not a function
        at Object.exports.obj2buf (/home/pi/EspruinoHub/lib/util.js:36:22)­
        at /home/pi/EspruinoHub/lib/connect.js:193:­41
        at /home/pi/EspruinoHub/lib/connect.js:63:9­
        at Service.<anonymous> (/home/pi/EspruinoHub/node_modules/noble­/lib/service.js:53:7)
        at Object.onceWrapper (events.js:315:30)
        at emitOne (events.js:116:13)
        at Service.emit (events.js:211:7)
        at Noble.onCharacteristicsDiscover (/home/pi/EspruinoHub/node_modules/noble­/lib/noble.js:261:13)
        at emitThree (events.js:136:13)
        at NobleBindings.emit (events.js:217:7)
    

    If i send the hole command as a string to /ble/write/e9:05:8c:a7:64:ab/nus/nus_tx it works.

    So i'm questioning what are the limitations for self defined Services?
    Can i send the IR Codes that way?

    How "looks" the evt.data Object of the onWrite function?
    How can one read that console.log as long as the puck is connected to the IDE?

    onWrite : function(evt) { // optional
            console.log("Got ", evt.data);
          }
    

    Thank you very much.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for werty1st

    With both of them. I already increased the

    setTimeout(job, 1000);
    

    to 2000 without success.

    I will try this command later:
    https://github.com/sandeepmistry/node-bl­uetooth-hci-socket#linux-1

  • in Puck.js, Pixl.js and MDBT42
    Avatar for werty1st

    Its a

    1. ID 0a5c:21e8 Broadcom Corp. BCM20702A0 Bluetooth 4.0
    2. ID 050d:065a Belkin Components F8T065BF Mini Bluetooth 4.0 Adapter

    Do you know why that happends? Doesn't the code stop scanning before sending?

  • in Puck.js, Pixl.js and MDBT42
    Avatar for werty1st

    The dongel has Bluetooth 4.0 and not 4.1.
    https://github.com/sandeepmistry/noble#b­leno-compatibility
    With a Raspi 3.0 its working.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for werty1st

    I cant send a write command to the puck:

    <Config> Config loaded
    <MQTT> Connecting...
    <HTTP> Server is listening on 1888
    <MQTT> Connected
    <HTTPProxy> Bleno State poweredOn
    <HTTPProxy> Bleno.startAdvertising Success
    <HTTPProxy> Bleno.setServices Success
    <Discover> Starting scan...
    <Discover> Scanning started.
    <MQTT> /ble/write/e9:05:8c:a7:64:ab/nus/nus_tx => "digitalPulse(LED3, 1, 200);\n"
    <Discover> Scanning stopped.
    <Connect> e9:05:8c:a7:64:ab: Connecting...
    <Connect> e9:05:8c:a7:64:ab: Error Connecting: Error: Command Disallowed (0xc)
    <Discover> Scanning started.
    

    I only found this information:
    https://github.com/sandeepmistry/noble/i­ssues/658

    I had a look into the EspruinoHub code and i saw that the scanning is interruptet if a write message needs to be sent.

    /* Write to the given device */
    exports.write = function(device, service, characteristic, data) {
      if (isBusy) {
        queue.push(function() { exports.write(device,service,characteris­tic,data); });
        return;
      }
      isBusy = true;
      getConnectedDevice(device, function(err, connection) {
        if (err) return setNotBusy();
    
        connection.getCharacteristic(util.uuid2n­oble(service), 
                                     util.uuid2noble(characteristic),
         function(err,char) {
           if (err) return setNotBusy();;
           writeToCharacteristic(char, util.obj2buf(data), function() {
               log(connection.name+": Written.");
               setNotBusy();
             });
         });
      });
    };
    

    and

    function serviceQueue() {
      if (!queue.length) {
        if (connections.length==0) // no open connections
          discovery.restartScan();
        return;
      }
      if (connections.length < MAX_CONNECTIONS) {
        var job = queue.shift();
        discovery.stopScan();
        setTimeout(job, 1000);  
      }
    }
    
    function setNotBusy() {
      isBusy = false;
      serviceQueue();
    }
    

    Can it still be related to the dongle i use?

  • in General
    Avatar for werty1st

    If i install the the espruino module local and not global it works:

    :~/Downloads/espruino$ node node_modules/espruino/bin/espruino-cli.j­s 
    Espruino Command-line Tool 0.0.36
    -----------------------------------
    
    Using first port, {"path":"/dev/ttyACM0","usb":[1155,22336­],"description":"Espruino board"}
    Connecting to '/dev/ttyACM0'
    |_|_|_|___|
              |_| http://espruino.com
     1v95 Copyright 2017 G.Williams
    
    >Connected
    
    
  • in General
    Avatar for werty1st

    Why can't i connect via terminal?

    espruino -p /dev/ttyACM0

    Espruino Command-line Tool 0.0.36

    Connecting to '/dev/ttyACM0'
    Port "/dev/ttyACM0" not found
    Unable to connect!

    The WebIDE works without a problem.

  • in Interfacing
    Avatar for werty1st

    not working:
    https://youtu.be/LK4eFga2P7E

    working:

    I think i will buy a new DCF receiver. i can get it to work but its not stable. not on the arduino nor on the espruino.

    Code:

    function wlan() {
    
      digitalWrite(B9,1); // enable on Pico Shim V2
      Serial2.setup(115200, { rx: A3, tx : A2 });
      var wifi = require("ESP8266WiFi_0v25").connect(Seri­al2, function(err) {
        if (err) throw err;
    
        wifi.reset(function(err) {
          if (err) throw err;
          console.log("Connecting to WiFi");
          wifi.getAPs(function(err, aps) {
            console.log("Scanning Aps");
            //console.log(aps);
          });
    
          wifi.connect("XXX","XXX", function(err) {
            if (err){
              return console.log("NO Wifi");
            }
    
            var myip;
    
            wifi.getIP(function(err, ip) {
              myip = ip;
              console.log("Connected to:",myip);
              //printscreen(myip,13);
            });
    
    
            var http = require("http");
            http.createServer(function (req, res) {
    
                var a = url.parse(req.url, true);
    
                text1 = (a.query && a.query.t1 || "");
                text2 = (a.query && a.query.t2 || "");
                
                if (a.query && (a.query.t1 || a.query.t2)){
                  printscreen(text1,10);
                  setTimeout(function(){printscreen(myip,1­3);},2500);
                }
    
                res.writeHead(200, {'Content-Type': 'text/html'});
                res.write('<html><head><meta name="viewport" content="width=320"/></head><body>');
                res.write('LCD Display:<input id="t1" value="'+text1+'" type="text"><br>');
                res.write('LCD Display:<input id="t2" value="'+text2+'"type="text"><br>');
                res.write('<input type="button" onclick="get()" value="senden"><br>');
                res.write('<script> function get(){var e;window.XMLHttpRequest&&(e=new XMLHttpRequest),e.onreadystatechange=fun­ction(){4==e.readyState&&200==e.status&&­console.log("done")};var t=document.getElementById("t1").value,n=­document.getElementById("t2").value;e.op­en("GET","lcd/?t1="+t+"&t2="+n,!0),e.sen­d()} </script>');
                res.end('</body></html>');
    
            }).listen(80);
    
    
          });
        });
      });
    
    }
    
    
    function onInit(){
      console.log("start");
      wlan();
      oled();
    }
    
    
    var img2 = {
      width : 32, height : 32, bpp : 1,
      transparent : 0,
      buffer : E.toArrayBuffer(atob("AAAAAAAAeAAAf/4AH/­+bAH/ABQBoAAeAaAADwHQAAf5aAfCfS/8/sUXP//­1G//AdQ/wAHUAAAB1AAAAdQAAAHWAAABNgAAAeYA­AAEOAAABDgAAAQ8AAAGPgAABz4AAAcfAAAnD4AP/­A+B//AHz//wA///4AAP+AAABgAAAAAAAA="))
    };
    
    function image(){
      //g.clear();
      g.drawImage(img2, 96, 0);
      //g.flip();
    }
    
    
    
    var g;
    function printscreen(line1,line2,size){
    
      if (init !== 0){
        clearTimeout(init);
        init=0;
      }
      g.clear();
      // write some text
      g.setFontVector(size);
      g.drawString(line1,2,2);
      g.drawString(line2,2,20);
      // write to the screen
      g.flip();
    
    }
    
    var init=0;
    var step=1;
    function clear(){
    
      var p;
      var p1=".  ";
      var p2=" . ";
      var p3="  .";
     
      if (step==1){
        p=p1;
      }
      if (step==2){
        p=p2;
      }
      if (step==3){
        p=p3;
      }
      step++;
      if (step == 4) step=1;
      
      g.clear();
      g.setFontVector(14);
      g.drawString("waiting "+p,2,4);
      
      image();
      g.flip();
      
      init=setTimeout(clear,300);
      
    }
    
    function oled(){
    
      digitalWrite(B4, LOW);
      digitalWrite(B4, HIGH);
      I2C2.setup({scl:B10, sda:B3});
      g = require("SSD1306").connect(I2C2, clear,{ height : 32 });
    
    }
    
    
    function DCF77(){
    
      // Decode 4 bits into a number
      function decode4(s) {
        return (0|s[0])*1 + (0|s[1])*2 + (0|s[2])*4 + (0|s[3])*8;
      }
    
      // xor all items in s and return the result (for parity checks)
      function xor(s) {
        var r = 0;
        for (var i=0;i<s.length;i++) r^=s[i];
        return r;
      }
    
      // decode the DCF77 time transmission
      function decode(d, callback) {
        if (xor(d.substr(21,7))!=d[28])
          return callback("Bad minutes");
    
        var minute = decode4(d.substr(21,4)) + decode4(d.substr(25,3))*10;
        if (xor(d.substr(29,6))!=d[35]) 
          return callback("Bad hours");
    
        var hour = decode4(d.substr(29,4)) + decode4(d.substr(33,2))*10;
        if (xor(d.substr(36,22))!=d[58]) 
          return callback("Bad date");
    
        var day = decode4(d.substr(36,4)) + decode4(d.substr(40,2))*10;
        var doy = decode4(d.substr(42,3));
        var month = decode4(d.substr(45,4)) + decode4(d.substr(49,1))*10;
        var year = decode4(d.substr(50,4)) + decode4(d.substr(54,4))*10;
        //console.log(hour+":"+minute+", "+day+"/"+month+"/"+year);
    
        var date = new Date(2000+year, month-1, day, hour, minute, 0, 0);
        return callback(null, date, { CEST:!!d[17], CET:!!d[18] } );
      }
    
    
      this.connect = function(dataPin, callback) {
        var dcf = {
          last : getTime(),
          bits : ""
        };
    
        setWatch(function (e) {  
          // Work out what bit we got
          var d = e.time-e.lastTime;
          console.log("pulsewidth:",(d*1000).toStr­ing().substring(0, 3));
          var bit = (d<0.12)?0:1;
          // if we had a 2 sec gap then it's the beginning of a minute
          if (e.time - dcf.last > 1.5) {
            decode(dcf.bits, callback);
            dcf.bits = "";
          }
          dcf.last = e.time;  
          // now add this bit of data
          dcf.bits += bit;
          if (dcf.bits.length>59)
            dcf.bits = dcf.bits.substr(-59);
        }, dataPin, { edge:"falling", repeat:true, debounce:60 });
    
        return dcf;
      };
    }
    
    
    
    var Clock = require("clock").Clock;
    var clk=new Clock(0);
    
    
      
    var dcf = new DCF77();
    dcf.connect(B6, function(err, date, info) {
      if (err){
        console.log("Invalid time received: " + err);
      }else{
        console.log(date.toString(), info);
        clk.setClock(date.getTime());
      }
    
    });
    
    
    var woche = ["So","Mo","Di","Mi","Do","Fr","Sa"];
    
    setInterval(function(){
      
      var date = clk.getDate();
      
      var weekday = date.getDay(); //0-31
      var wochentag = woche[weekday];
      
      var jahr = date.getFullYear();
      var monat = date.getMonth()+1; monat=(monat<10)?"0"+monat:monat;
      var tag = date.getDate();        tag=(tag<10)?"0"+tag:tag;
      
      var stunden = date.getHours(); stunden=(stunden<10)?"0"+stunden:stunden­;
      var minute = date.getMinutes();minute=(minute<10)?"0"­+minute:minute;
      var sek = date.getSeconds();   sek=(sek<10)?"0"+sek:sek;
      
      
      var s1 = wochentag+". "+tag+"."+monat+"."+jahr;
      var s2 = stunden+":"+minute+":"+sek;
      
      printscreen(s1,s2,10);
      
    },1000);
    
    
    
    save();
    
    
    
    
    

    @Gordon thank you for help.

Actions