Using the Arduino Ethernet shield with AMICUS18 (Joint forum project?)


Closed Thread
Results 1 to 40 of 63

Hybrid View

  1. #1
    Join Date
    Mar 2014
    Posts
    5

    Default Re: Using the Arduino Ethernet shield with AMICUS18 (Joint forum project?)

    I agree absolutely with you the same ...

    I did, the web page, UDP, TCP, with ENC28J60. but the W5100. liked very much.

    I'm done with ping 5100.

    I'm done with protons + 18F4620 software. I've revised your ping code for the proton.

    I must take a little more now.

    I bought a new module.

    http://www.elektrovadi.com/w5100-ethernet-modul, PR-1389.html

    then I'll continue with this module.

    I wrote you about my progress from time to time. maybe I can come to the smtp portion.

    You have to believe that I'm the one who worked very hard

    ty for help.. If there is a flow diagram with smtp me if he could be good enough for me.

    bye


    Name:  foto?raf 1.jpg
Views: 2351
Size:  667.5 KB

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612

    Default Re: Using the Arduino Ethernet shield with AMICUS18 (Joint forum project?)

    Hi,
    Ah, excellent work! Too bad you're using the wrong compiler. ;-)

    Everything you need to know is in the RFCs covering the SMTP protocol but they can be a bit "much" from time to time. I also, strongly suggest that you do some "manual" emailing using telnet to your intended server, that way you get a feel for the protocol and what it "looks like". Anyway, here's a list from my notes
    • Setup a free socket with IP adress and port (usually 25 or 2525) of remote SMTP server.
    • Open the socket and wait for it to initialize.
    • Issue the sockets connect command, ARP request resolves the remote MAC adress and populate the W5100 registers.
    • Wait for remote server to return a response 220. If it doesn't the remote server probably isn't a SMTP server.
    • Send EHLO adress.domain
    • Wait for remote server to return a response 250
    • Send AUTH LOGIN
    • Wait for server remote server to return a response 334
    • Send the username of the email account, BASE64 encoded
    • Wait for server remote server to return a response 334
    • Send account password, BASE64 encoded
    • Wait for remote server to return a response 235 - when received the connection is authenticated.
    • Send the Mail From: command
    • Wait for remote server to return a response 250
    • Send the Rcpt To: command
    • Wait for remote server to return a response 250
    • Send the DATA command
    • Wait for remote server to return a response 354
    • Send a <CR><LF>, a valid email header, the content of the email, followed by <CR><LF>.<CR><LF> (note the dot)
    • Wait for remote server to return a response 250
    • Send the QUIT command
    • Wait for remote server to return a response 221 (bye bye).
    • Close the connection.

    A complete email including the header might look like this, note the blank lines and the dot at the end.

    Date: Tue, 25 Mar 2014 19:18:00 +0200
    Message-Id: <1234>
    From: Your W5100
    To: Someone <[email protected]>
    Subject: Test

    Hello,
    This is a test.
    .

    If you don't want to use authenticated login the use the HELO command instead of EHLO.

    And again, note that the above will not work with email servers requiring SSL or other encryption.

    /Henrik.

  3. #3
    Join Date
    Mar 2014
    Posts
    5

    Default Re: Using the Arduino Ethernet shield with AMICUS18 (Joint forum project?)

    hello henrik

    thanks you for help and the pbp source code,

    i was modifie your code for proton basic , and i was use 18F4620 , now wprking very stabile.

    my web server
    Name:  1.bmp
