Can I use IMP to send pictures or files to another device?

I want to capture images and then transfer to another imp, so I would like to ask whether it somebody can reached from a device.
Which method if it is feasible to whether somebody can tell me

The imp looks like an SD card. Are you by chance thinking it’s a WiFi SD card? Because with the WiFi SD cards you can transfer files around. The imp is a physical controller for lights, switches, motors, serial devices and electronic hardware. The imp is packaged in an SD card plastic case so it can use existing connectors that are common and inexpensive.

As mlseim says, the imp doesn’t work like an eye-fi card. You can’t put it in a camera and take pictures.

If, however, you’re looking to capture VGA JPEG snapshots, we’ve hooked the Adafruit TTL serial camera up to an imp and this works well (with agents). We’ll post code soon :slight_smile:

I’m very interested in the Adafruit TTL serial camera and the Imp. I’m trying to come up with a driveway alert system that can send a txt message with an image of the vehicle approaching.

Hi - I wanted to check when the code would be ready to be shared. I am looking to hook up the adafruit camera to the imp as part of my motion sensor project.

Thanks in advance

We actually moved to using the SPI interface on this (for performance), even though its not actually pinned out on the adafruit board. Not sure we still have the UART-only code about but I’ll ping Tom…

I’m familiar with reading the TTL camera. I’m willing to write that part of the code. What do I do with this data to display it? Send it to PC thru Serial? No, we want to use wifi. I’ve done it with Wiring on the PC. How can I send it to a server so our PC can be off?

Hi Hugo,

Just to confirm, was the following camera sensor used for the imp integration/testing

It would be great to get both the UART only code and also any hardware modifications done on the adafruit board for the SPI interface,

Also, curious if the code is for image snapshot transfer or does it also include video streaming.

I am an electronics newbie introduced to imp over last couple of weeks and really excited by the possibilities it enables.

Thanks,

Just snapshot - that camera doesn’t support video streaming (and the imp doesn’t have the bandwidth to do video streaming either!)

ok…couple of question, while I await the sample code:

  1. would the picture snapshot be transferred to imp in one go
    i.e. local image = hardware.uart12.read()
    will the image be the complete image file

  2. Is there sufficient memory in imp to transfer the 640 x 480 picture (highest resolution for the adafruit camera)

Thanks

No, and no. The UART read() method returns a single byte. And a 640x480 image, even if it’s only 8-bit, is 300Kbytes, which is well over the 80K available to Squirrel programs in an imp. Camera interfacing using an imp, is all about streaming the image off to a server as it comes in.

Peter

The TTL JPG camera I have can support file sizes as small as 10k. Works with Arduino even with a small buffer and slow serial baud rates.

I’ve been working with both the Adafruit and Radioshack VC0706 DSP camera boards (this seems to be the chip that all these boards use), and cooked up a class for this application. You can pick it up here: https://github.com/tombrew/ei-fw-tom/tree/master/examples/agent-examples/vc0706

Most 640x480 compressed images I’m getting off the camera are just about 47k. I’ve been able to hold them in the imp, but this wouldn’t work if you were doing much else at the same time. The camera class I posted shows how to quickly offload the image to the agent, which can then send it off to an external URL and ready itself for the next set of data or request.

A couple of things that bear mentioning:

  1. The Adafruit camera comes strapped to boot up at 38400 baud. The Radioshack “camera shield” comes strapped to run at 115200. The code I posted defaults to 115200, so make sure to set this if you’re using the adafruit camera.

  2. Fetching the frame buffer via SPI is much, much faster than picking the whole thing up via UART, and the class I sent uses this method. You’ll need to add a bit of code to do it via UART instead - I’ll probably update this before too long, but you may well beat me to it.

  3. The VC0706 defaults to SPI master mode, and both the adafruit and radioshack boards are strapped to accept this default. This will prevent SPI transfers to the imp from working; you need to pull a pin high to enable SPI slave mode. I’m attaching a marked-up page from the VC0706 datasheet that shows which pin to pull high to get SPI slave mode working.

Happy hacking!

-Tom

Thanks Tom…I went through the code and I get the logic now.

