📬❄️📦Adafruit Holiday Shipping Deadlines 2019: Attention all domestic customers! Please place UPS Ground and USPS First Class & Priority orders by 11am ET Monday December 9, 2019 📬❄️📦 Attention all international customers! Please place all UPS WORLDWIDE EXPRESS; SAVER, and DHL EXPRESS WORLDWIDE orders by 11am ET Monday December 9, 2019 📬❄️📦
0

"CMD Timeout" on a TTL Serial JPEG Camera - CommTool
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

"CMD Timeout" on a TTL Serial JPEG Camera - CommTool

by GoldenDinosaur on Wed May 08, 2019 10:22 am

Hey folks, I have been unable to successfully connect VC0706 CommTool with my pre-wired Serial Camera. I have followed all steps (aside from optional Video jack) listed here: https://learn.adafruit.com/ttl-serial-camera/overview. It is worth NOTING: My Green and White wires were SWITCHED.

* Recap of What I've Done:
- I have chosen an Arduino Uno R3 board and an Adafruit WINC1500 WiFi Shield for my build
- I originally soldered wires as follows: (Red to 5V, Black to Ground, Green to 0 I/O -RX, White to 1 I/O-TX)
- I realized the Green & White wires coming from the camera were flipped
- I removed solder from the Shield
- I read forums and saw CommTool needs to be set up like the picture here: https://learn.adafruit.com/ttl-serial-c ... g-commtool
- I unplugged Camera's board from wires becuase Arduino IDE was trying to read the serial instead of sketch
- While my shield was attached I Uploaded Blink Successfully, I then uploaded Blank
Code: Select all | TOGGLE FULL SIZE
// empty sketch
 
void setup() 
{
}
 
void loop()
{
}


HERE IS WHERE I'm PARTICULARLY UNSURE IF I TROUBLESHOOTED CORRECTLY V
- I opened CommTool, but any time I sent "Get Version" or Any other command I received "Cmd Timeout" pop-up.
- I soldered White to 0 I/O -RX, Green to 1 I/O-TX to properly attach wires given my Camera came with White and Green Wires switched
- The camera's IR LED lights successfully turn on when I make the room dark.
- One time I received a Hex message response when Opening the Com3 Port - it was 6-7 gibberish characters.

Other Troubleshooting I tried: Switched USB cable, verified Windows recognizes the board and port, uploaded Arduini Wifi library to IDE and restarted IDE (I have since uploaded Blank code script as noted above), read through Camera Manufacturer's technical guide (no help there),

I just ordered the 2.5" NTSC Video display and a backup Adafruit Shield (same model)

MY GOAL:
Resolve CommTool Issue, complete This https://learn.adafruit.com/adafruit-winc1500-wifi-shield-for-arduino/overview so I can have the camera take pictures every 5 seconds with code I have.

Please advise on how I can resolve the "CMD Timeout"

Thank you!

GoldenDinosaur
 
Posts: 16
Joined: Wed May 08, 2019 10:00 am

Re: "CMD Timeout" on a TTL Serial JPEG Camera - CommTool

by adafruit_support_carter on Wed May 08, 2019 2:23 pm

For troubleshooting, let's remove the Adafruit WINC1500 WiFi Shield from the mix and just use the UNO and camera.

The idea with the blank sketch is that it uses the UNO as a USB (from your computer) to Serial (to the camera) converter. So that sketch has to be the one loaded and running for testing the camera.

Post a photo of your setup showing how you are wiring the camera to the UNO.

adafruit_support_carter
 
Posts: 13661
Joined: Tue Nov 29, 2016 2:45 pm

Re: "CMD Timeout" on a TTL Serial JPEG Camera - CommTool

by GoldenDinosaur on Sat May 11, 2019 5:49 pm

Update:
I switched to an Adafruit METRO M0 Express - designed for CircuitPython - ATSAMD21G18 board.
I followed all UF2 and Bootlader steps here: https://learn.adafruit.com/adafruit-met ... n/overview
I did not see any pinout steps needed for Arduino IDE
Im communicating on Port 6
I AM able to turn on camera's IR LEDs now ! And I can upload sketches

