Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - speedymk1

Pages: 1
1
TinyDuino Processors & TinyShields / Re: Wifi and microSD Shield
« on: January 21, 2014, 03:21:53 PM »
Hi Ken,

thank you very much, it work now (both at the same time).
Now I have to look further to finish this project.

Thanks again.

2
TinyDuino Processors & TinyShields / Re: Wifi and microSD Shield
« on: January 14, 2014, 03:35:39 PM »
Hello, is somebody reading this thread?

3
TinyDuino Processors & TinyShields / Re: Wifi and microSD Shield
« on: January 10, 2014, 12:14:01 PM »
Have someone a solution for the use of booth devices at the same time?

What is wrong in the code below?

4
TinyDuino Processors & TinyShields / Re: Wifi and microSD Shield
« on: December 22, 2013, 05:02:44 PM »
Hello again,

I tried now to use SD-CARD and WIFI together - without success!
Here is my short code (not the best,...quick and dirty)

Code: [Select]
/*
 Used parts:
 # Tinyduino  - Processor Board
 # TinyShield - USB & ICP
 # TinyShield - WIFI
 # TinyShield - SD Card
 # TinyShield - Proto Board
 */

// Include libraries
#include <Adafruit_CC3000.h>
#include <SPI.h>
#include <SD.h>
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
// WIFI-CC3000
#define ADAFRUIT_CC3000_IRQ   2                  // must be a IRQ Pin
#define ADAFRUIT_CC3000_VBAT  A3                 //
#define ADAFRUIT_CC3000_CS    8                  // PIN: ChipSelect für WIFI
#define WLAN_SSID             "???????"          // cannot be longer than 32 characters!
#define WLAN_PASS             "???????"
#define WLAN_SECURITY         WLAN_SEC_WPA2      // This can be WLAN_SEC_UNSEC, WLAN_SEC_WEP,
//                                                  WLAN_SEC_WPA or WLAN_SEC_WPA2
// SD-CARD
#define SD_CS                 10                 // PIN: ChipSelect für SD-CARD
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
// WIFI
uint32_t ipAddress, netmask, gateway, dhcpserv, dnsserv;
// WIFI-CC3000 instance
Adafruit_CC3000 wifi = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ,
ADAFRUIT_CC3000_VBAT, SPI_CLOCK_DIV2);

// SD-CARD
File   dataFile;
String dataString = "";
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
// setup
void setup()
{
  Serial.begin(9600);
  /* ----------------------------------------------------------
   Starting
   ----------------------------------------------------------*/
  Serial.println("Starting...");
  Serial.println("Controller is starting...");
  /* ----------------------------------------------------------
   WIFI
   ----------------------------------------------------------*/
  // Initialise the CC3000 module
  Serial.println("WIFI Module");
  Serial.println("* Initialising...");
  if (!wifi.begin()) {
    while(1) {
    }
  }
  // Connect to  WiFi network
  wifi.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY);
  // Check DHCP
  Serial.print("\n* Request DHCP");
  while (!wifi.checkDHCP())
  {
    delay(100);
  } 
  /* Display the IP address DNS, Gateway, etc. */
  if(!wifi.getIPAddress(&ipAddress, &netmask, &gateway, &dhcpserv, &dnsserv)) {
    Serial.println("!!! Unable to retrieve the IP Address!!!\r\n");
  }
  else {
    Serial.print("\n* IP Addr: ");
    wifi.printIPdotsRev(ipAddress);
    Serial.print("\n* Netmask: ");
    wifi.printIPdotsRev(netmask);
    Serial.print("\n* Gateway: ");
    wifi.printIPdotsRev(gateway);
    Serial.print("\n* DHCPsrv: ");
    wifi.printIPdotsRev(dhcpserv);
    Serial.print("\n* DNSserv: ");
    wifi.printIPdotsRev(dnsserv);
  }
  Serial.println("\n* WiFi connection successfully finished!");

  /* ----------------------------------------------------------
   SD-CARD
   ----------------------------------------------------------*/
  Serial.print("Initializing SD card...\n");
  pinMode(10, OUTPUT);     // Pin 10 must be configured as output
  if (!SD.begin(SD_CS)) {
    Serial.println("initialization failed. Things to check:");
    Serial.println("* is a card is inserted?");
    Serial.println("* Is your wiring correct?");
    Serial.println("* did you change the chipSelect pin to match your shield or module?");
    Serial.println("---------------------------------");
    return;
  }
  else {
    Serial.println("initialization successfull!");
    dataFile = SD.open("data.txt", FILE_WRITE);
    Serial.println("Wiring is correct and a card is present.");
  }
  if (dataFile) {
    dataString += "Controller started";
    dataFile.println(dataString);
    dataFile.close();
    // print to the serial port too:
    Serial.println(dataString);
  }
  Serial.println("* SD-Card successfully started...");
  Serial.println("---------------------------------");

  Serial.println("Controller sucessfully started!");
  Serial.println("=================================");
}

/*****************************************************************************/
// loop
void loop() {
  // do something
}
// end loop
/*****************************************************************************/

If I commend out the SD-CARD section it work - this means WIFI work and on the serial monitor you will see the WIFI parameter:
Code: [Select]
Starting...
Controller is starting...
WIFI Module
* Initialising...
Started AP/SSID scan

Connecting to ???????...Waiting to connect...
* Request DHCP
* IP Addr: 10.0.0.6
* Netmask: 255.255.255.0
* Gateway: 10.0.0.254
* DHCPsrv: 10.0.0.254
* DNSserv: 10.0.0.254
* WiFi connection successfully finished!
Controller sucessfully started!
=================================

If I include the SD-CARD section, nothing will be shown on the serial monitor.
If I commend out the WIFI section it work - this means SD-CARD work and on the serial monitor you will see some informations:
Code: [Select]
Starting...
Controller is starting...
Initializing SD card...
initialization successfull!
Wiring is correct and a card is present.
Controller started
* SD-Card successfully started...
---------------------------------
Controller sucessfully started!
=================================


Why is now nothing on the serial monitor?
Who can help me?
What is wrong?

But maybe there is an other problem, why?
I work on a MacBook Pro with OS 10.9 with ARDUINO 1.0.5 and how you can see in the code above I use 9600 for Serial communication.
But on the terminal monitor I have to adjust 4800 to see all messages, otherwise I see only some characters.
Is this normal?

Thanks in advance

[EDIT]: I solved now the problem with the serial communication (baud rate) - use the right board and than it will work :).
But all other problems are still here.

5
TinyDuino Processors & TinyShields / Re: Wifi and microSD Shield
« on: December 17, 2013, 03:12:18 PM »
Thanks for this answer.

I will test it this week again and will post my answer after testing.

Here is what I found out today:
It seems that it work how you wrote.
I got some problems with my debug - output (nothing was displayed) and so I thought, that this was the problem.
But now I deleted some Serial.print - commands and I got my debug informations.

Now I have to check the WIFI part.

6
TinyDuino Processors & TinyShields / Wifi and microSD Shield
« on: December 13, 2013, 04:27:19 PM »
Hi,

is it possible to use Wifi and microSD together at the same time?
I tried this, but it won't work -> my debug output on the terminal monitor get nothing.
I read in other Arduino forums, that it is not possible, but the topics are very old and so I want to know if there is a solution for this case.

What will I do?
  • Measure the temperature and save it on the microSD card.
  • Connect via Wifi and computer, iPad,... to the controller and read the data from the microSD card.
I hope there is now a solution for this case.

Thanks in advance.

Pages: 1
SMF spam blocked by CleanTalk