Just another servo tester banner

Just another servo tester

4 devlogs
4h 8m 25s

Just a program that tests servos. NEW UPDATE BASICALLY A SERVO CONTROLLER NOW!

This project uses AI

Used ai for setup and debugging

Demo Repository

Loading README...

neoxyyang11

Devlog #4: The Name Change & The PyPI “Wall”
Date: April 8, 2026
Status: 0.1.7 is finally live (and I am exhausted).

📝Today (AHHHHH)
If you looked at my commit history today, you’d see a beautiful new feature and a clean project name. What you don’t see is the absolute war I waged against the PyPI servers.

So today i added it to the PYPI liabry! (try it yourself: pip install servotest, then run servotest)

  • Coding Time: 60 minutes of code
  • Fixing PyPI/GitHub Actions:** 1 hour+ (of absolute chaos).

I officially renamed the project from servo_tester to the much cleaner servotest.

Pro-tip: Renaming a project mid-build is like trying to change a tire while the car is moving. I hit every error from 0 to 404, because my local dist/ folder was haunted by the ghost of the old name or pypi just hates me.

New Feature: The “Dual-Core” Startup
While I wasn’t fighting with YAML, I actually made the tool much smarter. I’ve implemented a more professional Mode Selection and Port Searching logic.

  1. Choose Your Adventure: Test vs. Real
    I’ve moved away from hardcoding “TEST” in the script. Now, when you launch servotest, the CLI gives you a choice:
    *Real Mode: The script scans your system using pyserial’s tools.list_ports. It looks for the Waveshare driver signature and tries to handshake with the STS3215 servos.
    *Test Mode: No hardware? No problem. It spins up a Virtual Servo inside the terminal. This allows for logic testing, packet verification, and UI layout checks even if the postman is still a few days away with the actual servos.

  2. Intelligent Port Searching
    Instead of guessing if the board is on COM3 or COM7, the script now lists available serial devices and asks for confirmation if it’s unsure. It’s way more robust than the “pray it connects” method I had last week.

📦 The “Fresh Start” Release
I’ve officially nuked the old API tokens and moved to Trusted Publishing. No more secret keys; GitHub and PyPI now just “trust” each other via OIDC.

This is probaly my last devlog for this project, now to the robot arm!

Attachment
Attachment
Attachment
Attachment
0
neoxyyang11

Gemini said
neoxyyang11 worked on Just another servo tester
1 minute ago
1h 20m logged

DEVLOG: THE EYE OF THE SERVO — PATCH NOTES v1.5
Date: April 6, 2026
Status: Software Refined / Simulation Mode Active

[NEW FEATURES]

The Progress & Angle Bar (Visual Feedback)

Added: A dynamic ASCII-based visualizer for servo positioning.

Logic: Created the draw_bar(val) function. It maps the 12-bit range (0–4095) to a 20-character block string.

The Result: Instead of just staring at numbers, the console now shows a “loading bar” style slider that moves in real-time as the servo (simulated or real) hits its targets. It makes it much easier to catch jitter or travel limits at a glance.

Macro Mode: Record & Replay

Added: A persistent MACRO_LIST array to store movement sequences.

Workflow: In Live Mode, every successful command (raw or degree-based) is automatically pushed to the macro list.

Replay: Option [3] iterates through the list with a 0.8s delay between steps, allowing for “choreographed” movement testing.

Cleanup: Added Option [4] to flush the array so I can start fresh without restarting the script.

Real-Time Telemetry (Voltage & Temp)

Added: A get_telemetry function that pings the STS3215 internal sensors.

Registers: Reading 2 bytes starting at address 0x2C.

Safe-Guards: * Voltage: The raw value is divided by 10 to get the actual 12.0V reading.

Thermal Alert: The temperature display turns CRITICAL RED if the internal thermistor reads over 50°C.

[BUG FIXES & REFINEMENTS]

Refined: Added ser.reset_input_buffer() to the telemetry loop. This clears out any “ghost” data or echoes from the TX line so the temperature readings don’t get mixed up with previous position commands.

UI: Added a clear_console() call to the main menu loop. It keeps the terminal from becoming a wall of text and keeps the telemetry “HUD” at the top during manual control.

[KNOWN ISSUES]

The TEST MODE telemetry returns dummy values (shown in CYAN) since there’s no physical sensor to ping.

Still haven’t tested if the 0.05s sleep is enough time for the Waveshare board to switch from TX to RX mode.

