Main Site Documentation

.NET Gadgetter sending pictures to pc


#1

Hi everyone ,

How the title says , i’m traying to send pictures to my pc, but dont really know how. I got serial port module , bluetooth module , WiFi module and Ethernet module.

  1. Which module should i use for fastest sending speed ? and if it’s possible could you guys show me some examples how to send pictures for that module.

ps. I’m new to this stuff.


#2

welcome Reack.

great first project :slight_smile:

Actually you may need to throttle back your expectations. This kind of device is not like a USB camera - if you want a USB camera, I’d suggest you buy a purpose built one and keep your Gadgeteer kit for other projects. If you just want to do this to prove you can, then that’s fine, lets keep talking.

I’d break this down into a few different tasks. And the LAST thing to think about is what connection you’re going to use.

The first thing you need to think about is how are you going to view the captured image - ask yourself questions like do you have an application that saves it to disk and you manually open it, or do you expect it to be displayed in a browser? Really you need to explain what the use-case is because that helps set the direction for all the possible options. And in your question you talk about speed - what is that important ?

The answer to your question is likely to be Ethernet, but that doesn’t mean anything until we really understand your use case. There are many reasons that you would choose any or all of those module options, but it totally depends on what you need.


#3

Sending images to PC is a topic that was discussed several times in this forum.
Just have a look at
https://www.ghielectronics.com/community/forum/topic?id=17026
If you search through the forum you will find more.


#4

@ Brett - Hi Brett , answering the question i’ll be sending pictures to regular drive. I’m building a mini security system that every time someone triggers the sensor camera takes picture and sends it to PC.


#5

An more independent alternative would be to store the image on SD card, and transfer it to PC on request. By this the PC would not have to run all the time.
The device could upload the image by it self via FTP (or even CIFS), as soon as the FTP or CIFS drive is available in the network.

You also could run an FTP server on your device, and get the images with PC when you want.


#6

I agree, you want a local cache mechanism to handle this. SD card is as good as any option - but I would also suggest that you take into account giving the device a reliable power source and managing power loss effectively if you want to make sure you have all your images recorded

I’d suggest a network connection (Ethernet, Wi-Fi) over a serial connection (RS232 or BT). If you don’t have or need wired connection near the location then go with Wi-Fi. Then you could have the option of the device pushing to the PC, or the PC pulling from the device - pros and cons both ways, but to make it simple I would always go for the PC pulling the images.


#7

So how i understand you suggesting me that i store images on sd card , then try to take it with PC from sd card ? Or try to access sd card throw ftp ?


#8

all those are options, yes.

Here’s a thought though. Get each part of your system working individually. Work on a program that allows you to capture a picture. Extend that program to capture a picture when the PIR detector triggers. Extend that program to capture the image onto an SD card. Then work on a different program to allow FTP or HTTP transfer (you decide what is appropriate) of content from the SD card over the network. (there are many examples of code in the codeshare here that do much/all of these components). Then you can incorporate those two functions together. Then you’ll need to develop a PC based program that reads those files over that transfer mechanism.


#9

Using a standard protocol to access pictures on device, like FTP, will save you the part of writing a PC software at first.
If needed later, you still can use this protocol from the PC software directly.


#10

Can i ask a question, how to access device sd card with ftp ? , because i done all other things like picture capture when sensor is triggered , sending to sd card . I’m only left with taking pictures from sd card.


#11

Just add the NETMF builtin FTP server assembly or my variant of it from Codeshare to your project:
https://www.ghielectronics.com/community/codeshare/entry/836

Then it’s just a little piece of code like this:

public static void Main()
{
    //...
    
    // setup authentification
    FtpListener.AuthenticationEvent += FtpListenerOnAuthenticationEvent;

    Debug.Print("Setup FTP Listeners");
    var fsRoot = new FtpFilesystemListener("/SDRoot/", @ "\SD", true);
    fsRoot.Start();
    
    //...
}

private static void FtpListenerOnAuthenticationEvent(object sender, UserAuthenticatorArgs e)
{
    // anonymous login
    if (e.User.ToLower().Equals("anonymous"))
    {
       e.StartDirectory = "/SDRoot/";
       e.Result = UserAuthenticationResult.Approved;
       return;
    }
    // unkown user or password
    e.Result = UserAuthenticationResult.Denied;
}

#12

Ty for answers guys, i’m going to try everything tomorrow, i will let you know how it went.