bridgefy / sdk-android-beta

Other
5 stars 1 forks source link

Use production sdk - the device connect not stable #22

Open BartCheng opened 1 year ago

BartCheng commented 1 year ago

Describe the bug i have 3 device

  1. pixel 4a connected v11
  2. pixel send message to v11, v11 can received
  3. but v11 send message to pixel 4a, 4a can not received message
  4. use m11 connected 4a same issue

Steps to reproduce the behavior:

  1. no error message, always response onSend: {UUID}
BartCheng commented 1 year ago

@julian-bridgefy

I using TransmissionMode.Mesh send message, but received message TransmissionMode is p2p.

BartCheng commented 1 year ago

@julian-bridgefy How can I simulate mesh messaging at close range?

julian-bridgefy commented 1 year ago

In a mesh network, messages are often relayed through other devices to reach their destination. If a device within the mesh network determines that a point-to-point transmission is more efficient for a specific recipient, it may switch the transmission mode to p2p for that particular message. This decision is typically made by the SDK based on network conditions and optimization strategies.

Bridgefy SDK is designed to handle the complexities of mesh networking, including the automatic selection of the most appropriate transmission mode for a given message to ensure reliable delivery, the SDK manages this internally to provide the best possible communication experience.

julian-bridgefy commented 1 year ago

Simulating mesh messaging at close range with the Bridgefy SDK can be done by configuring your test environment to mimic a mesh network and by using multiple devices for testing. Here are the steps to simulate mesh messaging at close range:

  1. Prepare Multiple Devices: You will need at least two devices (e.g., smartphones or tablets) for testing. Ideally, you should have more devices to simulate a true mesh network.

  2. Install the Bridgefy SDK: Ensure that you have integrated the Bridgefy SDK into your test applications on each device.

  3. Configure Device Placement: Place the devices close to each other. The closer they are, the more likely they are to communicate directly (p2p).

  4. Run the Test Application: Launch the test application on each device.

  5. Send Messages: On one device, send a message to another device. The Bridgefy SDK should automatically route the message through the mesh network if the recipient is not within direct p2p range.

  6. Observe Message Routing: As you send messages, observe how the Bridgefy SDK routes them through the mesh network, especially when devices are not within close range.

  7. Test Mesh Reliability: You can test the reliability of the mesh network by moving some devices farther apart. If the devices are out of p2p range, you should see the Bridgefy SDK routing messages through intermediate devices in the mesh.

The Bridgefy SDK provides three propagation types:

Point-to-Point (P2P):

Description: P2P propagation is the most straightforward mode. It enables direct communication between two nearby devices. How It Works: When you send a message in P2P mode, it's transmitted directly to the intended recipient if they are within range. This is ideal for one-on-one or private communication. Use Cases: P2P is suitable for secure, private conversations between two individuals or devices within close proximity.

Mesh:

Description: Mesh propagation extends the communication range by allowing messages to hop through intermediate devices, creating a network of interconnected devices. How It Works: When you send a message in Mesh mode, the Bridgefy SDK routes it through multiple devices, effectively creating a mesh network. The message hops from device to device until it reaches the intended recipient. Use Cases: Mesh is beneficial for scenarios where you want to extend the communication range or ensure message delivery even when devices are not in direct proximity. It's useful in large crowds, outdoor events, and emergency communication.

Broadcast:

Description: Broadcast propagation sends a message to all nearby devices. How It Works: When you send a message in Broadcast mode, it's transmitted to all devices within range. Any device listening will receive the message. Use Cases: Broadcast is suitable for scenarios where you want to send a message to all nearby devices without specifying individual recipients. This can be used in public announcements, event notifications, or location-based services.

BartCheng commented 1 year ago

@julian-bridgefy can i use android studio logcat observe message routing?