Shop OBEX P1 Docs P2 Docs Learn Events
PINK email addresses — Parallax Forums

PINK email addresses

GeorgeGeorge Posts: 11
edited 2007-01-23 20:10 in General Discussion
I'm writing an applications that uses the BS2P24 for sending email with a PINK module. My problem is the limited amount of variable space available in the BS2. Some of the email addresses I need to send messages to are longer than what's available in the stamp.
I can store the email addresses in the web variable easily and have plenty of room.

Is there a way that I can tell the PINK module to send to an email address located·in·one of the·web variables?

This would avoid the variable limitations of the stamp and free up that space for other uses.

Thanks,
George

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-01-17 23:54
    George,

    With the BS2p you could pull addresses form EEPROM or Scratch Pad RAM and send them to the e-mail address variable for sending the e-mail. This isn’t a problem since you should be able to adjust the value of any variable on the PINK via the BS2p serial connection. Is this what you mean?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • GeorgeGeorge Posts: 11
    edited 2007-01-18 00:52
    Sort of.

    I have the email addresses stored in EEPROM and I load them into the web variables for editing by the end user. I also place an email address into the Send To web variable this way as well.

    After the main routines of my program take their share, I have 22 bytes left over in variable space for this purpose.

    I don't understand how I can move more than 22 bytes at a time from EEPROM to the PINK variables.

    Is there a way I can send 22 bytes into the Send To web variable once, and then append more bytes to that until I have the complete email address in the Send To web variable?

    Thanks,
    George
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-01-18 05:52
    George,

    You don’t have to send all the bytes in one SEROUT to get them into the variable in the PINK Module. If you form a string in SPRAM you can use SEROUT within a loop to send each character until the end of the string the same way you would read a string from EEPROM DATA statements to send out. This would allow you to create/edit e-mail addresses in SPRAM (126 bytes of it on a BS2p) and then send it out to the variable on the PINK. Let me know if you see what I mean. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • GeorgeGeorge Posts: 11
    edited 2007-01-18 06:42
    I believe I understand. However, I have the SPRAM full of stored variables that I can't destroy.

    So I'm guessing it may be possible for me to use a single loop to SERIN directly from EEPROM storage (where the addresses are normally stored) and SEROUT to the PINK directly?

    Thanks,
    George
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-01-18 15:11
    George,

    That is correct. There are plenty of examples in various programs we have for the BASIC Stamp, but essentially you would send the preamble (header bytes for the command) followed by the data you are sending, followed by the terminating character as defined in the documentation (CLS). For example, using our example program 6, you have:

    SEROUT 8,84,[noparse][[/noparse]"!NB0WBM:This is a UDP test message",CLS]

    In this case you would send the “!NB0WBM:” together followed by each character of the message. After the loop completes you would send the CLS which terminates the data packet. The first part would be send by a single SEROUT statement, while the remaining characters could be sent out within the loop by the SEROUT in the loop, including the CLS or 0, which would also cause you to exit the loop.

    I will try to get a program together today or tomorrow to demonstrate what I mean using the e-mail address variable and a lookup table of addresses. After each send you could use the web page interface to verify the address was changed. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • GeorgeGeorge Posts: 11
    edited 2007-01-18 17:19
    Thanks Chris,
    I probably would have missed sending the CLS.
    George
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-01-19 23:51
    George,

    ·· The CLS is really just a 0 (zero). In any event I have written the code I mentioned. Here is how it works…I have a list of e-mail addresses in EEPROM using DATA statements and terminating with a 0 (CLS). The program sends the preamble and data and when it encounters the 0 it stops for 5 seconds. Then it goes again through 6 sample addresses. You could easily add more and increment the cnt in the FOR…NEXT loop.

    ·· What you do is open your web browser to the PINK Module and go to Modify Variables page. Toward the top is the e-mail address stuff…Download the program to the BASIC Stamp and then hit your refresh button on your browser. You should see the first e-mail address appear there. Keep hitting refresh and every 5 seconds you should see a different address appear in that area until all 6 have been displayed.

    ·· Two things to keep in mind with this code…I am using 9600 bps on the BS2 rather than 2400 bps. I also used P14/P15 since I am actually connected through the servo headers. So be sure to adjust your code/constants accordingly. Otherwise this works great to demonstrate what we talked about. I hope this helps. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-01-23 15:10
    George, did the example help you?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • GeorgeGeorge Posts: 11
    edited 2007-01-23 17:12
    I have not had time to try it yet, but hope to today. I can read and understand the code and it looks like a good solution. I will post after implementation.
    Thanks,
    George
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-01-23 20:10
    George,

    I hope it works for you. I know obviously you will have to implement it slightly differently to fit into your existing application, but as long as you keep track of the pointers (in the EEPROM) you should be set. But mainly I wanted to point out that when changing variables on the PINK Module that not everything needs to be in one place all at once. Let us know how you make out. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.