Note: The macro recorder is actually a game changer. I can “teach” the servo a path manually and then just watch it repeat the loop. It feels less like a script and more like a controller now. Still staring at the front door waiting for the delivery truck.

Attachment
Attachment
Attachment
0
neoxyyang11

DEVLOG: THE SERVO STIRRER — PATCH NOTES v1.2
Date: April 6, 2026
Status: Hardware Pending (Simulation Phase)

[NEW FEATURES]

  1. Integrated Test Mode (Hardware Emulation)
  • Added: Ability to run the script without a physical serial connection.
  • Logic: Setting PORT = "TEST" now bypasses the serial.Serial initialization which previously caused the script to crash if no servo was found.
  • Packet Sniffer: In Test Mode, the script now prints the raw 9-byte hex packet directly to the console. This allows for verification of the checksum math and high/low byte shifting before the hardware arrives.
  1. Manual “Live Control” Mode
  • Added: Option [2] in the main menu to allow real-time servo manipulation.
  • Hybrid Input: Added a string parser that accepts two types of input:
    • Raw: Values from 0-4095 for direct register control.
    • Degrees: Values followed by ‘d’ (e.g., 180d) which are automatically converted to the 12-bit servo scale via the formula $(Deg / 360) \times 4095$.
  • Safety: Added “Exit” command to safely return to the main menu.
  1. ANSI Color Interface (Visual Overhaul)
  • Added: Full support for ANSI escape sequences to improve readability in the VS Code terminal.
  • Color Mapping:
    • CRITICAL RED: Used for the [TEST MODE] alerts and hardware guardrail errors to ensure they aren’t missed.
    • CYAN: Applied to headers and menu prompts for better visual hierarchy.
    • YELLOW: Highlights variable data like Servo IDs, COM ports, and raw packet arrays.
    • GREEN: Indicates successful benchmark completion and “Go” prompts.

[BUG FIXES & REFINEMENTS]

  • Fixed: Syntax error where a missing closing parenthesis on the input() function prevented the script from compiling.
  • Refined: Updated the send_packet function to handle NoneType serial objects when in simulation mode.
  • Refined: Improved the try/except block to provide more specific troubleshooting tips for the Waveshare board (Jumper B settings, driver issues).

[KNOWN ISSUES]

  • Physical torque and gear clearance cannot be verified until the postman delivers the actual servos.

Note:** This update was a huge milestone. Even though I’m still waiting on the hardware, the software side is now a “real” tool. Seeing the TEST MODE warning in bright red makes it look cooler.
Next step: Plugging in the 12V and seeing it spin.

Attachment
1

Comments

neoxyyang11
neoxyyang11 2 days ago

Also updated the readme

neoxyyang11

DEVLOG: THE SERVO SPIN TESTER BENCHAMRK THIGNYMAGIG
April 4th: IT’S ALIVE

When you’re building complex robotics, the last thing you want to do is troubleshoot a dead motor after you built it. This project was born out of the need for a “check” tool. This script lets you plug a servo into a Waveshare Adapter, check your COM port, and instantly verify if the hardware is alive, responsive, and moving through its full 0 to 4095 range. (0-360 degrees)

I based the packet structure off of the Waveshare wiki originally, but their examples were for a different library than the raw approach I wanted. That meant I had to figure out not only how they structured the hex packets originally, but also how to calculate the checksums manually so the servo didn’t just ignore me.

Fortunately for us, the STS3215 protocol is somewhat documented. They use a specific command structure where you send a start header, the ID, length, command type, the register address, and finally the parameters.

In short, here’s how the packet method worked:

Construct a list of bytes starting with 0xFF

Pack the target servo ID and the length of the remaining message

Add the command (0x03 for write) and the register address (0x2A for position)

Split the 12 bit position value into two 8 bit bytes (low then high)

Calculate a checksum by summing the bytes and bitwise flipping the result

The main problem was then figuring out why the servo wasn’t responding even when the TX light was blinking. I wasn’t even sure if I had the baud rate right. 1000000 bps what the docs said.

Here’s how I figured that out:

The Waveshare docs mentioned the default baud is 1M

A quick search on some forums mentioned that the checksum needs to be calculated starting from the ID byte, not the headers

A bunch more digging eventually led me to realize that the jumper needs to be on B for USB mode.

Anyhow, digging into the register map eventually led me to realize 0x2A is the 2 byte position register. Using a bit of bit shifting to split the values, I eventually got the benchmark sequence running.

Ps this is my first project with hackclub, please don’t judge, writing skills aren’t great.

Attachment
0