EDITED problems:
* CommTool still "Cmd Time Out"

https://postimg.cc/gallery/w7oyu64k/

https://i.postimg.cc/Y9pM4Sjd/61-C8-C94 ... F366-D.jpg



Please advise

GoldenDinosaur
 
Posts: 16
Joined: Wed May 08, 2019 10:00 am

Re: "CMD Timeout" on a TTL Serial JPEG Camera - CommTool

by GoldenDinosaur on Mon May 13, 2019 1:23 am

Update, (Please help me :( ) to resolve this issue I've tried several pieces of advice from other forums. Some advice has Not Worked and some advice HAS IMPACTED THE PROCESS

NOT WORKED OR NOT CHANGED ANYTHING:
* Switch Green and White wires
* Switched to a 510R resistor
* Added a Timeout sketch (https://www.arduino.cc/en/Serial/SetTim ... 6NXK-RZvBA)
* Restarted the Metro set-up process from the very beginning, doing each required step (https://learn.adafruit.com/adafruit-met ... cuitpython)
* Watched the relevant Adafruit youtube videos and Lady Ada's review of the Metro M0 setup to copy their steps
* Changed the port number my machine assigned to board

IMPACTED
* At this step (https://learn.adafruit.com/ttl-serial-c ... g-commtool) I plugged wires into their Metro M0 board pins instead of the breadboard and got the LED IR to turn on
This also changed my error from "CMD Timeout" to "Could not set comm state, there may be one or more invalid communications parameters"

Please help.

GoldenDinosaur
 
Posts: 16
Joined: Wed May 08, 2019 10:00 am

Re: "CMD Timeout" on a TTL Serial JPEG Camera - CommTool

by adafruit_support_carter on Mon May 13, 2019 12:24 pm

The Metro M0 Express is a 3.3V logic level board. Therefore, you do not need the voltage divider which is needed when interfacing to a 5V logic level board like an UNO. Try directly connecting the white/green wires to the Metro M0 Express.

adafruit_support_carter
 
Posts: 13661
Joined: Tue Nov 29, 2016 2:45 pm

Re: "CMD Timeout" on a TTL Serial JPEG Camera - CommTool

by GoldenDinosaur on Mon May 13, 2019 12:38 pm

adafruit_support_carter wrote:The Metro M0 Express is a 3.3V logic level board. Therefore, you do not need the voltage divider which is needed when interfacing to a 5V logic level board like an UNO. Try directly connecting the white/green wires to the Metro M0 Express.


OK, then to Verify, should I:

*Red to the +3.3V Board M0 pin,
*Black to the Ground M0 Board pin,
* White to the RX M0 Board pin (data into the module)
* Green to the TX M0 Board pin (data from the module)
* Not use the breadboard?

Thank you, I REALLY appreciate your help!

GoldenDinosaur
 
Posts: 16
Joined: Wed May 08, 2019 10:00 am

Re: "CMD Timeout" on a TTL Serial JPEG Camera - CommTool

by adafruit_support_carter on Mon May 13, 2019 12:49 pm

Correct except for power. Keep the red going to +5V. The camera's TTL signals are at 3.3V level, but the power is 5V:

Operating voltage: DC +5V
Communication: 3.3V TTL (Three wire TX, RX, GND)

adafruit_support_carter
 
Posts: 13661
Joined: Tue Nov 29, 2016 2:45 pm

Re: "CMD Timeout" on a TTL Serial JPEG Camera - CommTool

by GoldenDinosaur on Mon May 13, 2019 1:46 pm

adafruit_support_carter wrote:Correct except for power. Keep the red going to +5V. The camera's TTL signals are at 3.3V level, but the power is 5V:

Operating voltage: DC +5V
Communication: 3.3V TTL (Three wire TX, RX, GND)

I did that without success. 2 min screen video with commentary. Perhaps I'm missing something else?

Video (Skip 1:30 - 2:50 - I was inputting wires and it took me a little bit) https://drive.google.com/file/d/1_djG5Q ... aSJom/view

Edit: FWIW I tinned the wire tips, Device Manager recognizes Board as METROBOOT when plugged in, then Arduino recognizes board.

GoldenDinosaur
 
Posts: 16
Joined: Wed May 08, 2019 10:00 am

Re: "CMD Timeout" on a TTL Serial JPEG Camera - CommTool

by adafruit_support_carter on Mon May 13, 2019 2:30 pm

Ah, sorry. Forgot - the serial path is a little different on the Metro M0. Try using this for your sketch:
Code: Select all | TOGGLE FULL SIZE
void setup() {
  Serial.begin(38400);
  Serial1.begin(38400);
}

void loop() {
  if (Serial.available()) {         // If anything comes in Serial (USB),
    Serial1.write(Serial.read());   // read it and send it out Serial1 (pins 0 & 1)
  }

  if (Serial1.available()) {        // If anything comes in Serial1 (pins 0 & 1)
    Serial.write(Serial1.read());   // read it and send it out Serial (USB)
  }
}


The COM2 you connect to in the Comm Tool is the USB Serial one. And then the camera is connected to the TX/RX pins on the Metro which is Serial1. This sketch should pass the traffic between the two.

adafruit_support_carter
 
Posts: 13661
Joined: Tue Nov 29, 2016 2:45 pm

Re: "CMD Timeout" on a TTL Serial JPEG Camera - CommTool

by GoldenDinosaur on Fri May 17, 2019 12:07 am

PROGRESS! CommTool issue resolved. I had some trouble taking pictures with camera, so I bought a new one and it worked right away.

Running into trouble setting up Micro SD Breakout Board (https://learn.adafruit.com/adafruit-mic ... d-tutorial) with my Metro M0 Express Board. I want to save the camera pictures/videos to the SD card

Please help me resolve my error which does not allow my board/PC to recognize the SD card.

Steps Taken:
* Setup Metro M0 Board on Port 2
* Setup Wiring as follows: https://postimg.cc/gallery/2p2hlg3pg/
* I used jumper wires for all connections, and pressed the Breakout boards pins as far down as I could
* I did not format the SD card as I don't have a mini SD card port available
* Attempted File -> Examples -> SD -> Card Info
* Note: I changed code to read chipSelect to 10 (code below)
* Received Error Message stating "... Installation Failed. Things to check: * Is your card inserted? * Is your wiring correct? * did you change chipSelect pin to match your shield or module?"
* Note: This device will be used in an extremely shaky environment. So stability and less extra connections is ideal
Code: Select all | TOGGLE FULL SIZE
/*
  SD card test

  This example shows how use the utility libraries on which the'
  SD library is based in order to get info about your SD card.
  Very useful for testing a card when you're not sure whether its working or not.

  The circuit:
    SD card attached to SPI bus as follows:
 ** MOSI - pin 11 on Arduino Uno/Duemilanove/Diecimila
 ** MISO - pin 12 on Arduino Uno/Duemilanove/Diecimila
 ** CLK - pin 13 on Arduino Uno/Duemilanove/Diecimila
 ** CS - depends on your SD card shield or module.
       Pin 4 used here for consistency with other Arduino examples


  created  28 Mar 2011
  by Limor Fried
  modified 9 Apr 2012
  by Tom Igoe
*/
// include the SD library:
#include <SPI.h>
#include <SD.h>

// set up variables using the SD utility library functions:
Sd2Card card;
SdVolume volume;
SdFile root;

// change this to match your SD shield or module;
// Arduino Ethernet shield: pin 4
// Adafruit SD shields and modules: pin 10
// Sparkfun SD shield: pin 8
// MKRZero SD: SDCARD_SS_PIN
const int chipSelect = 10;

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }


  Serial.print("\nInitializing SD card...");

  // we'll use the initialization code from the utility libraries
  // since we're just testing if the card is working!
  if (!card.init(SPI_HALF_SPEED, chipSelect)) {
    Serial.println("initialization failed. Things to check:");
    Serial.println("* is a card inserted?");
    Serial.println("* is your wiring correct?");
    Serial.println("* did you change the chipSelect pin to match your shield or module?");
    while (1);
  } else {
    Serial.println("Wiring is correct and a card is present.");
  }

  // print the type of card
  Serial.println();
  Serial.print("Card type:         ");
  switch (card.type()) {
    case SD_CARD_TYPE_SD1:
      Serial.println("SD1");
      break;
    case SD_CARD_TYPE_SD2:
      Serial.println("SD2");
      break;
    case SD_CARD_TYPE_SDHC:
      Serial.println("SDHC");
      break;
    default:
      Serial.println("Unknown");
  }

  // Now we will try to open the 'volume'/'partition' - it should be FAT16 or FAT32
  if (!volume.init(card)) {
    Serial.println("Could not find FAT16/FAT32 partition.\nMake sure you've formatted the card");
    while (1);
  }

  Serial.print("Clusters:          ");
  Serial.println(volume.clusterCount());
  Serial.print("Blocks x Cluster:  ");
  Serial.println(volume.blocksPerCluster());

  Serial.print("Total Blocks:      ");
  Serial.println(volume.blocksPerCluster() * volume.clusterCount());
  Serial.println();

  // print the type and size of the first FAT-type volume
  uint32_t volumesize;
  Serial.print("Volume type is:    FAT");
  Serial.println(volume.fatType(), DEC);

  volumesize = volume.blocksPerCluster();    // clusters are collections of blocks
  volumesize *= volume.clusterCount();       // we'll have a lot of clusters
  volumesize /= 2;                           // SD card blocks are always 512 bytes (2 blocks are 1KB)
  Serial.print("Volume size (Kb):  ");
  Serial.println(volumesize);
  Serial.print("Volume size (Mb):  ");
  volumesize /= 1024;
  Serial.println(volumesize);
  Serial.print("Volume size (Gb):  ");
  Serial.println((float)volumesize / 1024.0);

  Serial.println("\nFiles found on the card (name, date and size in bytes): ");
  root.openRoot(volume);

  // list all files in the card with date and size
  root.ls(LS_R | LS_DATE | LS_SIZE);
}

void loop(void) {
}

GoldenDinosaur
 
Posts: 16
Joined: Wed May 08, 2019 10:00 am

Re: "CMD Timeout" on a TTL Serial JPEG Camera - CommTool

by adafruit_support_carter on Fri May 17, 2019 12:03 pm

Did you solder the jumpers? It won't work otherwise.
* I used jumper wires for all connections, and pressed the Breakout boards pins as far down as I could

solder.jpg
solder.jpg (25.84 KiB) Viewed 322 times

adafruit_support_carter
 
Posts: 13661
Joined: Tue Nov 29, 2016 2:45 pm

Re: "CMD Timeout" on a TTL Serial JPEG Camera - CommTool

by GoldenDinosaur on Tue May 21, 2019 10:25 am

adafruit_support_carter wrote:Did you solder the jumpers? It won't work otherwise.
* I used jumper wires for all connections, and pressed the Breakout boards pins as far down as I could


Progress! But a new problem has popped up in the final steps of writing to the SD card.

For refresher, my goal is to use the "TTL Serial Camera" to take pictures on a loop, stay connected to the "Metro M0 Express Board" and save pictures to the "Breakout Board".

PROBLEM:
When I load code into REPL in order to Initialize & Mount SD Card Filesystem I get errors.
VIDEO: https://drive.google.com/file/d/1eT-uHA ... iqq9P/view
Skip 3:00 - 4:05 as I was wiring the board.

Code: Select all | TOGGLE FULL SIZE
>>> import busio
>>> import digitalio
>>> spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
>>> # Use board.SD_CS for Feather M0 Adalogger
>>> cs = digitalio.DigitalInOut(board.SD_CS)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'SD_CS'
>>> spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Pin PB11 in use
>>> # Use board.SD_CS for Feather M0 Adalogger
>>> cs = digitalio.DigitalInOut(board.10)



STEPS TAKEN:
* Soldered pins to the MicroSD Board
* Completed All steps here: https://learn.adafruit.com/welcome-to-c ... cuitpython
* Updated CircuitPython to current 3.x version and updated all libraries
* I've successfully worked through all steps (Thank God for all this documentation. 190 pages is a lot, but necessary) here : https://learn.adafruit.com/adafruit-mic ... cuitpython

Please help me get past this error. Note: I hope to use Arduino's IDE but can use Mu if that is needed to connect Board with SD card and camera.

GoldenDinosaur
 
Posts: 16
Joined: Wed May 08, 2019 10:00 am

Re: "CMD Timeout" on a TTL Serial JPEG Camera - CommTool

by adafruit_support_carter on Tue May 21, 2019 11:55 am

I think there are a couple of things happening. The guide here:
https://learn.adafruit.com/adafruit-mic ... cuitpython
seems like it might have been written for a board with a built in SD card, like one of the Feather AdaLoggers. A board like that would have the pin board.SD_CS defined. But you're working with a breakout and a Metro, so you'll need to use a more general purpose pin designation - whichever one you've wired CS to. It sounds like that's digital 10. You were close with the code change, but you missed the "D" in the pin name. It should have been board.D10. Try making those changes and see if it works.

The other thing to watch out for is the location of the folder where you've located the SD card library. In general, libraries should live in the CIRCUITPY/lib folder. You've got most of them there. But the SD one is by itself in the root folder. So you'll want to move it into the lib folder.

Try making those changes and try again.

adafruit_support_carter
 
Posts: 13661
Joined: Tue Nov 29, 2016 2:45 pm

Re: "CMD Timeout" on a TTL Serial JPEG Camera - CommTool

by GoldenDinosaur on Tue May 21, 2019 12:19 pm

Thank you. I'll try this in 4-5 hours when I return home. FYI: I'm producing a 1-2 page lessons learned document for this build. I'll post that document in this thread for other builders to reference.

GoldenDinosaur
 
Posts: 16
Joined: Wed May 08, 2019 10:00 am

Re: "CMD Timeout" on a TTL Serial JPEG Camera - CommTool

by GoldenDinosaur on Wed May 22, 2019 12:16 am

More progress, but running into a new wall a few steps later.

When I attempt to "import adafruit_sdcard" I will receive an error "MemoryError: memory allocation failed, allocating %u bytes" or "MemoryError: memory allocation failed, allocating 276 byte"
Then when I attempt to establish "sdcard = adafruit_sdcard.D10(spi, cs)" I receive message "Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'D10'"

I cleared up occasional memory errors by Using "CTRL + D" one time. I was unsure if pressing CTRL + D again would trigger a "reload" which would reset all my work,

I googled around and it seems the Memory error is a Truncated Memory Error. However, if I experience this error, I can sometimes (~50%) just re-enter the "import adafruit_sdcard" on a single paste and it'll work that way. Instead of copy/pasting multiple lines of code. Some websites recommended troubleshooting, but I was nervous if I should try or not.
https://github.com/micropython/micropython/issues/2530
https://github.com/adafruit/circuitpython/issues/569

Thoughts on resolving?

I'm staying home from work tomorrow to troubleshoot all day. I'm so close!!!

Code: Select all | TOGGLE FULL SIZE
Adafruit CircuitPython 3.1.2 on 2019-01-07; Adafruit Metro M0 Express with samd21g18
>>> import board
>>> import busio
>>> import digitalio
>>> spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
>>> # Use board.SD_CS for Feather M0 Adalogger
>>> cs = digitalio.DigitalInOut(board.D10)
>>> import adafruit_sdcard
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
MemoryError: memory allocation failed, allocating 276 byte
>>> import adafruit_sdcard
>>> import storage
>>> sdcard = adafruit_sdcard.D10(spi, cs)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'D10'
>>>

GoldenDinosaur
 
Posts: 16
Joined: Wed May 08, 2019 10:00 am

Please be positive and constructive with your questions and comments.