ENC28J60

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
User avatar
Alan_37
Posts: 157
Joined: Sun May 01, 2016 8:36 pm
Contact:

ENC28J60

Post by Alan_37 »

Hi

I am playing around with the ENC28j60 I have flashed the example to an Atmega 328p from the wiki page

I can Ping the module, view a web page but in the wiki example there are 3 pages I can only access one of them
the problem is that Read TCP document request is not returning the “/page1” string, whatever string I write after the IP/ it is only returning the string "GET"

DataPointer is = 54

is this a bug in the component?


Any help for this please?
enc.png
(19.79 KiB) Downloaded 2272 times
Attachments
ENC28J60_Example.fcfx
(25.78 KiB) Downloaded 87 times
Last edited by Alan_37 on Mon Mar 11, 2019 2:38 pm, edited 2 times in total.

User avatar
Alan_37
Posts: 157
Joined: Sun May 01, 2016 8:36 pm
Contact:

Re: ENC28J60 Bug

Post by Alan_37 »

Hi
Am I doing something wrong or is a component bug?

Although I use flowcode V7 , the new Flowcode V8.1 might have the same bug!

User avatar
LeighM
Matrix Staff
Posts: 2094
Joined: Tue Jan 17, 2012 10:07 am
Contact:

Re: ENC28J60 Bug

Post by LeighM »

Hi,
I think the problem could be that you are not moving the DataPointer after the ReadStringFromBuffer for the "GET" text.
So the next ReadStringFromBuffer expecting the "page1" text will just be returning the "GET" again.

User avatar
Alan_37
Posts: 157
Joined: Sun May 01, 2016 8:36 pm
Contact:

Re: ENC28J60 Bug

Post by Alan_37 »

hi LeighM

Thanks for your reply, in the Wiki example the data pointer is being set in the GetTcpDataPointer component macro,
datapontr.png
(15.67 KiB) Downloaded 2201 times
I understand this can be set manually but it would require Wireshark to see the data.
I don't know where the data pointer has to be set to get the page1 string output.


What value should put in the data pointer variable?

Thanks

User avatar
LeighM
Matrix Staff
Posts: 2094
Joined: Tue Jan 17, 2012 10:07 am
Contact:

Re: ENC28J60 Bug

Post by LeighM »

From the DataPointer the text buffer will contain something like "GET /index.html HTTP/1.1"
So you could either say read and compare with "GET /index"
or first compare the "GET" then move the DataPointer on 5 places and read and compare with "index", "page1", "page2" etc

User avatar
Alan_37
Posts: 157
Joined: Sun May 01, 2016 8:36 pm
Contact:

Re: ENC28J60 Bug

Post by Alan_37 »

Hi LeighM

Thanks for the info , will try it and keep you posted.

User avatar
Alan_37
Posts: 157
Joined: Sun May 01, 2016 8:36 pm
Contact:

Re: ENC28J60

Post by Alan_37 »

Hi LeighM

Yes, it worked just incremented +5 the data pointer that was it so there is no bug.

Just another weird thing I noticed the MCU stop responding if the 2 disabled macros are enabled
don't know why.
stop.png
(200.29 KiB) Downloaded 2184 times
Thanks for your help
Last edited by Alan_37 on Mon Mar 11, 2019 4:14 pm, edited 1 time in total.

User avatar
Alan_37
Posts: 157
Joined: Sun May 01, 2016 8:36 pm
Contact:

Re: ENC28J60

Post by Alan_37 »

Hi LeighM

Just found it, it was the buffer size increased it from 255 to 500 and everything now works as it should :D
buffeer.png
(18.65 KiB) Downloaded 2181 times
You may also want to update the wiki example file with the one attached below.

Thanks very much.
Attachments
ENC28J60_Example.fcfx
(25.14 KiB) Downloaded 89 times

Post Reply