Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How hard would it be to add targeted transmission? #29

Open
AussieMakerGeek opened this issue Mar 6, 2023 · 3 comments
Open

How hard would it be to add targeted transmission? #29

AussieMakerGeek opened this issue Mar 6, 2023 · 3 comments

Comments

@AussieMakerGeek
Copy link

Hi, I'm wanting to build a multi-room Intercom and this project is perfect but would broadcast to all units. I want to be able to target specific room-to-room intercom but also still have a broadcast mode.

I was thinking that perhaps there could be a UDP packet header to target a specific 'ID' based on which transmit button was pushed. Then certain receivers would only play back sound targeted with their ID, but still have a '00' ID for a broadcast? Could this work?

I am willing to put the time into the code, but just not sure where to start, so if you could point me in the direction i'll give it a crack - I'm usually coding in Arduino so platformIO is not native to me and a tad daunting but willing to learn it for this project.

@AussieMakerGeek
Copy link
Author

AussieMakerGeek commented Mar 7, 2023

So, to partially answer my own question now that I have gone over the code better, I can see that I can use the set_header function in the code, based on whatever button I push (TBD) to set the header on the outbound broadcast but where in the receive side does it verify the header?

Looking at line 23 of UDPTransport.cpp - I would have thought it would be in this line:
if ((packet.length() > this->m_header_size) && (packet.length() <= MAX_UDP_SIZE) && (memcmp(packet.data(), this->m_buffer, this->m_header_size) == 0))

So changing it to something like:
if ((packet.length() > this->m_header_size) && (packet.length() <= MAX_UDP_SIZE) && ((memcmp(packet.data(), this->m_buffer, this->m_header_size) == 0)) || (memcmp(packet.data(), 0x00, this->m_header_size) == 0))

Should allow it to receive/play all messages wit header 0x00 (Assuming header is only one byte, should be defined as it's own variable), or it's own configured header.

I am intending on using UDP only, not ESP_NOW as the devices will be too far away to support peer-to-peer networking.

@rhambus
Copy link

rhambus commented Nov 10, 2024

@AussieMakerGeek Did you ever get this working? I would really like to set up a multi room intercom system as well.

@AussieMakerGeek
Copy link
Author

In short I did, however, I could not achieve the desired voice quality so I sort of abandoned the project. That's not to say the code was no good, it was probably my hardware implementation during testing (breadboard and jumpers) that was the limiting factor. But it was legible, and I was able to direct voice to specific endpoints.

I'm pretty sure my fork of this repo has the updated code where I got it to work, but it was some time ago and I don't recall if I updated the final code here. If not, I'm sure I have it locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants