Avatar for llakie

llakie

Member since Feb 2018 • Last active Mar 2018
  • 3 conversations
  • 8 comments

Most recent activity

  • in Pico / Wifi / Original Espruino
    Avatar for llakie

    Hi all,
    I have a question, where I really got stuck: Since my code grows in size, I'm encountering more and more often that the serial output is stuck telling me calculating size... and does not move on any bit.
    The whole console output is as follows:

    save()
    =undefined
    Compacting Flash...
    Calculating Size...
    

    Does anyone know why it gets stuck there? My code is compacted the size of roughly 40kb. I'm compacting using the online closure compiler.
    I have 4 precompiled functions using the Espruino compilation service.
    Thanks for your reply. I'm currently using the latest travis build (lv96.35)

  • in Pico / Wifi / Original Espruino
    Avatar for llakie

    Solved it :) It was like I expected. Wired the compass module directly to the 5V USB output on the board and it works now. I was just unsure, whether the module supports 5 Volts or not. Thank you data sheet - it does.

  • in Pico / Wifi / Original Espruino
    Avatar for llakie

    Hi there,
    I got the following problem:
    I want to the CMPS10 acceleromometer sensor and the Espruino Wifi at the same time. I'm now struggeling getting them to run smoothly. As soon as I call espruino_wifi.connect (whereas espruino_wifi references the EspruinoWiFi module) the data from I2C Bus freezes somehow and the sensor does not deliver any data anymore. I'm powering the sensor through the 3.3V output on the Espruino Board.
    Separatly they work beautifully.
    Thank you in advance for any idea :)

    The three numbers are readings from my sensor. As soon as the WiFi module kicks in, the values freeze.

    >Loading 48629 bytes from flash...
    0.00097657740  0.20996414129  0.88868543526
    0.01464866102  0.18359655146  0.93165484092
    0.04199282825  0.17578393224  0.95606927595
    >
    0.00585946440  0.19433890287  0.92677195391
    0.01367208361  0.17773708705  0.95411612115
    Connecting to access point using EspruinoWiFi module
    0.03027389944  0.14941634241  0.95020981155
    -0.01068131532  0.18359655146  0.93751430533
    -0.01556420233  0.16992446784  0.93556115053
    -0.01556420233  0.16992446784  0.93556115053
    -0.01556420233  0.16992446784  0.93556115053
    -0.01556420233  0.16992446784  0.93556115053
    -0.01556420233  0.16992446784  0.93556115053
    -0.01556420233  0.16992446784  0.93556115053
    Successfully connected to Access Point
    -0.01556420233  0.16992446784  0.93556115053
    -0.01556420233  0.16992446784  0.93556115053
    -0.01556420233  0.16992446784  0.93556115053
    -0.01556420233  0.16992446784  0.93556115053
    
  • Avatar for llakie

    Hi Gordon, I got it working.
    What did I do:

    • Use the ESP8266WiFi_0v25 library and connect to the onboard wifi controller. (Do manual Serial configuration as stated above)
    • Moved from latest travis build to normal v95 build.
    • Reinstalled the WebIDE since it was somehow responsible for not being able to load any module anymore (checked offline mode - it was off)
    • And now: it works like a charm.

    My problem with this HTTP stuff was related to the external ESP8266 in my opinion.

    Thank you very much for your immediate help.

  • Avatar for llakie

    Hi Gordon, the A13 and A14 set to high seemed to work for the WiFi module. But now I get the following error: "Pin A3 is not capable of USART1 RX". It does not make any difference when I do the Serial setup by myself or just take the EspruinoWifi module. Do you have any idea, what happened here?

  • Avatar for llakie

    Hi Gordon,
    I used the ESP8266WiFi_0v25 module and it works once now :) So when I power down my Espruino and power it up again, one request gets executed flawlessly. Any succeeding request gets stuck as before. But it's more than before. I will try whether I powered the integrated board down accidentially.

  • Avatar for llakie

    Hi Gordon,
    thank you for your reply. There is no serial connection possible anymore (Over Serial2 --> Serial2.setup(9600, { rx: A3, tx : A2 });). Any AT+* command could not be sent to the board since there seem to be no connection.
    I did not try to reflash the ESP8266 onboard module.(Is there a manual for that?)
    Is there any documentation of how to connect the flow control to the external WiFi module?

    The full code is as follows:

      Serial1.setup(115200, { rx: B7, tx : B6 });
      var esp8266 = require('ESP8266WiFi');
      
      console.log("Connecting to ESP8266");
      
      var wifi = esp8266.connect(Serial1, function() {
      console.log("Connecting to WiFi");
        wifi.reset(() => {
         /*Does not close all sockets, I assume --> CIPServer creation fails after some restarts of the Espruino*/
          console.log('Reset WiFi');
          console.log('Creating access point');
          wifi.createAP('BLA', '12345678', 1, 0, (err) => {
            if (err) {
              console.log('An error occured:');
              console.log(err);
              return;
            }
            
            console.log('Access Point created');
            
            require('http').createServer((req, res) => {
              req.on('end', function() {
                console.log('request stream end (http.incomingMessage stream)');
              });
              
              res.on('end', function() {
                console.log('response finish (http.serverResponse)');
              });
              
              req.on('close', function() {
                console.log('request close (http.incomingMessage)');
              });
    
              res.on('close', function() {
                console.log('response close (http.ServerResponse)');
              });
              
              console.log('Request Headers:');
              console.log(req.headers);
              console.log('Request Method:');
              console.log(req.method);
              
              var a = url.parse(req.url, true);
              res.writeHead(200, {'Content-Type': 'text/plain'});
              res.end(JSON.stringify(a));
            }).listen(80);
            
            console.log('Http server created');
          });
        });
      });
    
Actions