B4R Question direct connection between arduino and computer using ethernet cross-over cable

fransvlaarhoven

Active Member
Licensed User
Longtime User
Hello,

i'm trying to make a direct connection between a computer and Arduino using a ethernet cross-over cable where Arduino is supposed to be the master and the computer is supposed to be the client


on the arduino-side of the connection:

Dim Server As EthernetServerSocket
Server.Initialize(ServerPort, "NewConnection")
Server.Listen

My problem is the computer side of the connection: (B4J)

Socket1.Connect(IPaddress,TCPport,Timeout)

What should i use as IPaddress???
 

fransvlaarhoven

Active Member
Licensed User
Longtime User
I already found that out.

It seems as the problem is with B4J: i have two ethernet connections: one connection is the WiFi-connection and the other connection is the ethernet adapter.
When i try to connect the socket in B4J, nothing happens in B4R.
Maybe B4J is trying to connect the socket using WiFi?
Is there a way to make sure that B4J uses the ethernet adapter?

Many thanks
 
Upvote 0

fransvlaarhoven

Active Member
Licensed User
Longtime User
Yes and no:

when i use this code in Arduino:

B4X:
    Serial1.Initialize(115200)
    Log("AppStart")
    EthernetConnection.Initialize(Array As Byte(0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED), Array As Byte(192, 168, 178, 205))
    Log("IP-address set to ", EthernetConnection.LocalIp)

Ping is not working

when i use this code in Arduino:

B4X:
    Serial1.Initialize(115200)
    Log("AppStart")
    EthernetConnection.Initialize(Array As Byte(0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED), Array As Byte(169, 254, 138, 205))
    Log("IP-address set to ", EthernetConnection.LocalIp)

Ping is working!!!
 
Upvote 0
Top