Starlink RV Mount and Auto-alignment Using Old Satellite DISH TV Housing
by scottbarton in Circuits > Raspberry Pi
142 Views, 0 Favorites, 0 Comments
Starlink RV Mount and Auto-alignment Using Old Satellite DISH TV Housing


Mount your Starlink dishy inside your old RV DISH satellite TV housing and re-use the old mechanism to automatically keep it aligned while driving, using a Raspberry Pi and Stepper Motor HAT.
Video of it how it works here:
https://www.youtube.com/watch?v=9i6yetmLMGY
NOTE: This Instructables is currently a Work In Progress. A LOT more detail will be added over next few days. This is just the bare info for you to get started right now.
Supplies
Required:
2.1mm x 5.5mm 12v power plug (used to power Stepper HAT and rPi)
Mini 2.4Ghz Wireless Keyboard (technically not needed but really nice to have)
12x24" Aluminum Plate (for mounting Dish inside old housing)
Optional:
JST XH 2.54 4 pin plug (to plug Stepper Motor into HAT, can also be used for BerryIMU wires)
BerryIMU Compass (used when there are issues with Starlink Dish API, ie first 20min after booting up, etc)
Breadboard connectors (to plug compass ground wire into GPIO)
Self Soldering Heatshrink Connectors
Starlink Gen 3 12v DC Power Supply (more efficient and cleaner install than stock AC-DC power supply)
14awg (or 12awg) fuse holder (for DC power supply)
30A 12v On/Off Switch (for DC power supply)
Flat cable for Starlink (to go from inside to outside RV without compromising window/slide seals or damaging cable)
3D Printed Objects to Mount Starlink in/on RV:
RV Satellite adapter plate (used to mount Starlink Dish to old RV Satellite housing with Stepper Motor)
Starlink Extended Mount (allows Starlink Dish to be mounted over Stepper Motor)
Starlink Dish Riser (optional, used to raise bottom of Starlink up if needed)
Starlink Router Vertical Mount (optional)
Remove Old Satellite TV Wires and Equipment




Remove as much of the old satellite hardware and wiring as you can. Keep the Azimuth motor, wire, and limit switch, as well as 12v DC power wires.
Mount Starlink Dish to Original Rotating Hardware







Use the 3D Printed Starlink RV Adapter plate, Extended Starlink Dish Mount, and 12x24" aluminum plate to make a platform to mount the Starlink Dish to the original rotating bearing. Use the adapter plate as a template to cut out the required holes in the aluminum plate (I used an angle grinder with cutoff wheel, messy but works).
The Starlink dish is a tight fit inside the original housing. The bottom/front of the dish needs to be mounted as close to the wall of the enclosure as possible, but with enough room to allow for any sagging, flexing, slipping, bouncing etc while driving and still be able to rotate freely. The Extended Starlink Dish Mount is needed in order for the mount to clear the stepper motor and still have the dish as close to the wall as possible. I used Gorilla Tape to secure everything just to make sure it doesn't move. Also make sure the bottom of the dish and platform does not hit any wires or hardware when it rotates. You can use the Starlink Dish Riser/Support to lift the dish up if needed. Use bolts that do not have thick heads to mount the aluminum plate to the 3D printed adapter plate, otherwise you run the risk of the bolt heads hitting something when it rotates.
You will have to shorten (read cut/grind) the 2 bolts that the Dogleg spring uses (see pic). When you are totally done, go back and use blue locktite and/or lockwashers to secure all bolts/nuts.
Run the Starlink Flat cable through the center hole of the platform, making sure there is plenty of slack to maneuver the Starlink dish when installing the Extended Bracket Mount and then the dish onto the plate.. Place the stock rotating assembly and stepper motor on the center bearing and put the belt on around the large gear and stepper motor gear. Then install the Starlink adapter plate and platform, aligning the 4 center bolt holes. Then install the Starlink Dish onto the plate. Rotate the dish the full 720* and make sure it doesn't hit anything and the wires don't bind.
Prepare Raspberry Pi



