Source language: Translate to:

I need ideas...

General questions about NeoBook

Moderator: Neosoft Support

I need ideas...

Postby David de Argentina » Tue Sep 10, 2013 9:30 pm

Hi all,

I make a program that handles the webcam.
One of the services of this program is detection of motion.
Each time program detects motion, capture the image, and send it using an email.

All works fine.

My hosting provider tells me about the max of emails i can send:
3 emails/min using SMTP.
15 emails/min using PHP.

I googled "SMTP send mail limit", and i get a lot of answers.
Usually, free mail providers ( Gmail, Yahoo, Hotmail, etc) limits the amount of send mails to 500 emails/day.

Now, the problem:

As this program is a gift (for free), I can't determine how many users could be using this program at the same time.
If this users ( 1000, 10.000, 100.000, who knows... ) are using the detection of motion service, there are a very big amount of emails going to the SMTP Server at the same time.

How to bypass this problem ?

I think on this alternatives:

a) Force to use the user's email account: releases the overcharge of my smtp server, but i don't know if the user has an email account with smtp server. Problem is if user send very much emails to his smtp server, his account could be blocked.

b) Similar to a) plus delaying the amount of emails of each user: i tryed with a Delay "5000" in order to send an email every 5 seconds. I think if the delay is bigger, some important data ( intrudes, non autorized people, etc ) data will be losed. The result is not really good.

c) Similar to b), but sending emails using php. Hosting provider will feel a bit nervious....

d) Create a MySQL database into my webserver with 2 tables: users and emails
Users Table has 2 fields: User_ID and IP
Emails Table has this fields: User_ID, Datetime, picture (blob)

This option (d) needs a client program that imports data from my database and store them into a local database.
When user starts the client program, the ip is setted into the Users Table.
Main program check each time motion is detected if the ip is > blank. If ip is setted, sends the data to the client local database directly, else, stores the new image (and datetime) on the Emails Table.

Each captured image (320 x 240) is near 10KB. After mime encoding, near 14 KB
My hosting has 2GB space, i think i can put into the database near 140.000 records (images)
Then, if there are 10.000 users, each user can store 14 images into database... not enough good...

e) Install a SMTP server on each machine of each user. Not the best option... but the most efficient.


Another ideas ?
Please! please! please!

Thanks in advance,
David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Re: I need ideas...

Postby Kennethd » Wed Sep 11, 2013 1:08 am

Hi David
I made up a system where all our Depots and managers can go on the internet and view
the cameras via my server. If you email me I will show you what I did and give you a link to my
Cameras I don't want to show link here as I don't want hundreds of people on my server

I used a shareware program which I installed on Depots computer and
then do a ftp to my server I only ftp every 10 seconds to save bandwidth as I have four
Depots each using 3 Cameras, this shareware program can do Motion Detection and you
can set it to email etc. I use cheap web cams and fit them into pvc. pipes to shelter from the rain
It works great and been doing this for over a year now
All my cameras work off usb ports and can get 10 metres using special usb cables
My email is kennethd@mweb.co.za

Regards
Ken
Kennethd
 
Posts: 7
Joined: Thu Jun 20, 2013 1:09 pm

Re: I need ideas...

Postby dpayer » Wed Sep 11, 2013 4:53 am

David, if this is a valuable service and commercially viable then you should rent a server (VPS servers are not expensive) and then you have no worry about limits.

It is not feasible to think about using free services to do volume work.

David P
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: I need ideas...

Postby Gaev » Wed Sep 11, 2013 5:30 am

David de Argentina:

If you send one (14 KB) image every 5 seconds, it works out to 17,280 emails per day !!! ... and requires 242 MB of space for the images !!!

I do not believe that there is a human being capable of viewing so many images (and acting on them).

Perhaps you might consider ...

1) capturing such images on the computer attached to the web cam

2) when motion is suspected ...

a) start uploading (ftp) copies of images to your server

b) send a single email with a link that would allow the recipient to view the uploaded images (perhaps several pre-built links for a variety of time ranges around the suspicious moment in time).

... you could have some pre-arranged agreement with the user about how many "minutes of images should be uploaded" after motion is detected ... as well as "how long the uploaded files would be retained for online viewing" ... of course, before erasure, user could be sent a single email with a single attachment (a zip file containing the images about to be deleted)
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: I need ideas...

Postby dec » Wed Sep 11, 2013 7:35 am

Hello there,

