Android Question Walkie talkie app...in UDP mode?

iz1kbp

Member
Hi to all, I nedd some information about Erel's app in obj.
I need the system in udp mode : 1 talk to air , more listen...in alf duplex.
I've found some thread about this.
Using single ip it work fine, using broadcast ip it return : error exception libcore.io.errExcemption ... ''' ' ' .
Same problem in UDP....
Some one have some ideas?

tnx in advance

Mario
 

Peter Simpson

Expert
Licensed User
Longtime User
Hi to all, I nedd some information about Erel's app in obj.
ARe you talking about this app???

 
Upvote 0

iz1kbp

Member
Please post the full error message from the logs, right click to copy.
using single IP on 192.168.0.x no problem.
Using broadcast IP x.x.x..255 this is the problem.

Errore: (ErrnoException) libcore.io.ErrnoException: connect failed: ENETUNREACH (Network is unreachable)
 
Upvote 0

iz1kbp

Member
It is the error that I see in LOG windows...no more, no less...
I put a LOG instruction in line before LBLIPSTATUS read out ,to read the error printed in android device label.
This error is print in label the same label where I can see "Connecting" or "Connected" to wifi
The classic RED ERROR is not present in log windows....all seem to be regular but wit Broadcast addres The app not connect via wifi....

Mario ;)
 
Last edited:
Upvote 0

OliverA

Expert
Licensed User
Longtime User
using single IP on 192.168.0.x no problem.
Using broadcast IP x.x.x..255 this is the problem.

Errore: (ErrnoException) libcore.io.ErrnoException: connect failed: ENETUNREACH (Network is unreachable)

What are you doing here? Are you trying to connect a regular socket to x.x.x.255? That's not going to work. See: https://stackoverflow.com/a/21267149
 
Upvote 0

iz1kbp

Member
I rewrote the application taking example from the forums on the udp protocol ...
I probably made some mistakes but honestly, I don't know where


B4X:
If sendingAudio Then ' se sono in trasmissione
        astream.Write(data)
        Packet.Initialize(data, "192.168.0.255", 8000) ' assegno un ip broadcast alla macchina che trasmette sulla posta 8000
        UDPSocket1.Send(Packet)
    End If
First: is a correct IP (x.x.x.255 for bradcast) or I must assign a static IP (192.168.0.199 for example) ?
B4X:
If sendingAudio = False Then ' se non è in trasmissione
        audioStream.Write(Buffer)
    End If

With these routines, theoretically, I do the half duplex but.....I still have a larsen effect, but above all, after a while, I hear the audio that I had sent several seconds before, as if the data buffer was sent and sent from one device to another

Could this problem be due to the fact that the UDP protocol sends the data to everyone and somehow the buffer is sent back reflexively? Anyone have any ideas, can you tell me where I'm wrong?

Ps..

I don't know about AUDIO libraries ... I tried to interpret the guides

Thank's to all in advance

Mario
 

Attachments

  • rtx_udp.zip
    8.3 KB · Views: 368
Last edited:
Upvote 0

iz1kbp

Member
Start with the direct ip address.

I tried with 192.168.0.199 (Ip in my local lan) but nothing.I read UDP packet Using Wireshark , the final destination is My local PC (Ip to IP) , not bradcast address.
I've also tried with an UDP sniffer...same result : IP destination is my local pc , not bradcast address.
Mario
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Upvote 0

iz1kbp

Member
How are you determining what your broadcast address is? Are you using the method supplied by @Erel in this thread: https://www.b4x.com/android/forum/threads/udp-broadcast-address.75694/ ? Also, are you sure your router is not blocking broadcasting (for example if client isolation is turned on, broadcasting is blocked)?
Hi Oliver...i'tried with 192.168.0.255. My lan have 255.255.255.0 subnet mask. I have used the subnet calculation ( Many sample on the net). My lan ,for testing devices, is only my pc for develop,router,android devices. NO INTERNET,no firewall, port forwarding not used because I'm on local lan. On the same lan I test art-net dmx node (works with udp too) with out problem.Have you any suggest? Mario
 
Upvote 0

iz1kbp

Member
Don't do anything with the broadcast address. Start with the direct ip.
Hi Erel...
Using broadcast address, in wire shark I read message form my cell ( copy from Wireshark : Internet Protocol Version 4, Src: 192.168.0.154, Dst: 192.168.0.255) in UDP mode
Using direct IP I read only TCP traffic (with many error) from pc to android and android to pc, no UDP traffic
You need to configure Windows firewall to allow incoming communication on the relevant port.
I try the program between two android devices ... I don't pass through windows
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top