Install Heatsinks and HAT
Install the heatsinks on the Raspberry Pi and the Stepper Motor HAT.
Install the Stepper Motor HAT onto the Raspberry Pi.
Set the Dip Switches on the Stepper Motor HAT to 1/2 Step.
1 0 0 1 1 1 (essentially Down, Up, Up, Down, Down, Down as seen in pic)
Insert 2.4GZ Wireless Mini Keyboard USB dongle into one of the USB 2.0 slots
Install Raspberry Pi OS Lite
Using the Raspberry Pi Imager software Install latest 64-bit Rasberry Pi OS Lite on a microSD card. You do not not need full GUI Desktop OS version as this will be running as a Headless Pi. In the Raspberry Pi Imager, scroll down and click Raspberry Pi OS (Other), then select Raspberry Pi OS Lite (64-bit).
Click Edit Settings.
Set your hostname, user/pass, your WiFi info (either home WiFi for testing or Starlink WiFi), Wireless LAN Country to US, Enable SSH.
Click Yes to create the microSD card then put it in your Raspberry Pi and power it on.
On your Windows machine, you can use PuTTY to SSH into your Raspberry Pi either using the hostname you setup above or get it's IP address from your router. You may have to connect it with an Ethernet cable the first time and set it up.
Configure Raspberry Pi:
In the Raspberry Pi config go to 8. Update
Then go to 5. Localizations Options, then L4 WLAN Country and scroll down and select US United States
In 5. Localization Options, set your Timezone, then your Locale (uncheck en_GB before checking en_US).
Select <Finish> then
Reboot
SSH back in to your Pi with PuTTY and go back into raspi-config
In Raspi-Config 1. System Options, you can set addtional WiFi info. You must connect to your Stalink WiFi at least once in order for it to save the password. Same for any other WiFi networks you may want it to automatically connect to. The script will automatically try to connect to your Starlink Router after it is up and running no matter what WiFi it initially connects to.
in 3. Interface Options, Enable I2C and SSH.
Select <Finish>
Update Raspberry Pi:
Log back in via PuTTY SSH (should be able to use Pi's WiFi IP address now if you where unable before), update and configure your Raspberry Pi by typing at the command prompt:
(Answer Y to any prompts)
Reboot and SSH back in
Install Required Software:
(Answer Y to any prompts)
Get Starlink-Auto-Alignment files to /usr/local/bin/:
Edit starlink-auto-alignment.py file:
The starlink-auto-alignment.py file is the library of code I wrote to keep the Starlink dish aligned.
You will need to update Line 25 of the file with the SSID (Network name) of your Starlink Router.
Go to Line 25: STARLINKSSID = "Starlink" and replace Starlink with your Starlink SSID Network name (assuming you changed it).
CTRL+S to Save
CTRL+X to exit out of the nano editor.
Poweroff
Prepare Wiring




Cut the plug off of the azimuth stepper motor and using the self soldering shrink connectors wire to a female JST XH plug. (see pic).
Black motor wire goes to the White plug wire
Green motor wire goes to the Yellow plug wire
Red motor wire goes to the Black plug wire
White motor wire goes to the Red plug wire
This JST plug will plug the stepper motor into Interface 1 of the Stepper Motor HAT
Using the original 12v power wires from the original DISH TV satellite controller, wire the 2.1mm x 5.5mm DC power plug. This will power the Stepper Motor HAT and the Raspberry Pi (no 5V USB power plug is needed for the rPi).You will be able to turn the Raspberry Pi On/Off using the old factory Dish Satellite On/Off switch.
For the BerryIMU, you can use 2 JST XH female plugs as a wiring harness , connecting similar color wires together. On the Raspberry Pi side of the harness, the red wire will need to be cut and use a breadboard connector for the ground wire going to GPIO pin 9. Also use an exacto knife to cut off all the tabs and stuff on the Raspberry Pi side plug. This will allow that plug and the 5V fan plug room to co-exist on the GPIO header pins.
Wherever you plan on installing the Raspberry Pi with Stepper Motor HAT and the BerryIMU Compass, make sure the hardware and the wires won't interfere with the Starlink Dish and platform rotating. I put mine up against the wall of the enclosure.
Test Auto Alignment





Find a place to put the Raspberry Pi and Compass
Make sure all hardware and wires will be out of the way of the Starlink Dish and platform when it rotates. I put my Raspberry Pi and Compass up against the wall of the enclosure. The orientation of the compass does not matter too much (as long as it is flat). Once the Raspberry Pi gets alignment info from the Starlink Dish, it will automatically update and save the compass' offset to North.
Using the pictures above, plug the wires into the Stepper Motor HAT
The Limit Switch connector goes on the GPIO Pins 37 and 39.
5V Fan goes to GPIO Pins 4 and 6.
BerryIMU connector goes to 1, 3, 5, and 9. The Ground Wire (red wire we cut) goes to Pin 9.
Stepper Motor Plug goes to Motor Interface 1
2.1mmx5.5mm 12v Power Plug into External Power Supply Interface
Test Rotation for Interference
Unplug the Stepper Motor plug from the Stepper Motor HAT as rotating the Starlink Dish manually can send electricity to the HAT/Pi and destroy it.
Rotate the Starlink DIsh back and forth through the full 720* of rotation making sure it won't hit anything.
Make sure Dogleg switch and Limit Switch sound like they are working.
Plug stepper motor plug back in.
Power On Devices
Make sure 2.4Ghz Keyboard USB dongle is plugged in, Dip Switches are set correctly, and power switch on Stepper Motor HAT is turned OFF. Turn on wireless keyboard.
Power on the Starlink Router and Dish
Using the stock DISH Satellite TV Power switch in the RV, turn the switch On.
Switch the Stepper Motor HAT On. If there is a problem, you can turn it off here.
NOTE: If the Dip Switches on the Stepper HAT are not set correctly, it will not rotate the correct amount. This could cause it to over rotate CCW past the mechanical limits of the system and possible damage it.
If it seems to not rotate enough/too slow, the Dip Switches are probably set to 1/16th Step.
If it seems to rotate too much/too fast, the Dip Switches are probably set to Full Step.
It needs to be set to 1/2 Step.
Control from Command Line
Use PuTTY to SSH into the Raspberry Pi
Change the directory to /usr/local/bin/
Run the starlink-auto-alignment.py script
NOTE: You can use CTR+C to exit the program if needed. If you run into errors, make sure all script libraries and software was installed. If still running into issues, please post on the Starlink for RVers FB Group Post.
The first time you run this script, it should be in MANUAL mode. At any point, if you hold the Down button or the Left or Right Arrow buttons, it will switch to Manual Mode. If you hold an Arrow button, you will know that it switched to Manual mode when it starts rotating 3* at a time which should be fairly audible even inside the RV.
You can use the Wireless Keyboard to control the Starlink Dish Alignment (use Alignment tab of Starlink App for verification):
MANUAL MODE WIRELESS KEYBOARD COMMANDS
<-- = Rotate 3* CW LEFT
--> = Rotate 3* CCW RIGHT
R = Rotate 1* CCW Right
L = Rotate 1* CW Left
Enter/OK = Set current Sat Heading as Target Heading and update Compass Offset
A = Switch to Auto Compass Mode
S = Switch to Starlink API Mode
Up = Switch to Starlink API Mode (or Auto Mode if API not returning info)
Down = Switch to Manual Mode
0 = Zero Motor
C = Center Motor
I = Initialize Motor (ie,Zero then Center)
E = Enable Motor to keep satellite in position. Uses power and motor gets hot.
D = Disable Motor. May freewheel, but uses less power and keeps motor cool. (better)
W = Try to reconnect to Starlink WiFi
T = Get Raspberry Pi Temperature in *C
X = Turns off Zeroing and Centering Motor and starts in Manual Mode on next Restart of Service
P = Powercycle (ie Reboot) Pi
ESC = Restart StarlinkAutoAlignment Service
DEL = Stops StarlinkAutoAlignment Service (this script) and returns to command line
(Note: you will need to press and hold, P, ESC, and DEL to send those commands to avoid accidently shutting down the service)
Press the Left Arrow button to Rotate the Dish Clockwise (CW). It should rotate in intervals of 2.5*. Make sure everything seems to be running smoothly, no interference, and that it is moving the correct amount (ie Dip Switches are set correctly).
If everything seems to be OK, you can hit 0 (Zero) on the wireless keyboard, This will rotate the dish CW until it hits the Limit Switch, Zeroing out the current location reading so that it will know exactly where it is and where the dish is aligned. If it seems to be rotating a lot faster or slower than in my video, double check dip switches are set to half-step.
Hit the "C" button to Center the dish. This should rotate it 360* Counter Clockwise (CCW). This will then allow the dish to rotate a full 360* in either direction before hitting its physical limits.
Press the "Up Arrow" button to start the Auto mode. It will try to use the Starlink API to determine the optimal Starlink Dish Alignment. If it does not get alignment info back from the Starlink Dish API, it will automatically switch to Auto Compass Mode.
Auto Compass Mode uses the compass to determine RV's heading, the dish's relative position, and the last known optimal heading to try to keep the Startlink dish aligned optimally. Digital compasses are very noises and being inside the metal housing doesn't help. The digital compass heading jumping around ~5* or so while stationary is normal. This one reason why we don't automatically move the Starlink dish until it is over 15* out of alignment.
Play with the keyboard while watching the output on PuTTY and the dish Alignment on the Starlink App to see what the keyboard can do and what info is returned. This is good for debugging. Every time the Starlink-Auto-Alignment script runs, after its starts up it will set the INI file to center the motor and start in Auto mode next time the service starts. To temporarily stop that from happening, press the X key while in Manual mode (press right, left or down to enter Manual mode). Pressing X will allow you to restart the service and test stuff without the dish rotating as soon as it boots up.
If everything seems to work. We can setup the starlink-auto-alignment as a Service to automatically start up when the Raspberry Pi boots up.
Starlink-auto-alignment.py As a Service
Set starlink-auto-alignment.py to run as a Service
This will allow the script to run every time the Raspberry Pi boots up, making it fully automatic.
Create the Service
Copy/Paste the following into the file:
CTR+S to Save
CTR+X to Exit out
Give the Service and Script Correct Permissions
Enable The Service
Reboot
SSH back in and Test with journalctl
This should show you similar output to what you saw before when you ran the script manually.
Press q or CTR+C to exit watching the output.
Note: If you try to run the starlink-auto-alignment.py script manually from the command line while the service is already running, you may get a 'GPIO not allocated' error. Either use the wireless keyboard to go into Manual mode and then hold DEL key to stop the service first, or stop the service from the command line with:
Then you can try to run the script from the command line to see the output:
Useful Links

Stepper Motor Control with a Raspberry Pi and DRV8825 Controller HowTo Video
Stepper Motor Driver Tutorial (FYI, HRB8825 we are using is the updated version of the DVR8825 stepper motor driver. Uses same code)
Raspberry Pi Stepper Motor Controller
Control Stepper Motor with DVR8825 Driver
Waveshare HRB8825 Stepper Motor HAT page
Waveshare HRB8825 Stepper Motor HAT Wiki
Lin Engineering 4118 Stepper Motor page
Lin Engineering 4118 Stepper Motor Spec Sheet