Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Build a Webserver with ENC28J60 +AVR
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM Project Blog
View previous topic :: View next topic  
Author Message
Paulvk

Bascom Member



Joined: 28 Jul 2006
Posts: 1257
Location: SYDNEY

australia.gif
PostPosted: Sun Feb 19, 2012 4:23 am    Post subject: Reply with quote

I have taken the building block idea further and created sort of sub routines for the HTML pages.
I removed all the headers and the ends of the pages which were all the same and put them into two blocks of data of there own, so t first you restore is the header for every page, then when you get to CHANGE96 you restore the page you want after you come to the end of your page CHANGE97 you then restore the end of page data this save over 2K of flash.

So just as we use sub routines in Bascom to do things over and over we are now using the same idea in the HTML pages stored in the flash!
Back to top
View user's profile
Paulvk

Bascom Member



Joined: 28 Jul 2006
Posts: 1257
Location: SYDNEY

australia.gif
PostPosted: Sun Mar 25, 2012 9:10 am    Post subject: Reply with quote

Have been very busy for the past six weeks and have not been able to do a lot but I have now converted the code to a modular project taking all the SUB programs out and putting them into separate files of their own, I then created a file Test_include.inc where I have put a list of all the $include files that make up the project I only have $include Test_include.inc in the main program this appears to work ok as it compiles without errors and runs on the board. Note I will rename the file to be the same as the project instead of test. Now I have to change my way of thinking to not scrolling down the code to find the SUBs which was very time consuming with the 8000 lines that it grew to. The project type format will be a great addition to bascom I think. I also find that some small enhancements are needed to the format but these are small for example it would be good to be able to double click on the file in the project window to open a file. I feel that this new project format may be seen eventually as one of the great steps forward in the evolution of bascom.

I have attached the first version of the code as a project.


Regards Paul
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Sun Mar 25, 2012 9:38 am    Post subject: Reply with quote

Paulvk wrote:
I also find that some small enhancements are needed to the format but these are small for example it would be good to be able to double click on the file in the project window to open a file.


it actually does this. thanks for the update!

_________________
Mark
Back to top
View user's profile Visit poster's website
Paulvk

Bascom Member



Joined: 28 Jul 2006
Posts: 1257
Location: SYDNEY

australia.gif
PostPosted: Sun Mar 25, 2012 1:11 pm    Post subject: Reply with quote

In the project-PDF viewer-chip pin out nothing happens when I double click on the file I have to open it via File > open is there something I have to set?

Regards Paul
Back to top
View user's profile
Paulvk

Bascom Member



Joined: 28 Jul 2006
Posts: 1257
Location: SYDNEY

australia.gif
PostPosted: Mon Mar 26, 2012 12:15 am    Post subject: Reply with quote

Well tried the double click on another computer and it works! have to find out why its not working on the other! I have bascom on a few computers so I will try on some of the others to see if its just that one.

Regards Paul
Back to top
View user's profile
Paulvk

Bascom Member



Joined: 28 Jul 2006
Posts: 1257
Location: SYDNEY

australia.gif
PostPosted: Wed Mar 28, 2012 11:06 am    Post subject: Reply with quote

I worked out whats going on with the double click not working what happens is that it has a fixed path not a relative one so because I moved the files to another folder it no longer found them also if the drive number changes it can not find them, it just happened that when I placed the files on a USB drive and took them to another computer the drive number was correct.
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Fri Apr 06, 2012 2:53 pm    Post subject: Reply with quote

i changed it so that files are stored with their relative path\name. that should make it portable.
_________________
Mark
Back to top
View user's profile Visit poster's website
Paulvk

Bascom Member



Joined: 28 Jul 2006
Posts: 1257
Location: SYDNEY

australia.gif
PostPosted: Sat Apr 07, 2012 4:11 am    Post subject: Reply with quote

albertsm wrote:
i changed it so that files are stored with their relative path\name. that should make it portable.


Thank you Mark

I am finding it so much easier to just double click on a Sub program as a file and be able to look at it as well as the main loop not having to scroll down to it .

Bascom just keeps getting better Very Happy


Regards Paul
Back to top
View user's profile
Paulvk

Bascom Member



Joined: 28 Jul 2006
Posts: 1257
Location: SYDNEY

australia.gif
PostPosted: Mon May 14, 2012 10:40 am    Post subject: Reply with quote

