Ethernet Comms

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
wayne millard
Posts: 234
Joined: Thu May 31, 2007 2:18 pm
Has thanked: 7 times
Been thanked: 12 times
Contact:

Ethernet Comms

Post 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

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: Ethernet Comms

Post 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
olimex_all.jpg (273.7 KiB) Viewed 3891 times

wayne millard
Posts: 234
Joined: Thu May 31, 2007 2:18 pm
Has thanked: 7 times
Been thanked: 12 times
Contact:

Re: Ethernet Comms

Post 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

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: Ethernet Comms

Post 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
Attachments
Fc8_Leddriver_EFG144_1.fcfx
(26.14 KiB) Downloaded 201 times

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: Ethernet Comms

Post 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

Ping_ok.PNG
(10.18 KiB) Downloaded 1265 times
Attachments
Fc8_Leddriver_EFG144_1.fcfx
(26.67 KiB) Downloaded 192 times

wayne millard
Posts: 234
Joined: Thu May 31, 2007 2:18 pm
Has thanked: 7 times
Been thanked: 12 times
Contact:

Re: Ethernet Comms

Post 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

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: Ethernet Comms

Post 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

Tiger_demo.PNG
(110.21 KiB) Downloaded 1195 times
Fc8_Leddriver_EFG144_1.fcfx
(28.36 KiB) Downloaded 189 times

Post Reply