C cloner7801 Active Member Licensed User Longtime User Jul 3, 2016 #1 Hi, How can I get Default Gateway ip ?
Erel B4X founder Staff member Licensed User Longtime User Jul 4, 2016 #2 There is no API for that. You can however find the UDP broadcast address with UDPSocket.GetBroadcastAddress and then send a message to all other devices in the network. Upvote 0
There is no API for that. You can however find the UDP broadcast address with UDPSocket.GetBroadcastAddress and then send a message to all other devices in the network.
C cloner7801 Active Member Licensed User Longtime User Jul 4, 2016 #3 Erel said: There is no API for that. You can however find the UDP broadcast address with UDPSocket.GetBroadcastAddress and then send a message to all other devices in the network. Click to expand... I don't see GetBroadcastAddress in UDPSocket method Upvote 0
Erel said: There is no API for that. You can however find the UDP broadcast address with UDPSocket.GetBroadcastAddress and then send a message to all other devices in the network. Click to expand... I don't see GetBroadcastAddress in UDPSocket method
C cloner7801 Active Member Licensed User Longtime User Jul 4, 2016 #4 Dear Erel, I use this to send file to another device. But I want to send file to all devices are opened the application What is your idea? How can I do this? Upvote 0
Dear Erel, I use this to send file to another device. But I want to send file to all devices are opened the application What is your idea? How can I do this?
Erel B4X founder Staff member Licensed User Longtime User Jul 4, 2016 #5 TCP doesn't support broadcasting. MQTT can be a good solution however you will need to run a MQTT broker. Upvote 0
TCP doesn't support broadcasting. MQTT can be a good solution however you will need to run a MQTT broker.
C cloner7801 Active Member Licensed User Longtime User Jul 4, 2016 #6 Erel said: TCP doesn't support broadcasting. MQTT can be a good solution however you will need to run a MQTT broker. Click to expand... But I want to use it in local network and CloudMQTT is internet base Upvote 0
Erel said: TCP doesn't support broadcasting. MQTT can be a good solution however you will need to run a MQTT broker. Click to expand... But I want to use it in local network and CloudMQTT is internet base
Erel B4X founder Staff member Licensed User Longtime User Jul 4, 2016 #7 You don't need to use CloudMQTT. Start with this tutorial: https://www.b4x.com/android/forum/threads/iot-mqtt-protocol.59471/#content Upvote 0
You don't need to use CloudMQTT. Start with this tutorial: https://www.b4x.com/android/forum/threads/iot-mqtt-protocol.59471/#content
C cloner7801 Active Member Licensed User Longtime User Jul 4, 2016 #8 Erel said: You don't need to use CloudMQTT. Start with this tutorial: https://www.b4x.com/android/forum/threads/iot-mqtt-protocol.59471/#content Click to expand... But I want create connection between (2-3 device) Can I use this ? Can you send me a source code for my problem? Upvote 0
Erel said: You don't need to use CloudMQTT. Start with this tutorial: https://www.b4x.com/android/forum/threads/iot-mqtt-protocol.59471/#content Click to expand... But I want create connection between (2-3 device) Can I use this ? Can you send me a source code for my problem?
Erel B4X founder Staff member Licensed User Longtime User Jul 5, 2016 #9 cloner7801 said: Can you send me a source code for my problem? Click to expand... No. cloner7801 said: But I want create connection between (2-3 device) Can I use this ? Click to expand... Go over the tutorial. It explains how MQTT works. Upvote 0
cloner7801 said: Can you send me a source code for my problem? Click to expand... No. cloner7801 said: But I want create connection between (2-3 device) Can I use this ? Click to expand... Go over the tutorial. It explains how MQTT works.
C cloner7801 Active Member Licensed User Longtime User Jul 13, 2016 #10 I can't worked with MQTT , because we don't have any MQTT broker in b4i , and I want to send a file in connected devices. If I want to send file to one device , How can I do ? I am using this code for find ip range : Code: Copy ip = server.GetMyWifiIp Dim m As Matcher = Regex.Matcher2("\.[^.]*$", 0, ip) Do While m.Find current = m.Match.Replace(".","") range = ip.Replace(m.Match,".") Loop and with this code I connect to about 130 ip Code: Copy Sub connect For i=0 To 130 If i <> current And i <> 1 And i <> 0 Then ip = range&i ip = ip.Trim client.Connect(ip,port, 30000) End If Next End Sub But this don't work ! I see newConnection in my log after that I see astream_Terminated why this happend ? what is best way to connect to other device , I dont know other device or devices ip and want to connect automatically. Thanks. Upvote 0
I can't worked with MQTT , because we don't have any MQTT broker in b4i , and I want to send a file in connected devices. If I want to send file to one device , How can I do ? I am using this code for find ip range : Code: Copy ip = server.GetMyWifiIp Dim m As Matcher = Regex.Matcher2("\.[^.]*$", 0, ip) Do While m.Find current = m.Match.Replace(".","") range = ip.Replace(m.Match,".") Loop and with this code I connect to about 130 ip Code: Copy Sub connect For i=0 To 130 If i <> current And i <> 1 And i <> 0 Then ip = range&i ip = ip.Trim client.Connect(ip,port, 30000) End If Next End Sub But this don't work ! I see newConnection in my log after that I see astream_Terminated why this happend ? what is best way to connect to other device , I dont know other device or devices ip and want to connect automatically. Thanks.
Erel B4X founder Staff member Licensed User Longtime User Jul 13, 2016 #11 You cannot guess the ip address. The simple solution is to show the ip address and then let the user enter it on the other device. You can also send a UDP packet to the broadcast address with the ip address of each device. Upvote 0
You cannot guess the ip address. The simple solution is to show the ip address and then let the user enter it on the other device. You can also send a UDP packet to the broadcast address with the ip address of each device.
C cloner7801 Active Member Licensed User Longtime User Jul 13, 2016 #12 Erel said: You can also send a UDP packet to the broadcast address with the ip address of each device. Click to expand... Thanks Erel, Can you explain this? Upvote 0
Erel said: You can also send a UDP packet to the broadcast address with the ip address of each device. Click to expand... Thanks Erel, Can you explain this?
Erel B4X founder Staff member Licensed User Longtime User Jul 14, 2016 #13 Start with sending a UDP packet between two devices by explicitly setting the ip address of the other device. Once it works you can change the ip address to the broadcast address (UDPSocket.GetBroadcastAddress). Upvote 0
Start with sending a UDP packet between two devices by explicitly setting the ip address of the other device. Once it works you can change the ip address to the broadcast address (UDPSocket.GetBroadcastAddress).