Home AMXForums Archive Threads AMX Applications and Solutions

newbie with Equipment Monitor

richsrichs Junior MemberPosts: 13
I must be missing something basic - but I am trying for the first time to get i!-Equipment Monitor to send an email when the temperature in a client's wine room goes too high. I talked him into this, thinking it was easy, and then I can't get the simplest thing working... sigh...

As a test I included the following in the DEFINE_START section of the master code:

#INCLUDE 'i!-EquipmentMonitorOut.axi' // Include to send notifications
SmtpSetServer('71.74.56.22') // DNS name = 'smtp-server.hawaii.rr.com'
SmtpSetTimeOffset('-1000')
ConfigNotify('[email protected]','[email protected]','Wine Room Temperature')

SendNotify('The Wine Room Temperature exceeds 70 deg F! Action required!',' ')

SmtpQueMessage('[email protected]','[email protected]','Message from AMX System','This is a test message',' ')

Of course, the last two lines are the test lines, and I expected to get two emails. I get nothing. I have pinged the smtp server's name and it resolves OK to the IP address shown. It makes no difference whether I put the IP address in the code or the DNS name. The email address [email protected] is a valid address. The smtp server does not require authentication.

Can anyone point out what I am missing here? I assumed this would be a snap and I feel pretty stupid at this point.

Comments

  • jjamesjjames AMX Sustaining Engineer Posts: 2,901
    Ehh - I don't have an answer, but I do remember running into problems and it was difficult to get running, but I forget what I had to do to get it running.

    Just curious, post any diagnostic / notification messages you get when trying this out.

    Oh, and never try to sell something you haven't done before, that will help prevent the "over promising, under delivering" problems that run wild in this industry. ;)

    One last thing - what version AXI is it? I have 2.1.16 - is that the most current?
  • richsrichs Junior Member Posts: 13
    Can't send email using i!-Equipment Manager

    I get the messages:

    CIpEvent::OnError 0:10:10
    Smtp OnError-IP ERROR (14): local port already used (IP_CLIENT_OPEN/IP_SERVER_OPEN)
    CIpSocketMan::ProcessPLPacket - ClientOpen handle already in use

    Thinking that perhaps port 10 was used elsewhere (I didn't write the code for this job) I searched it all and could find no usage. Nevertheless, I changed dvSmtpSocket to 0:11:10 and got the same error, except for the first line, which read 0:11:0. Same thing happens if I change the port to 12. Neither 11 nor 12 showed up in a port search before I added them in this way, so I don't understand the message.

    I agree completely about the promising ... a friend with experience said, "why don't you have it send an email ... it's easy". When I went back to him after having the difficulties, he said the same thing you did ("I remember it was a pain to get it working, and I don't remember what I did"). Ah well, my client is very understading, fortunately.
  • richsrichs Junior Member Posts: 13
    Oh, sorry...

    Version is 2.1.16, and this is the most current, I think.
  • jjamesjjames AMX Sustaining Engineer Posts: 2,901
    Oh don't give up yet!!

    I'm going to sound like tech support, BUT . . . try loading up a simple program, with nothing loaded in it except the stuff for the Equipment Monitor. Then see what happens; in the mean time, I'm going to go through my code. Post back your simple program with nothing but the email stuff (of course asterisk out the emails and passwords - please do NOT post those.)

    I'm sure we can get this figured out!
  • Spire_JeffSpire_Jeff Formerly Caffeinated Programmer Posts: 1,917
    Try putting the #Include statement just above the Define_Start. An include simply pastes the included code into your code and then compiles. It may be that your test code is being considered in a portion of the program other than Define_Start. (I'm thinking Define_Program possibly).

    Also, you may want to throw a WAIT around everything and give the processor a chance to completely boot up before trying to send out emails.

    You could also just put the code into a button event on a virtual device and then use the debugger and control device dialog to generate the event and follow what is happening.

    Also, it could be that the ISP is blocking or rerouting outbound SMTP through their servers. Have you tried telneting to the SMTP Server to see what is happening?

    Jeff
  • Spire_JeffSpire_Jeff Formerly Caffeinated Programmer Posts: 1,917
    One more thing to verify: Are all of the IP settings configured properly on the master? Specifically, are the DNS and Gateway addresses set?

    Jeff
  • richsrichs Junior Member Posts: 13
    Thanks!
    Spire_Jeff wrote: »
    Try putting the #Include statement just above the Define_Start. An include simply pastes the included code into your code and then compiles. It may be that your test code is being considered in a portion of the program other than Define_Start. (I'm thinking Define_Program possibly).

    Also, you may want to throw a WAIT around everything and give the processor a chance to completely boot up before trying to send out emails.

    Jeff

    AHA! I did both of the above; first I moved the Define_Start statement beyond all the #includes, and then I put a 45 second wait around the code, even including the setup lines, and Voila - I got the email sent to my box! I have to run now as I have company coming, but later on I'll ease back a change at a time so I can see whether it was just that the SendNotify line was happening too fast, or that the code was being compiled as mainline (I suspect the latter). BTW, the DNS and Gateway addresses were all set OK, I checked this before.

    Thanks a lot, Jeff, this was very helpful! And thanks also to JJ; I'm sure that approach would have come up with the same result.

    Aloha, Rich
  • richsrichs Junior Member Posts: 13
    A little more...

    I had to try just to see, so the company is waiting...

    I removed the WAIT from around the setup code, and it still worked fine, then I removed the WAIT altogether, and it still worked just fine. So the problem was the location of the DEFINE_START line. Before trying this were was no startup code in the master; it was all in individual INCLUDE files, so the problem never came up.

    Thanks again, Jeff and JJ...

    Aloha

    Rich
Sign In or Register to comment.