A Simple Web-Based Wiring Harness Tool

When building electronic assemblies there is quite often the need to construct custom cables to hook things up. It’s all very well if you’re prototyping by hand, or just building one or two of a thing, but if you’re cranking them out using outside help, then you’re going to want to ensure that cable is described very accurately. [Christian Nimako-Boateng Jr.] presents for us the first version of wirely, a wiring harness tool. This is a web-based tool that allows one to describe the cable ends and connectivity between them, producing a handy graphic and exports to excel in a format that should be easy to follow.

Based around the wireviz Python library running on a flask-based backend, image data are sent to the web assembly front-end and rendered with OpenGL. Configuration files can be imported and exported as JSON, making it easily linkable to other tools if required. Helpfully, the tool also seems to support some kind of revision control, although we didn’t try that yet. The process is straightforward enough, one simply defines a few groups (these relate to individual PCBs or other floating items in the assembly) which each contain one or more connectors. First, the connectors are described with part numbers, and wire gauge data, before defining the list of connections (wires) showing which signal and physical pins are connected together. Nothing more complex than that yet. We think there is still some more functionality that the tool could manage, such as shielding and guarding details, twisted pair definitions and a few others, but for a first pass, wirely looks pretty handy.

If you want a more heavyweight option using IEC 60617 symbols for describing wiring harnesses, then look no farther than QElectroTech, and yes, we have covered wireviz before, just for those that want to cut out the middleman and describe their cables in Python directly.

Automate Internet Life With Python

Most of us are adept enough with computers that you know what they can easily do and what they can’t. Invent a new flavor of ice cream? Not easy. Grab the news headlines related to Arduinos from your favorite news feed? Relatively easy. But, of course, the devil is in the details. FreeCodeCamp has a 3-hour course from [Frank Andrade] that dives into the gory details of automating web tasks using Python and a variety of libraries like Path, Xpath, and Selenium. You can watch the course, below.

Topics start off with grabbing tables from websites and PDFs. But it quickly graduates to general-purpose web scraping and even web automation. These techniques can be very useful for testing browser-based applications, too.

By the end, you’ve created an executable that grabs news every day and automatically generates an Excel report. There’s also a little wind down about WhatApp automation. A little something for everyone. We also greatly approved of [Frank]’s workspace which appears in the background. Looks like he would enjoy reading Hackaday.

Honestly, while we’ve seen easier methods of automating the browser, there’s something appealing about having the control something like Python affords. Sure beats building hardware to simulate a human-in-the-loop.

Continue reading “Automate Internet Life With Python”

Computer Vision Extracts Lightning From Footage

Lightning is one of the more mysterious and fascinating phenomenon on the planet. Extremely powerful, but each strike on average only has enough energy to power an incandescent bulb for an hour. The exact mechanism that starts a lightning strike is still not well understood. Yet it happens 45 times per second somewhere on the planet. While we may not gain a deeper scientific appreciation of lightning anytime soon, but we can capture it in various photography thanks to this project which leverages computer vision machine learning to pull out the best frames of lightning.

The project’s creator, [Liam], built this as a tool for stormchasers and photographers so that they can film large amounts of time and not have to go back through their footage manually to pull out the frames with lightning strikes. The project borrows from a similar project, but this one adds Python 3 capabilities and runs on a tiny netbook for more easy field deployment. It uses OpenCV for object recognition, using video files as the source data, and features different modes to recognize different types of lightning.

The software is free and open source, and releases are supported for both Windows and Linux. So far, [Liam] has been able to capture all kinds of electrical atmospheric phenomenon with it including lightning, red sprites, and elves. We don’t see too many projects involving lightning around here, partly because humans can only generate a fraction of the voltage potential needed for the average lightning strike.

No Tool Left Behind With The Help Of Homemade Shadow Boards

Shadowed tool storage — where a tool outline shows at a glance what’s missing from storage — is a really smart way to keep your shop neat. They’re also super important for cases where a tool left behind could be a tragedy. Think, where’s-that-10-mm-socket-while-working-on-a-jet-engine? important. (It’s always the 10-mm socket.)

