Member #616581

Member Since: November 11, 2014

Country: United States

  • For a single post i was actually able to get everything to work using the adafruit - i found my mistake for the 401 error. I had set the sparkfun cc3000 aside, but to doublecheck i ran it up again. It failed again with the adafruit examples. however, i ran their ping test again which shows firmware version and saw (as did their code - it wouldnt complete the test) that it was 1.1. I ran adafruit's update routine to v1.4, and now it seems to be working fine.

    My next problem, however, is getting m2x to do multiple feeds with the spakrfun library (or adafruit library). for multiple streams, m2x requires a time stamp. Since there is no example from SF for that gathering NTP time i tried to integrate the adafruit library, but i cannot get them to play nicely... Unfortunately the adafruit libraries dont seem to play nicely with the m2x libraries, so i cant use them on their own. I got one successful post out of many attempts and a lot of hours of trying to get complies etc with the adafruit. When i could get a compile, i usually got "-2" errors (aside from one 202 in the middle of 202's). I also tried to integrate both wifi libraries with the default WiFi examples, but the UDP stuff is beyond my level.

  • Has anyone had any success grabbing internet time via NTP? I think i have solved the compatibility issues with Time.h via changing the long to unsigned long...... on the line for time t. Unfortunately, trying to integrate adafruit's NTP code is proving harder than i can handle due to the function to grab ip address of the server: getHostByName. I tried making it lower case and changing the prefix to "wifi", but i cant seem to get it to compile:

    unsigned long getTime(void) {
    

    uint8_t buf[48]; unsigned long ip, startTime, t = 0L;

    Serial.print(F("Locating time server..."));

    // Hostname to IP lookup; use NTP pool (rotates through servers) if(cc3000.getHostByName("pool.ntp.org", &ip)) { static const char PROGMEM timeReqA[] = { 227, 0, 6, 236 }, timeReqB[] = { 49, 78, 49, 52 };

    Serial.println(F("\r\nAttempting connection..."));
    startTime = millis();
    do {
      client = cc3000.connectUDP(ip, 123);
    } while((!client.connected()) &&
            ((millis() - startTime) < connectTimeout));
    
    if(client.connected()) {
      Serial.print(F("connected!\r\nIssuing request..."));
    
      // Assemble and issue request packet
      memset(buf, 0, sizeof(buf));
      memcpy_P( buf    , timeReqA, sizeof(timeReqA));
      memcpy_P(&buf[12], timeReqB, sizeof(timeReqB));
      client.write(buf, sizeof(buf));
    
      Serial.print(F("\r\nAwaiting response..."));
      memset(buf, 0, sizeof(buf));
      startTime = millis();
      while((!client.available()) &&
            ((millis() - startTime) < responseTimeout));
      if(client.available()) {
        client.read(buf, sizeof(buf));
        t = (((unsigned long)buf[40] << 24) |
             ((unsigned long)buf[41] << 16) |
             ((unsigned long)buf[42] <<  8) |
              (unsigned long)buf[43]) - 2208988800UL;
        Serial.print(F("OK\r\n"));
      }
      client.close();
    }
    

    } if(!t) Serial.println(F("error")); return t; }

  • Using an adafruit CC3000 and changing the pins to match their examples, i was able to get a signal out but am getting a 401 error in response. I have still been unable to get my SparkFun CC3000 to do more than get a ping...

  • Im having the same problem, even after trying his code mixed with your code. Im getting an IP address, and the ping test works as well. Im also having trouble with the m2x and data.sprakfun.com tutorials, where it hangs as soon as it tries to contact an external server etc (comments made on those two tutorials as well).

    Arduino Uno with mounted shield, using both USB and external power supply (and also just USB on its own).

    any help would be appreciated ,thanks

  • commenting out the progmem.h allows it to compile, but i still can't get a connection to Sparks (see other comment)

  • i commented out progmem.h and was able to get a compile. anyway, the code seems to be hanging up at the post phase. This is the same point in time that the m2x example is hanging. Im so close, and yet so far!

  • cannot make connection for this sketch, getting error "could not connect to AP". Using same SSID and password (copy and pasted password) as the ping test, which is successful. Device is UNO. Any help with this would be appreciated... thanks.

    *ping test only sucessful when running from "examples" in Arduino, test fails in atmel studio when opening .ino from a copy and paste in my_documents. Compiler thinks it's trying to upload to a YUN.

    edit: changing the network info (ssid/password etc) and changing the #define to char has gotten me connected to the network. However, the program is hanging up at the section where it should be posting to m2x g_response = m2xclient etc etc.

    Feed id and master key are all copy and pasted and feed name is the name that i chose for the feed.

No public wish lists :(