Plus that other mates said, in my honest opinion is not a bad thing to ask the user for a valid SMTP server to use. I think in fact all the email accounts offer an SMTP server, so you can try to use the account provided by the user. If I use such kind of program and the program ask me for a valid email account I thinking comprensible and not a rare thing.
.
Enhance your NeoBook applications!
.
57 plugins, 1113 actions and 230 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: I need ideas...

Postby David de Argentina » Wed Sep 11, 2013 11:30 am

Thanks all,

I think this is a very complex actions for a free program.
I decide store locally all images, and send only one email with the notification "Your WebCam had detected motion"

Greetings from Buenos Aires,
David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Re: I need ideas...

Postby Gaev » Fri Sep 13, 2013 1:11 pm

David de Argentina:

This morning, I came to know of this email service provider ... claims it ...

- is built for developers
- supports a RESTful API or an SMTP interface
- lets you send, receive and track emails
- first 10,000 emails per month for free, next 500,000 at $0.50 per 1,000

... did not see any daily limits.

Perhaps you can check it out to see if it can meet your requirements here.

Might also be of interest to NeoBook Plugin Developers.

Haven't checked it out myself, but you might also be able to deploy it with just the native InternetGet and InternetPost commands.

Happy hunting.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: I need ideas...

Postby David de Argentina » Fri Sep 13, 2013 1:52 pm

Thanks Gaev !

I just open an account and testing this.
Service appairs to be fast and easy to use.

Greetings from Buenos Aires,
David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Re: I need ideas...

Postby Gaev » Fri Sep 13, 2013 2:57 pm

David de Argentina:

Service appairs to be fast and easy to use.

Wow ... that was real fast ... just 41 minutes between posts !!!

When you are done, perhaps you can share your experience with the community ... in particular, whether it can be deployed from within NeoBook using just the InternetGet/InternetPost commands ... not possible if it requires PUT/DELETE methods ... or expects values to be passed in the "Header of the Request".

If not, could it be invoked from the Browser Object ?

Would enhance the capabilities of Applications built with NeoBook if this service could be deployed from within the Applications ... perhaps the plugin gurus can also look into this.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: I need ideas...

Postby David de Argentina » Fri Sep 13, 2013 3:34 pm

Gaev,

The documentation of the service tells about ways to send emails:

a) Via language of programation (including PHP)
b) Via SMTP.

I'm testing SMTP way. I use my NeoSendMail plugin to send HTML'ed emails using secure server.

As the documentation says mails can be sent using several ports and protocols, I guess NeoBook users could use "SendMail" action over SMTP / port 25. I didn't test it.

I think this is a great discovery by you...
Thanks again,
David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Re: I need ideas...

Postby David de Argentina » Fri Sep 13, 2013 3:47 pm

Tested on "SendMail" Action:

Code: Select all
Setvar "[MailUserID]" "postmaster@youraccount.mailgun.org"
Setvar "[MailUserPassword]" "yourpass"
SetVar "[MailServer]" "smtp.mailgun.org"
SetVar "[MailPort]" "25"
SendMail "target@servermail.com" "postmaster@youraccount.mailgun.org" "Test" "Hello World !" "" ""


Works like a charm...

My 0.01
David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Re: I need ideas...

Postby Gaev » Sat Sep 14, 2013 4:36 am

David de Argentina:

Thank you for sharing your experience re deployment with NeoBook's SendMail comand.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: I need ideas...

Postby ajhunt » Mon Jul 28, 2014 4:10 am

Hi David, Can you please please help as not getting anywhere. I created a new accounf at mailgun.org but cannot get Neobook's "SendMail" to work with it. Am I missing something!! The details I am using are: Do I need to create a domain or something; all I have done is created an account.

SetVar "[MailUserID]" "postmaster@easyboothderby.mailgun.org"
SetVar "[MailUserPassword]" "mypassword"
SetVar "[MailServer]" "smtp.mailgun.org"
SetVar "[MailPort]" "25"
SendMail "ajhunt@freeuk.com" "postmaster@easyboothderby.mailgun.org" "Heading Text" "Body Text" "!C:\My_Image.png" ""

Any help or a step-by-step guide to setting up with mailgin.org greatly appreciated.

Kind Regards
Anthony
ajhunt
 
Posts: 215
Joined: Sat Apr 23, 2005 2:33 pm
Location: United Kingdom

Re: I need ideas...

Postby Wrangler » Mon Jul 28, 2014 7:43 am

Try using port 587.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1505
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 1 guest