How to use email to control Spinneret OUT port?
john_s
Posts: 369
Before jumping into a Spinneret project I'd like to ask around in case somebody thought about or implemented this method.
Objective: Every time a PC sends an email it is also forwarded to Spinneret. Upon receiving of a specific email Spinneret reacts by setting the OUT pin HIGH.
Scenario A: Both - PC and Spinneret - are on to the same ethernet network.
Scenario B: PC and Spinneret are a distance apart and not ethernet wired
Question: Can you point me out to where should I start with this? Did anybody come across a working example?
Thanks,
John
Objective: Every time a PC sends an email it is also forwarded to Spinneret. Upon receiving of a specific email Spinneret reacts by setting the OUT pin HIGH.
Scenario A: Both - PC and Spinneret - are on to the same ethernet network.
Scenario B: PC and Spinneret are a distance apart and not ethernet wired
Question: Can you point me out to where should I start with this? Did anybody come across a working example?
Thanks,
John
Comments
To send an email to the Spinneret means that the Spinneret must be an email server. As far as I know, no one has created a Spinneret mail server. However, the community has created email clients.
Here is Beau's SMTP client
http://forums.parallax.com/showthread.php?134586-DEMO-SMTP-quot-SpinMail-quot
The SMTP I built
http://spinneret.servebeer.com:5000/client/email.htm
Now both of these examples are SMTP which is out going email but the concept applies to reading email on a server only the port and commands are different.
Learn about how email works.
http://smanage.tripod.com/tel.html
He calls it Email-switcher and it's pretty close to what I'm trying to achieve...
Conversation with the server as seen by the Spinneret (custom terminal).
You need to know your ISP domain IP and port to initialize the TCP socket.
I understand that the amount of info I need to plow through is way above of what I try to accomplish.
Let's first try the 'Scenario A' where my Spinneret sits next to my PC and is RJ-cable wired to the same switch.
Can it be just a switch or is a router more appropriate in this place?
I'd like to start with my Prop to just start counting the number of emails that my PC sends via Outlook Express.
Is it possible for the Prop to somehow 'become aware' and count the instances when my PC sends an email without actually going through my ISP email server loop?
Can I send an email from OE directly to say 192.168.1.120:5000 ?
Thanks,
John
It's possible but building a web server is not a trivial task. Instead of sending an email, why not send an HTTP message to Spinneret?
I'm trying to work with the Spinneret as well, and just starting to get my head around this kind of thing. When you say "send an HTTP message to Spinneret", you mean through a control on a web page? I'm working through this tutorial:
http://spinneret.servebeer.com:5000/index.htm
and just about at the place where I will be turning on and off the Spinneret's LED through a webpage. I'm not understanding what's going on behind the scenes, though. My browser is requesting a page which is stored on the Micro SD card in the Spinneret, correct? And when that page loads into whatever computer is accessing it, the controls (buttons, hyperlinks, etc.) somehow send messages to the Spinneret? There is going to be Spin (or Prop Asm) code on the Spinneret that interprets those messages, and does things like bring the LED pin high/low, right? Is there a better way to understand this?
Yes, read on. Later you'll find filters to intercept resource requests and run custom SPIN code.
Okay, the LED On/Off code works. I'm able to turn on and off the Spinneret's LED from the browser on my cell phone. That's exceptionally cool. And I understand how that works well enough that I'm confident that I could instead be turning on or off one of the I/O pins (and therefore controlling an external device) or sending a serial message out the serial port. I'm starting to get it, both with respect to the relationship between server and browser, and the relationship between the HTML code and the Spin code on the Spinneret. Amazing device.
Are you okay with asking both of our questions in your thread, then?
You're welcome to join this thread as it only helps us all to figure out the answer and sharing tips and notes when learning the innards of Spinneret. I'm a beginner with any Prop related subject, and will put my hands on the real thing sometime next week when it arrives. I figure it's a joy to learn when designing something you need. Till then I'd be glad if you keep asking your Spinneret / Pro questions using this thread as well...
Close to what you've achieved with a cell phone - I would like to see Spinneret's LED blinking ON / OFF every time an email is send or received ....