Life is still busy for me but have been working on the code but will not post the latest yet as its a bit messy needs a tidy up after trying a few things and working more on the web pages to fit more into them one good resource for this is Firefox it has good help in its hints when you go to the page source. Now one thing that was needed was a page for the re-start one that waited for a time while the server starts up again then sends you to the index/start menu I now have one it counts down then it loads the page you want it to. I thought I would post it here on its own so others can use it. With this the little server now sends java script.

Note I have moved to the M1284P as I ran out of flash and ram but the pages take only 3% of the flash its all manipulating the variables, checking them, storing in eeprom and lots more. The clock is working there are 11 start and end dates for daylight saving now stored in eeprom making that 11 years , also a time offset from UTC is stored and they are both checked for validity. I have lost count of how many webpages it generates from that 3% of flash now.

Regards Paul

Here is the java script Note it needs the CR/LF to work correctly has to be a zip file forum does not like the script parts.
Back to top
View user's profile
Paulvk

Bascom Member



Joined: 28 Jul 2006
Posts: 1257
Location: SYDNEY

australia.gif
PostPosted: Fri Jun 15, 2012 11:38 am    Post subject: Reply with quote

This latest upload is all the files it includes even the HEX and EEPROM files so even with the free version of bascom you can load a m1284 with them just need to look at the circuit diagram I have posted for the chip select, serial 74HC595 buss and LCD connections. I have not yet finished so its still a bit messy in places but its working! There are 72 main pages displayed with many multiple input forms off them there are so many parameters that have to be able to be set, stored in EEPROM and changed yet I still have more to add. The clock is working really well not even one second out every 24hours at which time a NTP request is made which puts it spot on again. NOTE the AVR gets its clock from the 12500000hz output of the ENC28J60 and the SPI buss is running at half this with the double speed bit set.

Regards Paul
Back to top
View user's profile
Paulvk

Bascom Member



Joined: 28 Jul 2006
Posts: 1257
Location: SYDNEY

australia.gif
PostPosted: Sat Sep 22, 2012 1:07 pm    Post subject: Reply with quote

Just a note to those following this blog >>

I have not stopped with this project as you can see by the other two blogs I am working with two ready made modules I will use these with the server but first I had to create the code to work with them I hope to make the 8 x 8 matrix remote clocks getting their time via wireless from the servers NTP function.


Regards Paul
Back to top
View user's profile
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Sat Sep 22, 2012 2:20 pm    Post subject: Thanks Reply with quote

Paul. Thanks for all your work.

At the moment I am also working on the matrix clock. Have put a DS1302 on it and time is running. Now working on humidity and temperature.

Have fun
Ben Zijlstra
Back to top
View user's profile Visit poster's website
fuba

Bascom Member



Joined: 13 Nov 2012
Posts: 7

PostPosted: Tue Nov 13, 2012 1:21 pm    Post subject: Build a Webserver with ENC28J60 +AVR Reply with quote

thanks you very much Paulvk for complete help and code Wink
with regard
Back to top
View user's profile
tetye

Bascom Member



Joined: 04 Jan 2008
Posts: 6
Location: Budapest

hungary.gif
PostPosted: Tue Mar 19, 2013 12:18 pm    Post subject: linux_bug Reply with quote

Hi All

Ive been experimenting with an enc28j60 board , an atmega644 , and with examples from PaulVK.
Under windows everything is fine , but under linux if im
trying to open the address (no matter which browser , graphic or text) doesnt opens , only says connecting... then nothing.
The tcpdump says Bad hdr length. Can anyone help me a bit , why this is occuring ?
Also the ping is duplicated.

There is the source in the attachments of what im trying to make (a webpage with temp and humidity)

Thanks all in advance,
Best regards
Tetye
Back to top
View user's profile Visit poster's website MSN Messenger
Paulvk

Bascom Member



Joined: 28 Jul 2006
Posts: 1257
Location: SYDNEY

australia.gif
PostPosted: Tue Mar 19, 2013 11:12 pm    Post subject: Reply with quote

Hello tetye

I have not tried it with my linux machines yet but there are some problems with browsers with them expecting multiple packets this is what is still beyond my skills to add multiple packets to the TCPIP . I have used it with firefox and IE I now have an android tablet so will have to try it on that as well. Ben Zijlstra wrote the TCPIP code and I made it more compact this was a big learning curve for me but it taught me a lot. It may be a day or so before I can try the server with linux but I will let you know what I find.

Regards Paul
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM Project Blog All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4  Next
Page 3 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum