Sample code for guy on Indiegogo site Wifi on EZboard

70 views
Skip to first unread message

oto...@gmail.com

unread,
Jul 7, 2015, 3:19:36 PM7/7/15
to lel...@googlegroups.com
The clue was in my post - but here you go:

#include <SPI.h>
#include <SFE_CC3000.h>

// Pins
#define CC3000_INT      2   // Needs to be an interrupt pin (D2/D3)
#define CC3000_EN       8   // Can be any digital pin
#define CC3000_CS       10  // Preferred is pin 10 on Uno

// Global Variables
SFE_CC3000 wifi = SFE_CC3000(CC3000_INT, CC3000_EN, CC3000_CS);

void setup() {

  int i;
  AccessPointInfo ap_info;
  
  // Initialize Serial port
  Serial.begin(9600);
  Serial.println();
  Serial.println("---------------------------");
  Serial.println("SparkFun CC3000 - Scan Test");
  Serial.println("---------------------------");
  
  // Initialize CC3000 (configure SPI communications)
  if ( wifi.init() ) {
    Serial.println("CC3000 initialization complete");
  } else {
    Serial.println("Something went wrong during CC3000 init!");
  }
  
  // Perform scan of nearby WAPs
  Serial.println("Scanning APs. Waiting for scan to complete.");
  if ( wifi.scanAccessPoints(4000) != true ) {
    Serial.println("Error scanning APs");
  }
  
  // Iterate through available WAPs and print their information
  Serial.println("Access Points found:");
  Serial.println();
  while ( wifi.getNextAccessPoint(ap_info) ) {
    Serial.print("SSID: ");
    Serial.println(ap_info.ssid);
    Serial.print("MAC address: ");
    for ( i = 0; i < BSSID_LENGTH; i++ ) {
      if ( ap_info.bssid[i] < 0x10 ) {
        Serial.print("0");
      }
      Serial.print(ap_info.bssid[i], HEX);
      if ( i < BSSID_LENGTH - 1 ) {
        Serial.print(":");
      }
    }
    Serial.println();
    Serial.print("RSSI: ");
    Serial.println(ap_info.rssi, DEC);
    Serial.print("Security: ");
    switch(ap_info.security_mode) {
      case WLAN_SEC_UNSEC:
        Serial.println("Unsecured");
        break;
      case WLAN_SEC_WEP:
        Serial.println("WEP");
        break;
      case WLAN_SEC_WPA:
        Serial.println("WPA");
        break;
      case WLAN_SEC_WPA2:
        Serial.println("WPA2");
        break;
      default:
        break;
    }
    Serial.println();
  }

  // Done!
  Serial.println("Finished scan test");
  
}

void loop() {
  
  // Do nothing
  delay(1000);
  
}

// end of program

Serial output:
---------------------------
SparkFun CC3000 - Scan Test
---------------------------
CC3000 initialization complete
Scanning APs. Waiting for scan to complete.
Access Points found:

SSID: T2 Dalkey Airport
MAC address: F8:D1:11:88:42:F8
RSSI: 61
Security: WPA2

SSID: SeeeduinoCloud-Ad637
MAC address: A8:40:41:13:A1:A4
RSSI: 43
Security: WPA2

Finished scan test

Lelylan Support

unread,
Jul 16, 2015, 3:38:35 AM7/16/15
to lel...@googlegroups.com, oto...@gmail.com, oto...@gmail.com
Hi otoolo, 

Thanks a lot for sharing with us your code. I would love to ask you if you have the time to test out your board with Lelylan, to understand if also with your board you can send but not receive any message.

Best

oto...@gmail.com

unread,
Jul 20, 2015, 6:53:00 PM7/20/15
to lel...@googlegroups.com, oto...@gmail.com
Guys,
Sent you an email with working code - through a domestic wifi router using NAT - All OK
Anonymize the device details before posting please

-otoolo

Lelylan Touch

unread,
Jul 21, 2015, 1:49:07 PM7/21/15
to lel...@googlegroups.com, Mick O'Toole
HI otoolo, 

thanks a lot for your help. We really appreciate it.
Tomorrow we'll check the code and post the working example so that all the backers can start playing using Lelylan.

We'll anonymise all the details before posting.
All the best, and let's keep in touch.

--
You received this message because you are subscribed to the Google Groups "Lelylan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lelylan+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Andrea Reginato
Lelylan, Building the Connected Home
http://lelylan.com

Lelylan Support

unread,
Jul 23, 2015, 4:36:11 AM7/23/15
to Lelylan, to...@lelylan.com, oto...@gmail.com, to...@lelylan.com
Hi everyone, 

we've been working on making the final documentation as complete as we could to make your EZControl work with Lelylan.

A special thanks to Mick (aka otoolo) which was great enough to take the time to play with the EZ and solve the main issues. Thanks.

Everything is not working. This means you can control your EZ from Lelylan and you can reflect the physical changes to the dashboard. We also added info about the PINS: Relay on port 7 and temperature sensor on port A3. The Arduino IDE board must be the version >~ 1.0.6.

I you guys can test it out, issue new problems, we can improve even more the documentation. 
The documentation is on Github, so feel free to send us a pull request for any improvement.

All the best

Lelylan Support

unread,
Jul 23, 2015, 4:38:37 AM7/23/15
to Lelylan, to...@lelylan.com, oto...@gmail.com, to...@lelylan.com
Sorry, :%s/not/now (Everything is now working)
Reply all
Reply to author
Forward
0 new messages