data collection from automats with php

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
orangeapple
Forum Commoner
Posts: 70
Joined: Tue Jan 06, 2004 1:24 pm
Location: Geneva / Switzerland

data collection from automats with php

Post 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 !
magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

Post by magicrobotmonkey »

I would think ftp would be easier.

Are you trying to use PHP for this, or what?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post 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? ;)
User avatar
orangeapple
Forum Commoner
Posts: 70
Joined: Tue Jan 06, 2004 1:24 pm
Location: Geneva / Switzerland

Post 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
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post 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
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

I'd use fetchmail to get the mail.

Then i'd use procmail to pass to mail to my mail-handling script.
dave420
Forum Contributor
Posts: 106
Joined: Tue Feb 17, 2004 8:03 am

Post by dave420 »

procmail all the way, baby!

Seriously - this has procmail written all over it.
Post Reply