But just because shadow boards are smart, doesn’t mean they’re easy to make. That’s why [Scott Prince] came up with this semi-automated method for making toolbox shadow boards. The job of tracing around each tool on some sort of suitable material and cutting out the shapes seems straightforward, but the trick comes in organizing the outlines given the space available and the particular collection of tools.

[Scott]’s method starts with capturing images of each individual tool. He used a PiCam and a lightbox housed, strangely enough, in a storage bench; we’d love to hear the full story behind that, but pretty much any digital camera would do for the job. After compensating for distortion with OpenCV, cropping the images, and turning the image into a vector outline of the tool, [Scott] was left with the task of putting the tools into logical groups and laying them out sensibly. After tweaking the tool outlines and adding finger cutouts for easy pickup, [Scott] put his CNC router to work. He chose to use a high-density polyethylene product made by his employer, which looks fantastic, but MDF would work fine too.

We have to admit to a fair degree of toolbox envy now that we’ve seen what shadow boards can do. We’re a bit torn, though — [Zach Friedman]’s Gridfinity storage system has a lot going for it, too.

PyScript: Python In The Web Browser

A chainsaw can make short work of clearing out the back forty. It can also make a good horror movie. So while some people will say we don’t need another tool to allow more malicious scripting in the browser, we also know that, like any tool, you can use it or abuse it. That tool? PyScript, which is, of course, Python in the browser.

The tool is in the early experimental phase, so the project doesn’t suggest using it in a production environment yet. However, if it works well, the promise is not just that you can write browser-based applications in Python — you’ll have a handy way to reuse existing Python code and even be able to run the same code on the browser that currently runs on the server. This has a lot of implications for improved client/server applications, or cases where you want to be able to run against a local backend when disconnected and a remote backend when you do have a connection. Of course, you can interoperate with JavaScript, too.

Continue reading “PyScript: Python In The Web Browser”

Remote Screen Viewer Is Text-Only

Have you been slowly falling down a rabbit hole of Stallman-like paranoia of computers ever since installing Ubuntu for the first time in 2007? Do you now abhor anything with a GUI, including browsers? Do you check your mail with the command line even though you’re behind seven proxies? But, do you still want to play Minecraft? If so, this command-line-only screen viewer might just be the tool to use a GUI without technically using one.

This remote screen viewer is built in Python by [louis-e] and, once installed, allows the client to view the screen of the server even if the client is a text-only console. [louis-e] demonstrates this from within a Windows command prompt. The script polls the server screen and then displays it in the console using the various colors and textures available. As a result, the resolution and refresh rate are both quite low, but it is still functional enough to play Minecraft and do other GUI-based tasks as long as there’s no fine text to read anywhere.

The video below only shows a demonstration of the remote screen viewer, and we can imagine plenty of uses beyond this proof-of concept game demonstration. Installing a desktop environment and window manager is not something strictly necessary for all computers, so this is a functional workaround if you don’t want to waste time and resources installing either of those components. If you’re looking for remote desktop software for a more specific machine, though, take a look at this software which enables remote desktop on antique Macs.

Continue reading “Remote Screen Viewer Is Text-Only”

AI Attempts Converting Python Code To C++

[Alexander] created codex_py2cpp as a way of experimenting with Codex, an AI intended to translate natural language into code. [Alexander] had slightly different ideas, however, and created codex_py2cpp as a way to play with the idea of automagically converting Python into C++. It’s not really intended to create robust code conversions, but as far as experiments go, it’s pretty neat.

The program works by reading a Python script as an input file, setting up a few parameters, then making a request to OpenAI’s Codex API for the conversion. It then attempts to compile the result. If compilation is successful, then hopefully the resulting executable actually works the same way the input file did. If not? Well, learning is fun, too. If you give it a shot, maybe start simple and don’t throw it too many curveballs.

Codex is an interesting idea, and this isn’t the first experiment we’ve seen that plays with the concept of using machine learning in this way. We’ve seen a project that generates Linux commands based on a verbal description, and our own [Maya Posch] took a close look at GitHub Copilot, a project high on promise and concept, but — at least at the time — considerably less so when it came to actual practicality or usefulness.