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


Closed Thread
Results 1 to 40 of 63

Hybrid View

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

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

    Hi Dwight,
    Wonderful, please join the fun!

    No, I wrote 25K22 in error, it's meant to say 25K20 so you're fine - just use the AMICUS18 as it is. (You CAN definitely use the 25K22 if you want but I think you'd need to run it on 3.3V, I don't remember if the W5100 has 5V tolerant inputs). I'd like to stress, again, that you don't need an AMICUS18 at all, the routines will work with ANY PIC that has a MSSP module.

    No, don't overwrite/replace the bootloader. Add DEFINE LOADER_USED 1 at the top and set MCSP (or whatever you use) up to use the AMICUS Loader. It'll be a lot faster than re-flashing with the PicKit2.

    Progress is good but a bit slow. This is all new territory for me, researching protocols, reading RFC's, trying, failing, trying again.

    The goal is basically a set of routines, lets call it a "framework", which you can use to build the application you need. It won't do everything but it'll provide the base functionallity upon which we can write the actual application. At the moment I have the basic routines used to communicate with the W5100 and a couple of support routines to make using sockets and moving data in and out of easier. This is allready presented and published in the thread.

    I have DHCP (Dynamic Host Configuration Protocol) working - also presented in the thread.
    I have SNTP (Simple Net Time Protocol) working, (derived from Charles really accurate clock code but without using LONGs)
    I have SMTP (Simple Mail Transfer Protocol) (with authentication) basically working (it sends mails) but it needs more work to increase the robustness and improve the interface to the main application.

    When I'm happy with the SMTP code I think I'll take on DNS and if/when that works I think I'll try to make some kind of HTTP server "building block" but I'm not sure it'll work since each and every application will be different. Perhaps it's just better to write that from scratch - I don't know. The biggest hurdle, as I see it, is how to handle a "filesystem" of some sort on the PIC. A single, very simple web-page is not a problem but it gets complicated when you want multiple pages, perhaps images etc. Actually storing them (SD-card, SPI-flash, I2C-EEPROM whatever) is one part, keeping track of them (ie. the filesystem) is another and how to get them INTO the memory device is a third.

    The application you envision is pretty much what I had in mind when I started but I'm trying to write the code as generic as possible. That way you can included the functionallity you need and leave the rest out. With the code and examples already presented you should be able to get DHCP and a simple web-server going. Perhaps you'll get a general HTTP server building block going before I get to it.

    Keep us posted on your progress!

    /Henrik.

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

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

    Hi,
    Just thought I'd give those with interest in this project a short update of what I've been doing.

    Take a look at the following screenshot:

    Name:  W5100_Test.jpg
Views: 7510
Size:  124.8 KB

    The screenshot itself is pretty self explainatory but I'll do a short explanation of what is happening (it's quite a bit).

    At bootup the DHCP code is executed to retrieve the network parameters from the DHCP server, then the W5100 is configured with those parameters. Then the SNTP code is executed to retrieve current time from an SNTP server on the net. Then a series of DNS queries are run, looking up the IP-adress of some well known URL's. The last URL that DNS queries is the SMTP server for my email account. Once it gets that IP-adress it uses it in the SMTP code to login to my account, using authentication (no encryption just AUTH LOGIN (BASE64 encoded username and password)), and sends an email to my account - which you can see next to the serial terminal.


    There is one thing I don't get though. Browsing to to the IP-adress retrieved by the DNS code gets me to the correct places in all but ONE instances, namely THIS SITE. If I PING www.picbasic.co.uk I get the same IP as my DNS code and if I run Wireshark and browse to www.picbasic.co.uk its DNS-records shows the same IP-adress but if I browse to that very same IP I do not end up here. I'm pretty sure it's not an error in my code since every other URL I've tried seems to work. It has to be something specific with where and how this site is hosted. Anyone know, and can explain, what's going on?

    Anyway the DNS code currently "only" handles normal queries, not reversed or any other type, like MX etc. It does handle both direct type A responses and CNAME responses, either single or "nested". For example, the query for microsoft results in a response with no less than three CNAME records (aliases) before finally arriving at the IP-adress shown.

    That's it, just wanted to show you what's going on at my end. If anyone else is doing anything cool, please tell!

    /Henrik.
    Last edited by HenrikOlsson; - 25th October 2011 at 19:19.

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

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

    It has to be something specific with where and how this site is hosted. Anyone know, and can explain, what's going on?
    Shared/virtual machine/site.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Feb 2011
    Location
    South Carolina, USA
    Posts
    7

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

    Henrik, have you been able to work on this project any more?

    john

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

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

    Hi John,
    Yes, a little bit. I've been working on external SPI flash routines for storing HTML-data and use "dynamic variables" in the HTML. This now works fairly well and I'm working on a way to use MPFS2 images. As it stands I can read the FAT table and access the files alright but I'm trying to figure out the correct/best way to have more than one file open at a time. I tend to be a bit (perhaps a bit too) conservative when it comes to using RAM and I try to make the most out of it. Having multiple file "open" seems to be quite a hog in that respect but perhaps I'll just have to accept that and just get it working.

    (It would be nice to have proper functions and local variables in PBP)

    Is there anything in particular you're trying/want to do or thinking about?

    /Henrik.

  6. #6
    Join Date
    Feb 2011
    Location
    South Carolina, USA
    Posts
    7

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

    I have done a couple small projects for fun but always wanted to do that self made home security/automation system. I know, I know, there are plenty of companies selling them and a few home brew projects. The general operation of the pieces are the easy part. The missing part is web interface for setting up the system and monitoring remotely.

    I purchased a Netburner kit but decided it would be nicer if it could be a complete PBP project and not a mix. Then my 2 and 4 year old boys decided to put the project on hold a year ago....

    I have been following this thread closely. Your work is very impressive.

    Thank John

  7. #7
    Join Date
    Feb 2011
    Location
    South Carolina, USA
    Posts
    7

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

    Henrik,

    Would you mind sharing your code through your Oct 25th 2011 post (or after) that included SMTP and SNTP. I would like to start working on sending simple variables and I/O status between two modules and your code around that point really would be a great starting point for me.

    John

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