Broadlink RM Pro – Setup

Bought a Broadlink RM Pro (with Wifi, IR and RF)

To setup without an app:
– Press reset (until it quick-blinks)
– Press reset (until it slow-blinks)
– Now it is in AP mode – showing an SSID called BroadlinkProv (or, on some devices, it is called BroadLink_WiFi_Device)
– Connect to this SSID (no encryption)
– No TCP ports are being listened on
– Broadlink devices uses QUIC protocol over UDP port 80
– It has been reverse engineered here: ipsumdomus.com
– in an test with nmap (sudo nmap -sU -p80-85 –system-dns) ports 82-85 (but NOT 81) also seemed open
– if I scanned more UDP ports, the AP would disappear (probably because it reboots because of no connectivity to cloud)
– python library can can setup (I have not made it work yet, though) and control Broadlink devices: github

Parsing a Database connectionstring to individual values

From time to time, you may have to access (in some code) the individual values of a database connectionstring – and what to do if you only have the connectionstring available?

In my case, it happened in Azure, where we normally use the connectionstring for Function Apps, but when I needed to deploy a Logic App, I suddenly needed the individual values (for the Logic App’s associated ‘API Connection’)

Here it tells us that this C# class can do the parsing, but it only mentions “Initial Catalog” and “Data Source” – and what do we do, if our connectionstring uses “Server” and “Database”

It turns out (also in above description) that the class can also handle the synonyms – so if your connectionstring uses “Database”, you can get that value via “InitialCatalog”.

Short example code showing the synonyms – it can be tested here

public static void Main()
{
var cs = “Server=tcp:yada1.database.windows.net,1433;Database=yada2-dev;Persist Security Info=False;User ID=yada3-dev;Password=yada4;...................”;

System.Data.SqlClient.SqlConnectionStringBuilder sb = new System.Data.SqlClient.SqlConnectionStringBuilder(cs);
Console.WriteLine($”Server: {sb[“Server”]}”);
Console.WriteLine($”DataSource: {sb.DataSource}”);
Console.WriteLine($”Database: {sb[“Database”]}”);
Console.WriteLine($”Database: {sb.InitialCatalog}”);
Console.WriteLine($”User: {sb.UserID}”);
Console.WriteLine($”Password: {sb.Password}”);
}