cc3300 on speed

Posted on
  • I am using cc3000 with service pack 1.24, as I got with my kickstarter espruino long time ago.

    Well, now I can get 17,900 packets on an hour, with a average throughput on 4.99 packets per second, until I get an "Unable to locate host" message.

    I took my cc3000 and connected it to my propeller, and wrote a spin driver to study the behavior of cc3000. When I could transmit 25.000 packets I began to study the c code on espruino and have now changed a bit.

    To be continued.

    update:
    37,707 packets in 9209 second, which is 4.09 packets/second.
    I had to stop, because it is sleeping time.

  • I got 47,909 packet before I was hanging with a "HCI_CMND_SELECT", but now I get past "Unable to locate host", I still continue, but now it takes an hour to 1 and a half hour, before the error appears.

  • 
    // cc3000_connect
    
    
    
    pinMode(A10,'input_pullup');
    
    setBusyIndicator(LED3);        // GUL
    
    setWatch(function() {
      console.log("----------Interrupt--------­--");
    }, B8, { repeat: true, edge: 'falling', debounce: 50 });
    
    
    id0 = setInterval(function(){
      digitalPulse(LED2,1,70);    // BLÅ
    },500);
    
    var i = 0;
    var alt = false;
    var bool = false;
    var http = require("http");
    
    var wlan = require("CC3000").connect();
    
    
    wlan.connect( "Propeller", "thaeBoLiit", function (s) {
      if (s=="dhcp") {
        console.log("MY IP is " + wlan.getIP().ip);
        bool = true;
    //    test();
      }
    });
    
    
    console.log("Frida is my watchdog");
    //console.log(process.memory());
    
    function test() {
    
      if(bool){
        bool = false;
        alt = !alt;
        if(alt){
          httpa = "http://www.pur3.co.uk/hello.txt";
        }else{
          httpa = "http://www.pur3.co.uk/time.php";
        }
        http.get(httpa, function(res)
        {
          digitalWrite(LED1,1);            // RØD
          res.on('data', function(data) {
            console.log(i + " > " + data);
          });
          res.on('close', function() {
            data = " ";
            digitalWrite(LED1,0);          // RØD
            bool = true;
            i++;
    
            id1 = setInterval(function(){
              clearInterval(id1);
              test();
            },10); //1000 ms
    
          });
        });
    
      }else{
        console.log(i + " ----missed----");
      }
    //  i++;
      if(i == 1000){
    //    changeInterval(id0, 200);
    //    console.log(process.memory());
      }
    } // test end
    
    /*
    ' why cant this work
    setWatch(function() {
      console.log("Button pressed");
    }, BTN, { repeat: true, edge: 'rising', debounce: 50 });
    */
    // you'll need to use  edge: 'falling' if you connected the button to 0v 'rising'
    
    /*
    dont insert a line after i+
    f.eks. i = i + 5;
    then I got no ready sign
    even a comment // do not insert something here!
    */
    
    

    This is my testscript for the moment.

  • So what did you change? I know WiFi performance can be improved by increasing the CC3000 (and http) buffer size, but it's a statically allocated buffer that I was trying to get small.

    When "Unable to locate host" appears, does it keep appearing, or is it only once or twice? It wouldn't surprise me if the WiFi connection dropped once or twice over the course of a few hours, but hopefully it would reconnect in the end.

  • I have got 65.533 packets in 3 hours and 38 minutes, which corresponds to 5.00 packets / second.
    My counter will not count to more than 65,534, then I only got Nan for a while, until it stopped.
    I hunt for a $ 1008 error, I have got it at 4000, or from 15 to 20,000 packages, the last error I got at 55,291.
    I use "jsError ()" in my printing, it was the only print I could find.
    I have now survived two "Unable to locate host"
    one in 21,401 and one in 42,893 packages, without a single "CC3000 WiFi is not responding. Power cycling ...".

    
    ERROR: --- --- Close --- ---
    >65529 > 17:48:17
    ERROR: --- --- Close --- ---
    >65530 > Hello World!
    
    ERROR: --- --- Close --- ---
    >65531 > 17:48:17
    ERROR: --- --- Close --- ---
    >65532 > Hello World!
    
    ERROR: --- --- Close --- ---
    >65533 > 17:48:17
    ERROR: --- --- Close --- ---
    >65534 > Hello World!
    
    ERROR: --- --- Close --- ---
    >WARNING: Prototype is not an Object, so setting it to {}
    >function () { [native code] } > 17:48:18
    ERROR: --- --- Close --- ---
    >ERROR: Try once more ---- 3 -- typ ($0) -- soll ($1010) -- ist ($0) -- count ($7f)
    ERROR: Try once more ---- 3 -- typ ($0) -- soll ($1010) -- ist ($0) -- count ($7e)
    ERROR: Try once more ---- 3 -- typ ($0) -- soll ($1010) -- ist ($0) -- count ($7d)
    >NaN > Hello World!
    
    ERROR: --- --- Close --- ---
    >NaN > 17:48:18
    ERROR: --- --- Close --- ---
    >NaN > Hello World!
    
    ERROR: --- --- Close --- ---
    >NaN > 17:48:19
    ERROR: --- --- Close --- ---
    >NaN > Hello World!
    
    ERROR: --- --- Close --- ---
    >NaN > 17:48:19
    ERROR: --- --- Close --- ---
    >NaN > Hello World!
    
    
    ERROR: --- --- Close --- ---
    >NaN > 17:50:36
    ERROR: --- --- Close --- ---
    >NaN > Hello World!
    
    ERROR: --- --- Close --- ---
    >NaN > 17:50:36
    ERROR: --- --- Close --- ---
    >NaN > Hello World!
    
    ERROR: --- --- Close --- ---
    >NaN > 17:50:37
    ERROR: --- --- Close --- ---
    >Uncaught SyntaxError: Got ?[22] expected EOF
     at line 2 col 7
          gitalWrite(LED1,1);            // R\D8D
           ^
    in function called from system
    >ERROR: --- --- Close --- ---
    >
    
    >process.memory()
    ={ "free": 1998, "usage": 252, "total": 2250, "history": 161, 
      "stackEndAddress": 536910324, "flash_start": 134217728, "flash_binary_end": 223988, "flash_code_start": 134443008, "flash_length": 262144 }
    >
    
    
  • A little progress, I have now survived 6 "Unable to locate host" in 7 and a half hour with 0.8384 packets/sec., without "CC3000 WiFi is not responding. Power cycling ..."..
    Now on to long term test, to see if I can get it faster.
    Bedtime now.

  • Yesterday I got 47.700 packets on 5 hours, before I got: "Connect failed (err -1)" and "Not connected to the internet"
    Today I got 75.900 packets on 8 ours, before I got: "Socket error -1 while sending"
    With a receiving speed of 2.58 packets/sec.

    I have now made changes to 7 files:

    libs/network/socketserver.c

    libs/network/cc3000/board_spi.c
    libs/network/cc3000/evnt_handler.c
    libs/network/cc3000/hci.c
    libs/network/cc3000/network_cc3000.c
    libs/network/cc3000/socket.c
    libs/network/cc3000/wlan.c

    And still testing

  • 
    > ERROR: --- --- Open  socket ---($0) ---
    >0  14727 > 02:13:28
    ERROR: --- --- Close socket --- ---
    > ERROR: --- --- Open  socket ---($0) ---
    > ERROR: --- --- net_cc3000_send 0 --- ($0)---
    > 0  14728 > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//
    > 0  14728 > EN">
    <html><head>
    <title>408 Request Time-out</title>
    </head><bo
    > 0  14728 > dy>
    <h1>Request Time-out</h1>
    <p>Server timeout waiting for the 
    > 0  14728 > HTTP request from the client.</p>
    <hr>
    <address>Apache/2.2.14 (U
    > 0  14728 > buntu) Server at mini.morphyre.com Port 80</address>
    </body></ht
    > 0  14728 > ml>
    
    > ERROR: --- --- Select error  200 --- ---
    ERROR: --- --- net_cc3000_recv 1 --- ---
    ERROR: --- --- Close socket --- ---
    > ERROR: --- --- Open  socket ---($0) ---
    > 0  14729 > 02:13:48
    ERROR: --- --- Close socket --- ---
    
    

    This morning seems good, I have now survived 3 x "Server timeout" and 7 x "Unable to locate host" in 8 and a 1/2 hour, and still running.

  • Has now passed 12 hours and it is still running.
    edit: Now more than 18 hours.

  • Sounds good...

    I still don't really understand what you've changed though?

  • 
    > ERROR: --- --- Open  socket ---($0) ---
    > 0  65532 > 17:22:47
    ERROR: --- --- Close socket --- ---
    > ERROR: --- --- Open  socket ---($0) ---
    ERROR: Try once more ---- 3 -- typ ($0) -- soll ($1007) -- ist ($0) -- count ($7f)
    ERROR: Try once more ---- 3 -- typ ($0) -- soll ($1007) -- ist ($0) -- count ($7e)
    ERROR: Try once more ---- 3 -- typ ($0) -- soll ($1007) -- ist ($0) -- count ($7d)
    > 0  65533 > 17:22:48
    ERROR: --- --- Close socket --- ---
    > ERROR: --- --- Open  socket ---($0) ---
    > 0  65534 > 17:22:48
    ERROR: --- --- Close socket --- ---
    > WARNING: Prototype is not an Object, so setting it to {}
    ERROR: --- --- Open  socket ---($0) ---
    > 0  function () { [native code] } > 17:22:49
    ERROR: --- --- Close socket --- ---
    > ERROR: --- --- Open  socket ---($0) ---
    > 0  NaN > 17:22:49
    ERROR: --- --- Close socket --- ---
    > ERROR: --- --- Open  socket ---($0) ---
    > 0  NaN > 17:22:49
    ERROR: --- --- Close socket --- ---
    
    

    Now it takes about 7 hours, before I get a fault.
    It is my counter that will only count to 65.534, before I get this fault.

    And a little later I got this

    
    > ERROR: --- --- Open  socket ---($0) ---
    > 0  NaN > 17:23:29
    ERROR: --- --- Close socket --- ---
    > ERROR: --- --- Open  socket ---($0) ---
    > 0  NaN > 17:23:30
    ERROR: --- --- Close socket --- ---
    >--- --- Try to find a host --- ---
    --- --- Try to find a host --- ---
    --- --- Try to find a host --- ---
    --- --- Try to find a host --- ---
    --- --- Try to find a host --- ---
    --- --- Try to find a host --- ---
    --- --- Try to find a host --- ---
     ERROR: Unable to locate host
    >
    
    

    I will continue to find the error.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

cc3300 on speed

Posted by Avatar for Frida @Frida

Actions