The HomeBrew WiFi+BT+GPS project here features bluetooth (BT) connectivity to the AUX bus of the mount, as does the HomeBrew All-In-One project. This is potentially a great way to connect to and control the mount -- no software timeouts or power-saving nastiness to result in dropped connections. I have long since sought such a connection method!
Unfortunately, this is of limited use at present, because CPWI is the only Celestron app that will use such a connection. SkyPortal only knows about TCP network connections, which it inaccurately calls "WiFi". SkySafari will do bluetooth, but ONLY with reduced functionality from a hand-controller connection, not from a full featured AUX port.
The solution, is to have the receiving device, a smartphone or tablet, convert that bluetooth connection into a fake TCP connection, which is something that CPWI, SkyPortal, and SkySafari all understand ("WiFi").
At first, this is pretty simple:
1. Connect the HomeBrew accessory and power on the mount.
2. Pair the Android device with the HomeBrew-xxxxxx bluetooth.
3. Purchase (cheap) and install the Android BT/USB/TCP Bridge Pro app, and configure it to connect to the HomeBrew SPP/Bluetooth as "Device A". Then configure "Device B" as a TCP Server on port 2000. Done.
At this point, everything needed for an ongoing connection is there. Except the Celestron apps still need to be told to connect to that TCP Server on the Android device. The way this normally happens, is they listen for a UDP protocol "broadcast" message, which identifies the network address (MAC) of the device running the TCP Server. Without that message, they don't know what device on the LAN to connect to.
So the remaining 10%, requiring 90% of the effort here, is to generate and send that broadcast message. And this must be done from the same Android device that is running the Celestron and bridge apps.
The message itself is an ASCII string, sent as the payload of a UDP broadcast addressed to 255.255.255.255 port 55555. The contents should be exactly this:
{"mac":"xx:xx:xx:xx:xx:xx","version":"HomeBrew-AMW007-9.0.0.0, 2021-05-13T12:00:00Z, ESP32-0.1"}
Except replace the xx:xx:xx:xx:xx:xx part with the MAC address of the Android device. This can be manually obtained by going into Android Settings-->System-->Status and looking for the "Wi-Fi MAC address" within that maze of menus. Carefully hand copy it for future reference.
It can also be obtained more automatically by a script (read on..), but doing so requires superuser ("root") access, which most people have not set up on their device. So the manual method is probably the only show in town.
Once you have the MAC, it's a matter of getting a simple shell script running on the Android device to do the broadcasts every couple of seconds. Eg, something like this:
#!/bin/sh
MAC='xx:xx:xx:xx:xx:xx'
advert="{\"mac\":\"$MAC\",\"version\":\"HomeBrew-AMW007-9.0.0.0, 2021-05-13T12:00:00Z, ESP32-0.1\"}"
while sleep 2 ; do
echo -n "$advert" | socat -u - UDP4-DATAGRAM:255.255.255.255:55555,reuseport,broadcast
done
This script uses the socat ("socket cat") command to send the broadcast messages. It does NOT require "root" to run and work. But the tricky bit is figuring out (1) where to get a socat command binary from, and (2) how to get the script to run.
I did manage it on my own set-up (https://www.cloudyni...5#entry11101542), and now am working on something simpler for others to try.
More later..
Edited by mlord, 15 May 2021 - 01:16 PM.