Page 1 of 1

ENC28J60

Posted: Thu Mar 07, 2019 10:40 pm
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

Re: ENC28J60 Bug

Posted: Sat Mar 09, 2019 3:10 pm
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!

Re: ENC28J60 Bug

Posted: Mon Mar 11, 2019 11:11 am
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.

Re: ENC28J60 Bug

Posted: Mon Mar 11, 2019 11:40 am
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

Re: ENC28J60 Bug

Posted: Mon Mar 11, 2019 12:03 pm
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

Re: ENC28J60 Bug

Posted: Mon Mar 11, 2019 12:13 pm
by Alan_37
Hi LeighM

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

Re: ENC28J60

Posted: Mon Mar 11, 2019 2:52 pm
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

Re: ENC28J60

Posted: Mon Mar 11, 2019 4:12 pm
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.

Re: ENC28J60

Posted: Sat Apr 17, 2021 6:38 pm
by hasait6
thank you Alan very mych and thank you to all persons for your help, i hace elevators , and i want to do it for rescue, if same one has been locked inside and elevator is far.

Re: ENC28J60

Posted: Sat Apr 17, 2021 10:41 pm
by hasait6
other question please, when i clock for page1 , web will be http://192.168.0.100/page1.htm, if i want to go back for have just 192.168..0.100, without page1.html, what i must do? thank you friends

Re: ENC28J60

Posted: Mon Apr 19, 2021 12:19 pm
by Benj
Hello,

The IP address http://192.168.0.100/ is basically just a link to the IP. If you leave the file blank then normally a default file is used usually with the name index.htm.

If you want to have a link to the file then you can simply have a piece of html like this.

Code: Select all

<a href="http://192.168.0.100/">Home</a>

Re: ENC28J60

Posted: Mon Apr 19, 2021 12:24 pm
by hasait6
Thank you very much my friend :wink: ,

Re: ENC28J60

Posted: Mon Apr 19, 2021 12:30 pm
by hasait6
Good morning everyone, sorry if I ask a lot, :), I use ENC28j60 for an elevator, and I want an error to appear every time, it is recorded in the myphp database, the problem that I fear, that I do not put in the program flowcode, thank you very much friends

Re: ENC28J60

Posted: Mon Apr 19, 2021 11:29 pm
by Benj
Hello,

I'm guessing the MySQL database is running on a LAMP type server (Linux, Apache, MySQL, PHP).

I would setup a PHP page that logs data to the MySQL from parameters that are passed to the page.

You can then pass parameters to the page by using the URL and doing a page request using the ENC28J60 module.

GET 192.168.0.100/?Error=Error123&ErrorType=123&Flowcode=Good

Hope this helps. Let us know if I've got the wrong end of the stick.

Re: ENC28J60

Posted: Tue Apr 20, 2021 11:50 am
by hasait6
Thankbuou Benj , i will try, i will inform you

Re: ENC28J60

Posted: Tue Apr 20, 2021 2:40 pm
by hasait6
hi all friends., i have a question more :), when i toush arduino push button, for example B0.i want to send email to me and go from http://192.168.0.100/page1.htm to 192.168.0.100. thank you very much

Re: ENC28J60

Posted: Tue Jan 04, 2022 2:27 pm
by hasait6
Some one know how can send sms from enc28j60 to mobile please? Thank you very much

Re: ENC28J60

Posted: Wed Jan 05, 2022 12:59 pm
by Benj
Hello,

We are discussing how to send an email here and also discussing adding a component for v9 though the component might not be compatible with the ENC28J60 module at the moment.

https://www.flowcode.co.uk/forums/viewt ... 4829#p4829