Broadcast not sending broadcast for all servers (Bedrock broadcast)

Fairly new to this, and just configured several servers with bedrock and moved worlds from tablets to the different servers. All that working fine with several servers on different ports. And all accessible from tablets/iPads via Server connections. However to reach them from PS5/PS4 I need them to be discoverable on local LAN through broadcast (And partly why I chose MineOS to begin with).
For MineOS it looks like it only broadcast the server connected to port 25565, and ignore the other. Even though if server at port 25565 is set to not broadcast, and 25566 is set to broadcast, all pads discovers the server on 25565.

The broadcast script that is credited in the server.js code do have reference to the server ports, but I can’t see the same in the server.js code.
Can someone have a look at this, or tell me what I’m doing wrong?

The function you want is broadcast_to_lan.
You need to ensure the server port is set in server properties and that broadcast is enabled. Maybe try and reset the setting or restart mineos service.

It’s also not tested for bedrock servers hosted on mineos, only for java.

As stated I have the broadcast to lan running. And it’s working on bedrock as well. It’s just not broadcasting for all the servers, and only for the server at port 25565.

The cross play functionality of bedrock servers have always been complicated affairs ridden with bugs. The mojang bug-trackers have several active (and even more closed as duplicate) reports of PS4 / XBOX problems. Their main tracker is here:
A newer bugrepport describing an xbox-connection problem that mirrors your experience is

One common problem is that Sony and playstation considers minecraft servers cross play, and set limitations accordingly, as for example the need for a PS+ subscription.

It is also worth noting that the defualt port of bedrock servers is 19132. It may be that your bedrock clients expects a port in that area.

port 25565 is the default port of minecraft java servers.

I am in no way expluding that there also may be a bug in the mineos .js scripts, but that may only be a part of a complicated set of problems that is the card house of bedrock servers, clients and cross play.

1 Like

Can you provide pictures of your config and what you’re seeing

As for the broadcast functionality:
Took a look, and it is based on a thread of creditet work that starts here: Advertising Linux Minecraft Servers to the LAN - void7

The broadcast functionality in MineOS has two main parts, one that creates the broadcast message, and one that creates the broadcast. In line 915 in server.js the message that bradcasts your sever info is created and it is this:
var msg = Buffer.from("[MOTD]" + sp_data.motd + "[/MOTD][AD]" + sp_data['server-port'] + "[/AD]");

So we can see that it takes the servers IP and port and wraps it in a message that is passed to the broadcast function.

Be aware that broadcasts are sent over UDP port 4445.

1 Like

Thanks both… Looks like I need to dig a bit deeper into this.
Added some logging to the “broadcast_to_lan” function, and it looks like it’s actually broadcasting both.
Though I don’t have knowledge to understand the actual broadcast buffer string, it’s different for both

{“level”:“info”,“message”:"<Buffer 5b 4d 4f 54 44 5d 75 6e 64 65 66 69 6e 65 64 5b 2f 4d 4f 54 44 5d 5b 41 44 5d 32 35 35 36 35 5b 2f 41 44 5d> 25565 Broadcast msg: “,“timestamp”:“2022-02-18T11:03:35.607Z”}
{“level”:“info”,“message”:”<Buffer 5b 4d 4f 54 44 5d 75 6e 64 65 66 69 6e 65 64 5b 2f 4d 4f 54 44 5d 5b 41 44 5d 32 35 35 36 36 5b 2f 41 44 5d> 25566 Broadcast msg: ",“timestamp”:“2022-02-18T11:03:35.608Z”}

So lookes like I need to do some packet captures from the bedrock client to figure out how it’s using the information it receives.
My actual problem is that the bedrock clients only sees the server at port 25565, no matter what port I transmit as the broadcast message.
None of the Bedrock clients (PS5, android Tab or iPad) have issues connecting to the server they see.

Hex-translation of buffer string:

→ [MOTD]undefined[/MOTD][AD]25565[/AD]

→ [MOTD]undefined[/MOTD][AD]25566[/AD]

So the buffer sends the right strings at least.
This means that the bug is likely at Mojangs side, either at clientisde, or minecraft-server side, wich correlates well with the amount of bug reports at mojang (as linked above).

1 Like

And now I found the actual bug repport for the culprit of your problems:

It seems the bedrock servers FIRST bind to the port you spesify, THEN to the default as well. This means that of your two servers on the same machine, only the first one will be able to broadcast correctly, the second will try to broadcast on the same port (since both is bound to the default port due to the bug), witch matches what you repport, that the client only sees the first server on the default port.

So standard HEX to ASCII :slight_smile: :see_no_evil:
Couldn’t see much relevance in those bug reports, as my PS5 and other bedrock clients are able to connect to the one server they see on the LAN. The Android Tab and iPads are also able to connect to the other servers using the manual server entry, but PS5 doesn’t have that option.
I’ll try and do some packet captures from one of the clients, to see how they respond to the broadcasts.

Your previous message came in while I wrote this… so excuse the relevance parts :wink:

Yes, they can, since you specify that shey should connect to the other port your servers bind, but the broadcasted port that your consoles find, are the secondary default ports from the bug.

We have allready shown both by analysing the script, and by decoding the hex-string, that MineOS sets up the broadcast correctly, so the error is not there.

The bedrock server ignores that configuration, and uses its own secondary default port binding, that only point to the server that actually USES the default port.

I agree. It looks like a bedrock issue. and using the bedrock ports.
I’ll still do a bit more digging around who does what in regards to the broadcasts. I suspect the client is assuming the 19132 port nomatter what the broadcast states, but I’ll see what I find.

Initial findings:
It looks like they have changed this a bit in Bedrock. My clients are actually sending out a broadcast on UDP port 19132, looking for the servers. Hens only one server responds (as the other have a different port). Basically the broadcast to lan from MinOS have no function in my scenario.
For fun I spinned up a second bedrock server on another IP with same port, and that was immediately seen by the client, that listed both IP servers.
Now I just need to find out if the servers are actually replying with specific connection info IP/ports…or if 19132 also is the default connection as well.

Have done some packet capturing and the communication is done using RakNet protocol. test server setup with IPv4 port 25565. When startet it also opened port 19132, to listen for clients.

  • Bedrock client sends out a broadcast to look for servers.
  • Server responds to broadcast with the server info for connection including port (25565)

Server response string:

25565 is the IPv4 port I set for server, while 19133 is the IPv6 port set for server.
When client connects to server it connects using RakNet protocol on port 25565.

So basically it should be possible to have a script running on server listening to port 19132, and simulating the server response with all the different bedrock servers on it.
When bedrock server starts and port 19132 is occupied by others (the script) it will set a random port number.

And here is a solution that looks to be working for docker containers… Just need to be adopted in a way…

It basically takes several servers and generates the response to clients for all of them.
Looks like it’s Javascript files, one for collecting the servers, and one for handling communication with the clients.
So if anyone feels the they have the knowledge…

Cool find. This should surely help.
I’m wondering if we need to have docker images or if we can somehow send our own message by binding to the port first or something.
As bedrock is very new to MineOS expect some delay in progress and bugs.

It’s JS code so should be able to run in MineOS as well. It just needs to be adjusted to find the servers via MineOS information and adapt the Pong response to the clients.
Sounds simple, but might be harder in real world :slight_smile: