Connect arduino to a PC

Hi,
I realy need to know if arduino can connect to a PC and verify if exists a file in a directory?
Thank you

Hi,
Yes the arduino controllers do connect to a PC, that is how they are programmed and communicated with.
Using the IDE program and the USB port.

Unfortunately the arduino is not a memory device like a memory stick, so you cannot read or write files to it as if it was.

Tom..... :slight_smile:

That is a big problem and with SD module on arduino i can copy a file from pc to arduino SD card?

gonca16:
That is a big problem

Depends how you look at it..

gonca16:
and with SD module on arduino i can copy a file from pc to arduino SD card?

Even without a SD module you can write a file from your PC to an SD-card, as long as you have a SD-card reader connected to the PC...

But uhmm, if you want help, you need to tell us what you want, not what you think you need to do what you want. Also, How to use this forum.

yes but the final ideia is to PC create a file on arduino SD card and arduino read the file on SD card, this should work right?

If you swap the card, yes. (If the type of file makes sens to the Arduino etc.)

But without further details I think this is a case closed...

i can't swap the card this have to work without human interaction

Then no, you cannot.

thank you

Hi gonca16

You could write two programs, one running on the PC, the other on the Arduino. PC program sends data over serial connection to Arduino. Arduino program saves that data on SD card.

But as @septillion said, you need to explain what you are trying to achieve so people can give best advice.

Regards

Ray

Following up Reply #9 ...

I rather think the OP just wants his Arduino to be able to access data from a file on his PC. I suspect the SD Card is a bit of a red herring because people were assuming he would write the SDCard using his PC and then transfer the SDCard to an SDCard slot attached to the Arduino.

As @Hackscribble has said getting data from a PC requires a program running on the PC that can read the data from the file on the PC and send the data to the Arduino.

With a suitable program on your PC you can have any type of interaction with your Arduino - but the Arduino cannot directly access files on a PC. This Python - Arduino demo may be of interest.

...R

My goal is to connect the Arduino to a server.

Each time the server has an error it creates a file, so the Arduino checked this directory, if there was a file means that there is an error so the Arduino through a GSM module send an SMS to warn of the error.

But from what I understand of the explanations I have to create a program in python, and this program checks if the directory has a file if the directory has a file he tells the Arduino to send an SMS to warn

right?

Yes, that's a better explanation. And yes, Python can be used to do this. It depends more on what programming languages you already know. Don't learn Python if you already know C# or Processing or anything else.

gonca16:
Each time the server has an error it creates a file, so the Arduino checked this directory, if there was a file means that there is an error so the Arduino through a GSM module send an SMS to warn of the error.

Why not use the PC to send the SMS and save yourself a lot of trouble.

In the past I used a commercial web service that would send SMS messages for you - can't remember the name of it now, but it was in South Africa - worked very well.

Some of the mobile phone providers have a similar service, and it might be free as part of your package.

...R

Robin2:
Some of the mobile phone providers have a similar service, and it might be free as part of your package.

For instance, T-Mobile provides the "@tmomail.net" SMS gateway domain name - simply send an email to "{phone-number}@tmomail.net", and you'll get it as a text message.

At an employer I worked for, one of our applications had the ability to send notifications to users via SMS - we had a DB table that contained every SMS gateway email address for cell phone providers, and we would simply ask on the setup what the user's cell phone number and service provider were, then we could look up the gateway email domain name and send an email to that address to notify them.

It worked extremely well - and I would bet that most cell phone service providers have similar gateways set up (now, whether they publish those domains, or allow public access is another story - heck, sometimes even the custom service of the provider is unaware that such a service is offered - or that it is even possible - most people are completely unaware of the service today).