If you decide to go down the SSDP avenue, here's some BrightScript code you may be able to adapt to discover your Pi on the network. The code scans for all Rokus on the network so it can send them a wake-up request every hour. I left it running on my previously-unused Roku HD to prevent other Rokus on the network returning to the Home Screen after Roku implemented that "feature".
You'll need to change the search target,
ST: roku:ecp, to correspond to what your Pi server uses.
You'll need code on your Pi that listens to port 1900 for the M-SEARCH request and responds appropriately. The code doesn't have to run in your Pi server; it can be running as a separate service in the Pi.
Sub Main ()
SLEEP_TIME_MINS = 60
Q = Chr (34)
CR = Chr (13)
LF = Chr (10)
port = CreateObject ("roMessagePort")
uiMsg = ""
uiMsg = uiMsg + "Keep this channel running to prevent" + LF
uiMsg = uiMsg + "all Rokus on this network" + LF
uiMsg = uiMsg + "returning to the Home Screen" + LF
uiMsg = uiMsg + LF + LF + "Press any key to exit"
ui = CreateObject ("roImageCanvas")
ui.SetMessagePort (port)
ui.SetLayer (0, {Color: "#303030"})
ui.SetLayer (1, {Text: uiMsg, TextAttrs: {Color: "#EBEBEB", Font: "Large", HAlign: "HCenter", VAlign: "VCenter"}})
ui.Show ()
ssdpStr = ""
ssdpStr = ssdpStr + "M-SEARCH * HTTP/1.1" + CR + LF
ssdpStr = ssdpStr + "HOST: 239.255.255.250:1900" + CR + LF
ssdpStr = ssdpStr + "MAN: " + Q + "ssdp:discover" + Q + CR + LF
ssdpStr = ssdpStr + "ST: roku:ecp" + CR + LF
ssdpStr = ssdpStr + "MX: 2" + CR + LF
ssdpStr = ssdpStr + CR + LF
ssdpAddr = CreateObject ("roSocketAddress")
ssdpAddr.SetAddress ("239.255.255.250:1900")
ssdp = CreateObject ("roDatagramSocket")
ssdp.SetMessagePort (port)
ssdp.SetSendToAddress (ssdpAddr)
ssdp.NotifyReadable (True)
ssdp.SendStr (ssdpStr)
ecpAddrList = {}
ut = CreateObject ("roUrlTransfer")
ut.SetPort (port)
ts = CreateObject ("roTimespan")
sleepTimeMs = SLEEP_TIME_MINS * 60 * 1000
While True
elapsed = ts.TotalMilliseconds ()
If elapsed >= sleepTimeMs
ts.Mark ()
elapsed = 0
For Each ecpAddr In ecpAddrList
ping (ut, ecpAddr)
End For
ssdp.SendStr (ssdpStr)
End If
msg = Wait (sleepTimeMs - elapsed, port)
If Type (msg) = "roSocketEvent"
If msg.GetSocketId () = ssdp.GetId ()
If ssdp.IsReadable ()
recvStr = ssdp.ReceiveStr (4096)
ma = CreateObject ("roRegex", "\r\nLocation:\s*(.*?)\s*\r\n", "i").Match (recvStr)
If ma.Count () = 2
ecpAddr = ma [1]
If Not ecpAddrList.DoesExist (ecpAddr)
ecpAddrList.AddReplace (ecpAddr, 0)
ping (ut, ecpAddr)
End If
End If
End If
End If
Else If Type (msg) = "roImageCanvasEvent"
If msg.IsRemoteKeyPressed ()
key = msg.GetIndex ()
If key <> 9200 And key <> 9300 ' Alarm Clock Key Press/Release '
Exit While
End If
End If
End If
End While
End Sub
Sub ping (ut As Object, ecpAddr As String)
ecpReq = ecpAddr + "keypress/Lit_%E2%8F%B0" ' Alarm Clock (U+23F0) '
ut.SetUrl (ecpReq)
ut.PostFromString("")
End Sub