Page 1 of 1

data collection from automats with php

Posted: Thu May 27, 2004 12:38 pm
by orangeapple
Hi there,

I'm an amateur php programmer but have a concrete project. Now i have to face a big problem...

I work for someone who installs automated 'Disinfection of Ventilation Systems'. The automats are interfaced with internet and we are willing to collect the values of different parameters sent by the automats and enter them in a mysql table on a server.

These automats have very limited possibilities. There are only 2 ways for getting the datas from the automats :

1. The automats can send out an e-mail (SMTP) containing the datas. So the idea would be to pick up several times a day (with the cron function of the server) the received e-mails, to format the datas and enter them in a mysql table. Can php do that ?
This would be the first choice solution because the automats wouldn't have to be permenantly connected to internet.

2. The automats can be reached by FTP from the server (also several times a day with the cron sever fonction) to download directly the datas.
This is a second choice because it means that the automats must be pemenantly connected.

Who can give me advices, help and suggestions ?

Thanks Folks !

Posted: Thu May 27, 2004 12:41 pm
by magicrobotmonkey
I would think ftp would be easier.

Are you trying to use PHP for this, or what?

Posted: Thu May 27, 2004 2:02 pm
by Weirdan
I would go with ftp. That way you always know the status of each given automat, is it offline or online. Perhaps offline status means the automat should be replaced, doesn't it? ;)

Posted: Fri May 28, 2004 6:33 am
by orangeapple
I really want to focus on solution 1 (SMTP) because FTP means that the automats must be permenantely connected to internet.

The plan is to connect the automats to internet via modem 56k. The automat will connect itself automatically lets say 2 times a day to send its datas and disconnect immediatly afterwards.

Can anyone help me with solution 1 ?

Thanks

Posted: Fri May 28, 2004 6:41 am
by JayBird
You could get the Automats to send the emails to a certain email account then use PHP to check the email

Take a look at these:

http://www.phpclasses.org/pop3class

http://forums.devshed.com/archive/t-39649

http://pear.php.net/package/Mail_IMAP

Mark

Posted: Fri May 28, 2004 7:45 am
by timvw
I'd use fetchmail to get the mail.

Then i'd use procmail to pass to mail to my mail-handling script.

Posted: Fri May 28, 2004 11:43 am
by dave420
procmail all the way, baby!

Seriously - this has procmail written all over it.