Avatar for Frida

Frida

Member since Sep 2013 • Last active Nov 2018
  • 24 conversations
  • 186 comments

Most recent activity

  • in ESP8266
    Avatar for Frida

    It is not only 'ESP8266', 'PICO' also has problems.

  • in ESP8266
    Avatar for Frida

    Some tests:

    Serial2.setup(9600,{});
    
    
    ERROR: *** PB *** baudRate = 9600
    ERROR: *** PB *** pinRX = 255
    ERROR: *** PB *** pinTX = 255
    ERROR: *** PB *** pinCK = 255
    ERROR: *** PB *** pinCTS = 255
    ERROR: *** PB *** bytesize = 8
    ERROR: *** PB *** PB0 = 11
    ERROR: *** PB *** PB1 = 22
    ERROR: *** PB *** PB2 = 33
    ERROR: *** PB *** parity = 0
    ERROR: *** PB *** stopbits = 1
    ERROR: *** PB *** PB3 = 44
    ERROR: *** PB *** PB4 = 55
    ERROR: *** PB *** PB5 = 66
    {  }
    

    By default setup, PB0, PB1 and PB2 are not touched.

    Serial2.setup(9600,{bytesize:7});
    
    ERROR: *** PB *** baudRate = 9600
    ERROR: *** PB *** pinRX = 255
    ERROR: *** PB *** pinTX = 255
    ERROR: *** PB *** pinCK = 255
    ERROR: *** PB *** pinCTS = 255
    ERROR: *** PB *** bytesize = 7
    ERROR: *** PB *** PB0 = 0
    ERROR: *** PB *** PB1 = 0
    ERROR: *** PB *** PB2 = 0
    ERROR: *** PB *** parity = 0
    ERROR: *** PB *** stopbits = 1
    ERROR: *** PB *** PB3 = 44
    ERROR: *** PB *** PB4 = 55
    ERROR: *** PB *** PB5 = 66
    { "bytesize": 7 }
    

    With this setup, PB0, PB1 and PB2 are overwritten.

    typedef struct {
      int baudRate;            /// FIXME uint32_t ???
      Pin pinRX;
      Pin pinTX;
      Pin pinCK;               ///< Clock, or PIN_UNDEFINED
      Pin pinCTS;              ///< Clear to send, or PIN_UNDEFINED
      unsigned char bytesize;  ///< size of byte, 7 or 8
      uint8_t PB0;              // insert PB
      uint8_t PB1;              // insert PB
      uint8_t PB2;              // insert PB
      unsigned char parity;    ///< 0=none, 1=odd, 2=even
      unsigned char stopbits;  ///< 1 or 2
      uint8_t PB3;              // insert PB
      uint8_t PB4;              // insert PB
      uint8_t PB5;              // insert PB
      bool xOnXOff;            ///< XON XOFF flow control?
      bool errorHandling;      ///< Whether to forward parity/framing errors
    } PACKED_FLAGS JshUSARTInfo;
    
    

    In the file 'jsserial.c' and in the function 'jsserialPopulateUSARTInfo' there are:

      jsvConfigObject configs[] = {
          {"rx", JSV_PIN, &inf->pinRX},
          {"tx", JSV_PIN, &inf->pinTX},
          {"ck", JSV_PIN, &inf->pinCK},
          {"cts", JSV_PIN, &inf->pinCTS},
          {"bytesize", JSV_INTEGER, &inf->bytesize},
          {"stopbits", JSV_INTEGER, &inf->stopbits},
    

    I do not know what it's doing, but it returns 4 bytes for 'bytesize' and 'stopbits', like 32 bits, but in 'JshUSARTInfo' they are set up as 'chars'

    That is, 'bytesize' overwrites 'parity, stopbits and xOnXOff'.

    It's worse with 'stopbits' because it will overwrite 'xOnXOff' and 'errorHandling' as well as write in an illegal address.

    Maybe we could get a 'JSV_CHAR' to these two.

    If I'm taking a'PICO 'and using:

    Serial2.setup(9600,{});
    
    No errors. Minified 2163 bytes to 70 bytes.
    >
     ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     2v00 (c) 2018 G.Williams
    >{  }
    

    There's nothing going on.

    
    Serial2.setup(9600,{bytesize:8});
    
    
    No errors. Minified 2173 bytes to 80 bytes.
    >
     ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     2v00 (c) 2018 G.Williams
    >Uncaught InternalError: Unsupported serial stopbits length.
     at line 1 col 32
    ...al2.setup(9600,{bytesize:8}),console.­log(Serial2._options),c...
                                  ^
    > 
    

    Which shows that stopbits are overwritten by 0.

    Hope it is understandable.

  • in ESP8266
    Avatar for Frida

    Hello @MaBe,
    Downloaded last version from 29 / 10-2018.
    Tested different things and found that 'ck' is not supported in software serial.
    One thing I figured out is that in 'serial2' when I use 'even' and I load the program again, 'esp8266' crashes. However, if I use 'Even', you can reload the program over and over again.
    Then try your software serial again without 'ck'.
    This time I use an 'uint16_t dummy; // insert PB', instead of 'char '

    PS. jeg har kun en ESP8266-01 med 512KB.

  • in ESP8266
    Avatar for Frida

    @MaBe,
    Try this, it compiles and loads without errors, but has not tried the communication.

    /// Settings passed to jshUSARTSetup to set it the USART up
    typedef struct {
      int baudRate;            /// FIXME uint32_t ???
      Pin pinRX;
      Pin pinTX;
      Pin pinCK;               ///< Clock, or PIN_UNDEFINED
      Pin pinCTS;              ///< Clear to send, or PIN_UNDEFINED
      unsigned char bytesize;  ///< size of byte, 7 or 8
      unsigned char parity;    ///< 0=none, 1=odd, 2=even
    '#if defined(ESP8266)
      unsigned char dummy;      // insert PB
      unsigned char dummy1;     // insert PB
    '#endif
      unsigned char stopbits;  ///< 1 or 2
      bool xOnXOff;            ///< XON XOFF flow control?
      bool errorHandling;      ///< Whether to forward parity/framing errors
    } PACKED_FLAGS JshUSARTInfo;
    
    
    
    Serial2.setup(9600,{rx:D12,tx:D13,ck:D14­,cts:D15,bytesize:8,parity:'even',stopbi­ts:1});
    
     1v94.209 Copyright 2017 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    Flash map 512KB:256/256, manuf 0xc8 chip 0x4013
    >
    =undefined
    >
    =undefined
    >
    =undefined
    >Se
    Serial3             Serial
    Serial2             Serial
    Serial1             Serial2
    Server
    >Seri
    Serial3             Serial
    Serial2             Serial
    Serial1             Serial2
    >Serial2._options
    ={ "rx": D12, "tx": D13, "ck": D14, "cts": D15,
      "bytesize": 8,
      "parity": "even",
      "stopbits": 1 }
    >
    =undefined
    
    

    '#if defined(ESP8266)
    '#endif
    Remove apostrophe in front of #

  • in Projects
    Avatar for Frida

    STM32F3DISCOVERY - USB BROKEN
    since sometime in version 1v8 ..
    Does not have the exact version, is on holiday at Fanø, Denmark

  • in General
  • in ESP8266
    Avatar for Frida

    I had problems with one of my router so I did this feature:

      var boola;
      function lan() {
        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;
          startTimeServer();
          if(debug)console.log('tilsluttet lan');
        }
      });
    
    
  • in Puck.js, Pixl.js and MDBT42
    Avatar for Frida

    Ordered a pair at 3dhubs.
    Will be here about 1 day or 2.
    Thank you for your drawings.

Actions