I assume that you have not created an isolated VLAN for your wifi network. Also check that you are connected to your wifi network that is on your home network. I Have had some nightmares where my iPhone has connected to my service providers wifi hotspot in the neighborhood rather than my home network.
I see that your roon core is connected to an ethernet port rather than wifi. May want to check that you can see your unix box from your (I assume Android) device using a tool that can ping or ssh the roon core on 192.168.1.40
Check the ports that are being listened to on your unix box by typing:
$ sudo netstat -tulpn | grep LISTEN
You should see a list of ports that your roon server is listening on.
I also noticed that refused connection with CORE and that reminds me that ssh or any other connection protocols were unauthorized because of closed ports.
The firewall is the origin of the problem and the defaut ubuntu installation seems to be compliant with the Roon Core but not the others security updates.
I decided to turn off the firewall and everythings works fine now !
Thanks to you, I had the clues to investigate better.
Havea nice end year (under the snow in Vancouvert)