Show Posts
Pages: 1 [2] 3
16  Using Arduino / Networking, Protocols, and Devices / Re: Can't get Wifly RN-XV into command mode on: February 21, 2013, 02:10:07 am
No, it's powered at 3.3v

I am sure the code is wrong.
17  Using Arduino / Networking, Protocols, and Devices / Re: Can't get Wifly RN-XV into command mode on: February 21, 2013, 01:04:58 am

There are a couple more issues here, and let me tell you, EVERYBODY has trouble
with these darn XBee shields. They really don't make it easy, plus many of the early
shields were poorly designed, and could blow your $40 RF modules.

First, which XBee shield are you using? They are many different ones, and all have
some serious muckups involved with using them.

Secondly, since you're doing it by sketch, you might post the code, as people often
make trivial mistakes that are easily rectified. Use the # icon to wrap the code.

Thirdly, I've never had any luck at all with SoftSerial for 2-way comms.

So, loads of gotchas with trying to get this thing to work.


I'm using this: https://www.sparkfun.com/products/10822 with this: http://www.ebay.com/itm/XBee-breakout-board-adapter-to-0-1-DIP-breadboard-/230860861800?ssPageName=ADME:L:OC:US:3160 The actual wifi chip not attached to the breakout board is wifly RN-171.

Below is my code. As you can see I am not sure where to start with this.

Code:

#include <SoftwareSerial.h>
SoftwareSerial wifiSerial(8,9);


void setup()
{
  Serial.begin(9600);
  delay(500);
  Serial.print("$$$");
}

void loop ()

{
  Serial.read();
}
 
18  Using Arduino / Networking, Protocols, and Devices / Re: Can't get Wifly RN-XV into command mode on: February 21, 2013, 12:08:22 am


Sounds like the hardware setup is all wrong. OP hasn't described how "anything" is hooked up,
but the first guess is he has the RN-XV going to the same pins as the USB port on the Arduino,
so that will never ever work. Too much guessing. I hooked up my RN-XV this morning and
typed "$$$", and got back "OK" right off. Then, I typed "get e", and it displayed the complete
setup.



Sorry, you're right, I should have added more info. I am sure it is a stupid mistake.

The module I am using is Wifly RN-XV. I have it attached to my Arduino Uno R3 on pins 8 and 9 and I am using software serial in the code. I maybe going about this all wrong. But, I am using a delay and then serial.print to send "$$$" I then am using serial.read. Is this completely wrong?

I know I am a noob. My areas of expertise lay elsewhere, but I am more than capable of learning.
19  Using Arduino / Networking, Protocols, and Devices / Re: Can't get Wifly RN-XV into command mode on: February 20, 2013, 12:16:15 pm
So should I do a delay before sending "$$$" and then another delay before trying to read the response?
20  Using Arduino / Networking, Protocols, and Devices / Can't get Wifly RN-XV into command mode on: February 20, 2013, 02:20:47 am
The documentation simply says to send "$$$" to the wifi module and you will get "cmd" in return telling you that you are in command mode. I'm sending "$$$" via Serial.print() but I am not getting an response. What am I doing wrong?
21  Using Arduino / Networking, Protocols, and Devices / Re: Talking serially with wifly module RN-XV on: February 20, 2013, 01:42:11 am
Ah! thank you. Makes sense!
22  Using Arduino / Networking, Protocols, and Devices / Talking serially with wifly module RN-XV on: February 19, 2013, 10:31:56 pm
I know there are several libraries available that do the heavy lifting for you. But, if I wanted to send commands and get responses from the device itself using the firmware and command list it comes with how do I go about it?

--Mike
23  Using Arduino / Networking, Protocols, and Devices / Re: Problem communicating via serial with Wifly module on: February 18, 2013, 07:43:33 pm
You should see my soldering. It's terrible. Probably should be illegal.
24  Using Arduino / Networking, Protocols, and Devices / Re: Problem communicating via serial with Wifly module on: February 18, 2013, 07:18:24 pm
You were right! It was the baudrate. I changed it from 9600 to 115200. I am using this: http://www.karlssonrobotics.com/shop/rn-xv-wifly-module-wire-antenna/?gclid=CK_C2PeLwbUCFW3ZQgodHBUAtg You have to solder it to this http://www.ebay.com/itm/XBee-breakout-board-adapter-0-1-DIP-breadboard-/230860861800 because it is the xbee footprint and won't fit standard breadboards. I am also using this library for it: http://arduino.cc/forum/index.php/topic,99362.0.html

--Mike
25  Using Arduino / Networking, Protocols, and Devices / Problem communicating via serial with Wifly module on: February 18, 2013, 06:47:53 pm
After loading a sketch to my Wifly RN-XV module and opening up the serial monitor I am getting nonsense like this   " $þ–þ™÷þ #[þ¹ÿ "   in the serial monitor. What do you think the issue is? Thanks.

--Mike
26  Using Arduino / Audio / Re: sample short audio clips and save to sd card as .wav on: January 25, 2013, 01:26:19 am
Ram or flash storage? I have a SD card wired and ready.
27  Using Arduino / Audio / Re: sample short audio clips and save to sd card as .wav on: January 24, 2013, 09:54:17 pm
10khz and 10 bits?
28  Using Arduino / Audio / sample short audio clips and save to sd card as .wav on: January 24, 2013, 07:44:52 pm
Hello,

I have this microphone http://www.fasttech.com/products/1012008-lm386-digital-microphonesound-sensor-shield-module and with it I would like to record audio for 5 seconds, save it as .wav and send it to Sd card. I don't know where to begin. Any help would be appreciated.

Thanks in advance, Mike.
29  Using Arduino / Programming Questions / Error messages for Serial jpeg camera sample code on: January 22, 2013, 07:29:33 pm
I get the following errors when I compile the sample code that came with my camera. Was wondering if anyone could diagnose this for me? Thanks in advance.

The errors:

Snapshot:67: error: 'Adafruit_VC0706' does not name a type
Snapshot.pde: In function 'void setup()':
Snapshot:97: error: 'cam' was not declared in this scope
Snapshot:104: error: 'cam' was not declared in this scope
Snapshot:116: error: 'VC0706_640x480' was not declared in this scope
Snapshot:124: error: 'VC0706_320x240' was not declared in this scope
Snapshot:125: error: 'VC0706_160x120' was not declared in this scope

The code:

Quote
#include <Adafruit_VC0706.h>
#include <SD.h>

// comment out this line if using Arduino V23 or earlier
#include <SoftwareSerial.h>         

// uncomment this line if using Arduino V23 or earlier
// #include <NewSoftSerial.h>       

// SD card chip select line varies among boards/shields:
// Adafruit SD shields and modules: pin 10
// Arduino Ethernet shield: pin 4
// Sparkfun SD shield: pin 8
// Arduino Mega w/hardware SPI: pin 53
// Teensy 2.0: pin 0
// Teensy++ 2.0: pin 20
#define chipSelect 10

//SoftwareSerial cameraconnection = SoftwareSerial(69, 3);
#else
NewSoftSerial cameraconnection = NewSoftSerial(2, 3);
#endif

Adafruit_VC0706 cam = Adafruit_VC0706(&cameraconnection);

// Using hardware serial on Mega: camera TX conn. to RX1,
// camera RX to TX1, no SoftwareSerial object is required:
//Adafruit_VC0706 cam = Adafruit_VC0706(&Serial1);

void setup() {

  // When using hardware SPI, the SS pin MUST be set to an
  // output (even if not connected or used).  If left as a
  // floating input w/SPI on, this can cause lockuppage.
#if !defined(SOFTWARE_SPI)
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  if(chipSelect != 53) pinMode(53, OUTPUT); // SS on Mega
#else
  if(chipSelect != 10) pinMode(10, OUTPUT); // SS on Uno, etc.
#endif
#endif

  Serial.begin(9600);
  Serial.println("VC0706 Camera snapshot test");
  
  // see if the card is present and can be initialized:
  if (!SD.begin(chipSelect)) {
    Serial.println("Card failed, or not present");
    // don't do anything more:
    return;
  }  
  
  // Try to locate the camera
  if (cam.begin()) {
    Serial.println("Camera Found:");
  } else {
    Serial.println("No camera found?");
    return;
  }
  // Print out the camera version information (optional)
  char *reply = cam.getVersion();
  if (reply == 0) {
    Serial.print("Failed to get version");
  } else {
    Serial.println("-----------------");
    Serial.print(reply);
    Serial.println("-----------------");
  }

  // Set the picture size - you can choose one of 640x480, 320x240 or 160x120
  // Remember that bigger pictures take longer to transmit!
  
  cam.setImageSize(VC0706_640x480);        // biggest
  //cam.setImageSize(VC0706_320x240);        // medium
  //cam.setImageSize(VC0706_160x120);          // small

  // You can read the size back from the camera (optional, but maybe useful?)
  uint8_t imgsize = cam.getImageSize();
  Serial.print("Image size: ");
  if (imgsize == VC0706_640x480) Serial.println("640x480");
  if (imgsize == VC0706_320x240) Serial.println("320x240");
  if (imgsize == VC0706_160x120) Serial.println("160x120");

  Serial.println("Snap in 3 secs...");
  delay(3000);

  if (! cam.takePicture())
    Serial.println("Failed to snap!");
  else
    Serial.println("Picture taken!");
  
  // Create an image with the name IMAGExx.JPG
  char filename[13];
  strcpy(filename, "IMAGE00.JPG");
  for (int i = 0; i < 100; i++) {
    filename[5] = '0' + i/10;
    filename[6] = '0' + i%10;
    // create if does not exist, do not open existing, write, sync after write
    if (! SD.exists(filename)) {
      break;
    }
  }
  
  // Open the file for writing
  File imgFile = SD.open(filename, FILE_WRITE);

  // Get the size of the image (frame) taken  
  uint16_t jpglen = cam.frameLength();
  Serial.print("Storing ");
  Serial.print(jpglen, DEC);
  Serial.print(" byte image.");

  int32_t time = millis();
  pinMode(8, OUTPUT);
  // Read all the data up to # bytes!
  byte wCount = 0; // For counting # of writes
  while (jpglen > 0) {
    // read 32 bytes at a time;
    uint8_t *buffer;
    uint8_t bytesToRead = min(32, jpglen); // change 32 to 64 for a speedup but may not work with all setups!
    buffer = cam.readPicture(bytesToRead);
    imgFile.write(buffer, bytesToRead);
    if(++wCount >= 64) { // Every 2K, give a little feedback so it doesn't appear locked up
      Serial.print('.');
      wCount = 0;
    }
    //Serial.print("Read ");  Serial.print(bytesToRead, DEC); Serial.println(" bytes");
    jpglen -= bytesToRead;
  }
  imgFile.close();

  time = millis() - time;
  Serial.println("done!");
  Serial.print(time); Serial.println(" ms elapsed");
}

void loop() {
}

30  Using Arduino / Audio / Re: Record audio and save as .wav with on board mic on: January 19, 2013, 01:01:09 pm
Thank you. You are quite helpful.
Pages: 1 [2] 3