Page 1 of 1
Ethernet Comms
Posted: Fri May 10, 2019 4:16 pm
by wayne millard
Hi Everybody,
Has someone got any example of two micros communicating with each other over a Ethernet network using ENC28J60.
I have tried using some of the examples and i think that the ENC28J60 is working because all the light are flashing when i do a IP scan but cant see any found IP that the PIC is set at. and good example of two passing data would be good.
Thanks,
Wayne Millard
Re: Ethernet Comms
Posted: Thu May 16, 2019 3:11 pm
by stefan.erni
Hi Wayne
I just started to do the same. Here is my hardware I like to use. I use FC8.
I have a little experience with the PIC32MZ2048EFG
Which pic or hardware do you use?
https://www.olimex.com/Products/PIC/Dev ... e-hardware
https://www.olimex.com/Products/Modules ... -ENC28J60/
regards
Stefan

- olimex_all.jpg (273.7 KiB) Viewed 4502 times
Re: Ethernet Comms
Posted: Fri May 17, 2019 2:16 am
by wayne millard
Hi Stefan,
Thanks for the reply how are you going with your project? have you got any examples of what you have done so far?
I have used some of flowcode examples which seem to initalise the ethernet chip ok because all the LEDS are working when connected to computer but i cant ping the chip it will not reply.
Wayne
Re: Ethernet Comms
Posted: Fri May 17, 2019 3:01 pm
by stefan.erni
Hi Wayne
Just a little note. You can not connect the PIC directly to the computer with a network cable. You need a HUB or a cross cable.
I ran the Olimex board and included the demo program FC_ENC28J60_Example.fcfx.
It's not working. I have to look...
regards
Stefan
FC_ENC28J60_Example.c : 1 : error : Too few arguments: TCPIP_ENC28J60::CheckForTCPPort
FC_ENC28J60_Example.c : 1 : error : Too few arguments: TCPIP_ENC28J60::MakeTcpSynackFromSyn
FC_ENC28J60_Example.c : 1 : error : Too few arguments: TCPIP_ENC28J60::MakeTcpAckFromAny
FC_ENC28J60_Example.c : 1 : error : Too few arguments: TCPIP_ENC28J60::MakeTcpAckFromAny
FC_ENC28J60_Example.c : 2035 : error : Too few arguments: TCPIP_ENC28J60::CheckForTCPPort
FC_ENC28J60_Example.c : 2053 : error : Too few arguments: TCPIP_ENC28J60::MakeTcpSynackFromSyn
FC_ENC28J60_Example.c : 2088 : error : Too few arguments: TCPIP_ENC28J60::MakeTcpAckFromAny
FC_ENC28J60_Example.c : 2207 : error : Too few arguments: TCPIP_ENC28J60::MakeTcpAckFromAny
Re: Ethernet Comms
Posted: Fri May 17, 2019 4:02 pm
by stefan.erni
Hi Wayne
I found the problem. Just insert the portnumber (80) to the commands.
ping is working from my computer.
regards
Stefan
Re: Ethernet Comms
Posted: Sun May 19, 2019 8:39 pm
by wayne millard
Hi Stefan,
Thanks for the replys i now have it responding to IP ping the problem was the SPI channel can not get it to work on channel 1 or 2 but will work on software channel. im now trying to workout how to send and receive data and the differant protocals that can be sent and received.
if you get some data sent and received i would love to see a example.
Thanks,
Wayne
Re: Ethernet Comms
Posted: Fri May 24, 2019 10:01 am
by stefan.erni
Hi Wayne
I did a small change in the pointer and now I can acces the Pic with the Internet Explorer under Ip 192.168.1.90
and change to page2 ....
and with the TigerJython (Python) I have acces too.
TigerJython is free and you just copy the text in the program.
Now I found in FC8 the component: NetworkComms1
I think I gon on with this component.
regards
Stefan
https://www.matrixtsl.com/wiki/index.ph ... _component
http://jython.tobiaskohn.ch/download2.html
Code: Select all
import socket
host = "192.168.1.90"
port = 80
# Phase 1
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host , port))
# Phase 2
#request = "GET /py/welcome.html HTTP/1.1\r\nHost: " + host + "\r\n\r\n"
#request = "GET /page1" + host + "\r\n\r\n"
request = "GET /page2"
s.sendall(request)
# Phase 4
reply = s.recv(4096)
print "\nReply:\n"
print reply