Views: 2022
Size:  1,005.7 KB



    - ping it is ok!
    - web server it is ok
    - send get ang command it is ok
    - response and data it is ok

    but i have any problem,

    it is my html code,

    how to use scrip in to do code?

    index:


    Buffer = "<html>" : GoSub PutStringInTXBuffer
    Buffer = "<body>" : GoSub PutStringInTXBuffer
    Buffer = "<title>my server</title>" : GoSub PutStringInTXBuffer

    Buffer = "<h3>My Mini Web Server Alive</h3>" : GoSub PutStringInTXBuffer

    Buffer = "<img src=http://www.enkatechnology.com/12.jpg >" : GoSub PutStringInTXBuffer


    Buffer = "<p>Thenk you Henrik Olsson 2014</p>" : GoSub PutStringInTXBuffer

    Buffer = "<form name=input action=/ method=get>" : GoSub PutStringInTXBuffer
    Buffer = "<input type=submit align=center name=tst1 value=3 />" : GoSub PutStringInTXBuffer
    Buffer = "</form>" : GoSub PutStringInTXBuffer


    Buffer = "<form name=input action=/ method=get>" : GoSub PutStringInTXBuffer
    Buffer = "<input type=submit align=center name=tst2 value=5 />" : GoSub PutStringInTXBuffer
    Buffer = "</form>" : GoSub PutStringInTXBuffer


    Buffer = "<a href=http://www.google.com>Go To Google</a>" : GoSub PutStringInTXBuffer

    'Buffer = "<p> toplam request = " + Str$(Dec RequestCount) + "</p>" : GoSub PutStringInTXBuffer


    Buffer ="<p>AN2 Data= </p>" : GoSub PutStringInTXBuffer
    Buffer ="<script src=/s></script>" : GoSub PutStringInTXBuffer
    Buffer ="<p><script>document.write(AN2)</script></p>" : GoSub PutStringInTXBuffer





    Buffer = "</body></html>" : GoSub PutStringInTXBuffer



    Return


    i wat to use <script src=/s></script> and turn the back "<p><script>document.write(AN2)</script></p>" AN2 = 27 for exp. what you thing about?



    i was receive "s" and portc.2 led is blinking but, i dont send the AN2 data to back.

    my data receive code,

    data_kontrol:


    '----------------------------------
    If Buffer[11] = "3" Then
    PORTC.2 = 1'led aç
    'END
    EndIf
    '----------------------------------
    If Buffer[11] = "5" Then
    PORTC.2 = 0'led kapat
    'END
    EndIf
    '----------------------------------
    If Buffer[5] = "s" Then
    PORTC.2 =1
    DelayMS 500
    PORTC.2 =0
    EndIf


    Return
    Last edited by tayfun; - 27th April 2014 at 17:26.

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612

    Default Re: Using the Arduino Ethernet shield with AMICUS18 (Joint forum project?)

    Hi,
    Nice work! I'm glad the code is getting some use!

    I know very little about HTML and even less about JAVA Script (which I suspect is what Document.Write() is?

    However, doing document.write(AN2) where I'm guessing AN2 is a variable in you PBP (Proton) program probably isn't working the way you expect. For it to work the way you've coded it the PutStringInTxBuffer routine would need to be able to decode and understand Java Script, find AN2 and put its content, as a string into the buffer - that's obviously NOT how it works or is intended to work.

    Again, I'm very green on this HTML and JAVA stuff so I may be wrong but that's how I think it works.

    In PBP, to load a "value" from a variable into an array as a string you could use ArrayWrite, I'm not sure how to do that in Proton but I'm sure there's some ToStr or whatever.

    Does that make sense?

    /Henrik.

  5. #5
    Join Date
    Mar 2014
    Posts
    5

    Default Re: Using the Arduino Ethernet shield with AMICUS18 (Joint forum project?)

    it is ok, is ok! work fine...

    i will new stage , w5100 use with sd card, and screen any picture or complicate html pages. ty .. bye.




    this is code,
    '------------------------------------------------------------------------------------------------------------------------

    send_back_result:


    RequestCount = RequestCount + 1
    GoSub GetFreeTXSize
    TotalCount = 0

    Buffer = "HTTP/1.1 200 OK "+13+10+0
    GoSub PutStringInTXBuffer
    Buffer = "Content-Type:text/html"+13+10+13+10+0
    GoSub PutStringInTXBuffer

    '---------server side------------------------------------client side----------------------------------------------------

    If Buffer[5] = "s" Then '<--------------------- send me "s" block <script src=s></script>"


    Buffer = "var AN2=" ' <------------send me AN2 variable <script>document.write(AN2)</script
    GoSub PutStringInTXBuffer

    Buffer = "1977" '-------------------> put string "1977" or any string variable
    GoSub PutStringInTXBuffer

    Buffer = ";"
    GoSub PutStringInTXBuffer' -------------------> and put end of the string.

    EndIf

    '--------------------------------------- end of the cominicate

    WizPtr = WizPtr + TotalCount ' load others... end.


    WizAdress = W5100_S0_TX_WR0 : WizData = WizPtr.HighByte : GoSub Write_W5100
    WizAdress = W5100_S0_TX_WR1 : WizData = WizPtr.LowByte : GoSub Write_W5100

    ' Issue a SEND command.
    WizAdress = W5100_S0_CR : WizData = W5100_Sn_SEND : GoSub Write_W5100

    WaitForCompletion2:
    GoSub Read_W5100
    If WizData <> 0 Then GoTo WaitForCompletion2



    ' Then disconnect from the client.
    WizAdress = W5100_S0_CR : WizData = W5100_Sn_DISCON : GoSub Write_W5100

    ' And close the socket. We'll reopen the socket again in the main routine.
    WizAdress = W5100_S0_CR : WizData = W5100_Sn_CLOSE : GoSub Write_W5100

    GetRequest = 0




    Return

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts