Reverse Engineering Liberates Dash Cam Video

If you’ve purchased a piece of consumer electronics in the last few years, there’s an excellent chance that you were forced to use some proprietary application (likely on a mobile device) to unlock its full functionality. It’s a depressing reality of modern technology, and unless you’re willing to roll your own hardware, it can be difficult to avoid. But [krishnan793] decided to take another route, and reverse engineered his DDPAI dash camera so he could get a live video stream from it without using the companion smartphone application.

Like many modern gadgets, the DDPAI camera creates its own WiFi access point that you need to connect to for configuration. By putting his computer’s wireless card into Monitor mode and running Wireshark, [krishnan793] was able to see that the smartphone was communicating with the camera using some type of REST API. After watching the clear-text exchanges for awhile, he not only discovered a few default usernames and passwords, but the commands necessary to configure the camera and start the video stream.

After hitting it with the proper REST messages, an nmap scan confirmed that several new services had started up on the device. Unfortunately, he didn’t get any video when he pointed VLC to the likely port numbers. At this point [krishnan793] checked the datasheet for the camera’s Hi3516E SoC and saw that it supported H.264 encoding. By manually specifying that as the video codec when invoking VLC, it was able to play a video stream from port 6200. A little later, he discovered that port 6100 was serving up the live audio.

Technically that’s all he wanted to do in the first place, as he was looking to feed the video into OpenCV for other projects. But while he was in the area, [krishnan793] also decided to find the download URL for the camera’s firmware, and ran it through binwalk to see what he could find out. Not surprisingly the security turned out to be fairly lax through the entire device, so he was able to glean some information that could be useful for future projects.

Of course, if you’d rather go with the first option and build your own custom dash camera so you don’t have to jump through so many hoops just to get a usable video stream, we’ve got some good news for you.

Linux Fu: Python GUIs For Command Line Programs (Almost) Instantly

Not every programmer likes creating GUI code. Most hacker types don’t mind a command line interface, but very few ordinary users appreciate them. However, if you write command line programs in Python, Gooey can help. By leveraging some Python features and a common Python idiom, you can convert a command line program into a GUI with very little effort.

The idea is pretty simple. Nearly all command line Python programs use argparse to simplify picking options and arguments off the command line as well as providing some help. The Gooey decorator picks up all your options and arguments and creates a GUI for it. You can make it more complicated if you want to change specific things, but if you are happy with the defaults, there’s not much else to it.

At first, this article might seem like a Python Fu and not a Linux Fu, since — at first — we are going to focus on Python. But just stand by and you’ll see how this can do a lot of things on many operating systems, including Linux.

Continue reading “Linux Fu: Python GUIs For Command Line Programs (Almost) Instantly”

Finding Pre-Trained AI In A Modelzoo Using Python

Training a machine learning model is not a task for mere mortals, as it takes a lot of time or computing power to do so. Fortunately there are pre-trained models out there that one can use, and [Max Bridgland] decided it would be a good idea to write a python module to find and view such models using the command line.

For the uninitiated, Modelzoo is a place where you can find open source deep learning code and pre-trained models. [Max] taps into the (undocumented) API and allows a user to find and view models directly. When you run a utility, it goes online and retrieves the categories and then details of the available models. From then on, the user can select a model and the application will simply open the corresponding GitHub repository. Sounds simple but it has a lot of value since the code is designed to be extendable so that users working on such projects may automate the downloading part as well.

We have seen projects with machine learning used to detect humans, and with AI trending community tools such as this one help beginners get started even faster.

RPi Tank Invades Living Room, Teaches OpenCV

If you’re looking for a simple project to start exploring the intersection of OpenCV and robotics, then the RPi Tank created by [Vishal Varghese] might be a good place to start. A Raspberry Pi and a few bits of ancillary hardware literally taped to the top of a toy M1 Abrams tank becomes a low-cost platform for testing out concepts such as network remote control and visual line following. Sure, you don’t need to base it around an Abrams tank, but if you’re going to do it you might as well do it with style.

As this is more of a tech demonstrator, the hardware details are pretty minimal. [Vishal] says you just need a relatively recent version of the Raspberry Pi, a MotoZero motor controller, and a camera module. To provide juice for the electronics you don’t need anything more exotic than a USB power bank, which in his case has been conveniently attached to the top of the turret. He doesn’t provide exact details on how the MotoZero gets wired into the Abram’s motors, but we imagine it’s straightforward enough that the average Hackaday reader probably doesn’t need it spelled out for them.

Ultimately, the software is the heart of this project, and that’s where [Vishal] really delivers. He’s provided sample Python scripts ordered by their level of complexity, from establishing a network connection on the Raspberry Pi to following a line of tape on the ground. Whether used together or examined individually, these scripts provide a great framework to get your first project rolling. Literally.

Line following robots, in their many forms, have been a favorite hacker project for years. Whether they home in with an analog circuit or replace the lines with hidden wires, they’re a great way to get started with semi-autonomous robotics.

Analog Gauges Keep An Eye On Computer Performance

Keeping an eye on your computer’s resource utilization can be useful, particularly if you’re regularly doing computationally intensive tasks. While it’s entirely possible to achieve this with software tools, creating a dedicated hardware monitor can be cool too. [Sasa Karanovic] did just that, with a set of old-school analog gauges.

The build uses an STM32 microcontroller to drive a series of four galvanometers through an MCP4728 digital-to-analog converter. Data on CPU, memory, network and GPU utilization is collected by a Python script, and sent over a USB serial connection. This data drives the four-channel DAC, which in turn creates the voltages which control the needle position on the gauges. Aesthetically, the build features a few nice touches, including custom gauge faces and a 3D printed enclosure with a tasteful matte finish. A custom PCB keeps the electronics and wiring neat and tidy.

[Sasa] does a great job of explaining the basic theory of the device, as well as practical considerations for working with galvanometer-based gauges. It would make a great weekend project for anyone seeking to add some vintage charm to their desktop rig. There’s also scope to monitor other variables, like hard drive usage or CPU temperature. There’s bonus points if you integrate this into a laptop; the tip line would love to know. We’ve seen LED-based monitoring systems before, too. Video after the break.

Continue reading “Analog Gauges Keep An Eye On Computer Performance”

What’s In A Name? Tales Of Python, Perl, And The GIMP

In the older days of open source software, major projects tended to have their Benevolent Dictators For Life who made all the final decisions, and some mature projects still operate that way. Guido van Rossum famously called his language “Python” because he liked the British comics of the same name. That’s the sort of thing that only a single developer can get away with.

However, in these modern times of GitHub, GitLab, and other collaboration platforms, community-driven decision making has become a more and more common phenomenon, shifting software development towards democracy. People begin to think of themselves as “Python programmers” or “GIMP users” and the name of the project fuses irrevocably with their identity.

What happens when software projects fork, develop apart, or otherwise change significantly? Obviously, to prevent confusion, they get a new name, and all of those “Perl Monks” need to become “Raku Monks”.  Needless to say, what should be a trivial detail — what we’ve all decided to call this pile of ones and zeros or language constructs — can become a big deal. Don’t believe us? Here are the stories of renaming Python, Perl, and the GIMP.

Continue reading “What’s In A Name? Tales Of Python, Perl, And The GIMP”

Sensor Filters For Coders

Anybody interested in building their own robot, sending spacecraft to the moon, or launching inter-continental ballistic missiles should have at least some basic filter options in their toolkit, otherwise the robot will likely wobble about erratically and the missile will miss it’s target.

What is a filter anyway? In practical terms, the filter should smooth out erratic sensor data with as little time lag, or ‘error lag’ as possible. In the case of the missile, it could travel nice and smoothly through the air, but miss it’s target because the positional data is getting processed ‘too late’. The simplest filter, that many of us will have already used, is to pause our code, take about 10 quick readings from our sensor and then calculate the mean by dividing by 10. Incredibly simple and effective as long as our machine or process is not time sensitive – perfect for a weather station temperature sensor, although wind direction is slightly more complicated. A wind vane is actually an example of a good sensor giving ‘noisy’ readings: not that the sensor itself is noisy, but that wind is inherently gusty and is constantly changing direction.

It’s a really good idea to try and model our data on some kind of computer running software that will print out graphs – I chose the Raspberry Pi and installed Jupyter Notebook running Python 3.

The photo on the left shows my test rig. There’s a PT100 probe with it’s MAX31865 break-out board, a Dallas DS18B20 and a DHT22. The shield on the Pi is a GPS shield which is currently not used. If you don’t want the hassle of setting up these probes there’s a Jupyter Notebook file that can also use the internal temp sensor in the Raspberry Pi. It’s incredibly quick and easy to get up and running.

It’s quite interesting to see the performance of the different sensors, but I quickly ended up completely mangling the data from the DS18B20 by artificially adding randomly generated noise and some very nasty data spikes to really punish the filters as much as possible. Getting the temperature data to change rapidly was effected by putting a small piece of frozen Bockwurst on top of the DS18B20 and then removing it again.

Continue reading “Sensor Filters For Coders”