I have a couple of questions:

  1. Can I get HTTP Agent functionality access. The wiki says it is in closed beta.
  2. Also, I went through the adafruit camera board (http://www.adafruit.com/products/397) and there are only 4 pins exposed for soldering (Vin, Ground, Tx, Rx). Can you advise how to get the camera board working in SPI mode (the DSP chip pins in the picture appear very close to each other and I fear soldering a wire to the SPI pin highlighted in the diagram directly might cause damage).

Finally, it appears you have the almost all of the code in place for capturing the image in the UART mode except Line 478 in v0748.nut file where the read_frame_buffer_uart would need to be called.
Can you let me know if I am missing some thing obvious.

Waiting for my camera board to come before I can run the code.

Thanks again…

Did you guys ever find out how to work with the 4 pins camera board, and the SPI? I tried the code here, and connected RX and TX on the camera to 8 and 9 of the imp. I get damaged pictures when uploaded, but reasonable size of the image.

Thanks :slight_smile:

Can you give some information on what you mean by “damaged”?

The link above is broken; the code is now here: https://github.com/electricimp/examples/tree/master/vc0706

You should be able to use that code with the Adafruit board that only exposes UART TX/RX (I think this is what you mean by 4 pin board?), but downloading the frame buffer over UART is slow.

Wow, thanks for the reply on such old topic (didn’t expect that) :slight_smile:

I think the problem is my knowledge about SPI and UART, as I normally run UART with RX and TX pins on arduino.

The thing I don’t understand is that in the constructor of the camera class, I’m passing both SPI and UART connection. And I think that’s why I get a little confused about how to wire my camera to the imp?

Right now I put RX/TX pins of the camera to 8 and 9 (using the uart1289 from the example code). When I make the HTTP request it give me feedback of successfully captured image:

2014-07-02 21:30:09 UTC+2 [Device] Camera Ready. 2014-07-02 21:30:09 UTC+2 [Device] UART RX Buffer Cleared. 2014-07-02 21:30:09 UTC+2 [Device] Image Size set to 640x480 2014-07-02 21:30:19 UTC+2 [Device] Camera Paused 2014-07-02 21:30:19 UTC+2 [Device] UART RX Buffer Cleared. 2014-07-02 21:30:19 UTC+2 [Device] Captured JPEG (45468 bytes) 2014-07-02 21:30:22 UTC+2 [Device] Device: done sending image 2014-07-02 21:30:22 UTC+2 [Device] Camera Capture Resumed 2014-07-02 21:30:24 UTC+2 [Agent] Agent: JPEG Sent (45468 bytes)

And I can see the new image is uploaded to my FTP with the correct size. But I’m unable to view the image as it is somehow corrupt. Maybe it doesn’t get all the chars from the picture array?

As you can see, I’m unsure if I did the wiring correct?

RX of camera -> imp pin 8 TX of camera -> imp pin 9 GND of camera -> imp GND VCC of camera -> imp 3.3V

Also, I’m unsure if I do the http post correctly, as there isn’t provided any further comments on that part, and I had to figure out myself (i’ve not been working alot with web protocols in general). But I uploaded the upload.php to my server, and replaced the two web addresses of the code with my links instead.

Hope for help :slight_smile:

Best, bobby

Also I didn’t pull the VC0706 pin 80 to 3.3V, as I understood it was only needed when using SPI? :slight_smile:

I picked up a vc0706 board from Radio Shack on clearance for only 17 bucks so I am going to give this a try.
The manual doesn’t list the minimum voltage it only lists 5v so I assume this camera will run at 3volts correct?

I went ahead and used the 3v supply using the radio shack camera board.

using the exact code listed here --> https://github.com/electricimp/examples/tree/master/vc0706

RX of camera -> imp pin 8
TX of camera -> imp pin 9
GND of camera -> imp GND
VCC of camera -> imp 3.3V

I am getting this error after I connect to the agent web interface.

2014-08-01 22:19:22 UTC-5 [Status] Device booting; 14.13% program storage used
2014-08-01 22:19:23 UTC-5 [Device] Camera Ready.
2014-08-01 22:19:23 UTC-5 [Device] UART RX Buffer Cleared.
2014-08-01 22:19:23 UTC-5 [Device] Image Size set to 640x480
2014-08-01 22:19:37 UTC-5 [Device] Camera Paused
2014-08-01 22:19:37 UTC-5 [Device] UART RX Buffer Cleared.
2014-08-01 22:19:37 UTC-5 [Device] ERROR: index out of range
2014-08-01 22:19:37 UTC-5 [Device] ERROR: at get_frame_buffer_len:261
2014-08-01 22:19:37 UTC-5 [Device] ERROR: from capture_photo:410
2014-08-01 22:19:37 UTC-5 [Device] ERROR: from unknown:468
2014-08-01 22:19:42 UTC-5 [Status] Device disconnected; 414 bytes sent, 84 received, 498 total

Then the imp reboots…

2014-08-01 22:19:42 UTC-5 [Status] Device booting; 14.13% program storage used
2014-08-01 22:19:43 UTC-5 [Device] Camera Ready.
2014-08-01 22:19:43 UTC-5 [Device] UART RX Buffer Cleared.
2014-08-01 22:19:43 UTC-5 [Device] Image Size set to 640x480

Any Ideas?