F fransvlaarhoven Active Member Licensed User Longtime User Oct 7, 2020 #1 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???
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???
Erel B4X founder Staff member Licensed User Longtime User Oct 7, 2020 #2 Please use [code]code here...[/code] tags when posting code. You can get the arduino ip address with Ethernet.LocalIP. Upvote 0
Please use [code]code here...[/code] tags when posting code. You can get the arduino ip address with Ethernet.LocalIP.
F fransvlaarhoven Active Member Licensed User Longtime User Oct 7, 2020 #3 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
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
Erel B4X founder Staff member Licensed User Longtime User Oct 7, 2020 #4 Are you able to ping the Arduino address? Make a test and disconnect Wifi. Upvote 0
F fransvlaarhoven Active Member Licensed User Longtime User Oct 7, 2020 #5 Yes and no: when i use this code in Arduino: Code: Copy 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: Code: Copy 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
Yes and no: when i use this code in Arduino: Code: Copy 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: Code: Copy 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!!!