Scripting Debug Sessions: Python for GDB Remote Serial Protocol

pyrsp-scripted-gdb

Are you tired of hammering out the same commands over and over again in GDB? If not, we highly encourage you take more advantage of The GNU Project Debugger, which is a fantastic way to poke around inside your microcontrollers while they’re running a program.

Back to the matter at hand. [Stef] put together a Python program that leverages GDB’s Remote Serial Protocol. He calls it pyrsp and the talk he recently gave about it can be seen below.

The core feature is the ability to add a callback in your C code that triggers the Python script. Think of this a little bit like a print statement, except you have so much more power since it’s Python and GDB doing the “printing”. Anything that can be done at a breakpoint in GDB can now be executed automatically. So if you need to check a group of registers at every loop execution for hundreds of loops your wrists are going to thank you. Better yet, you can use Python to do the sanity checks automatically, continuing when the data is good and alerting you when it’s not. Neat!

[Read more...]

Raspberry Pi Spies on Your Front Door

doorbell pictures

One of [Sander]‘s first projects with a Raspberry Pi was to get it to send messages to his iPhone. From there he decided to take it a step further and wire the tiny computer up to his doorbell, creating a system that can send push messages to his phone whenever someone is at the front door.

[Sander]‘s doorbell is wireless, and he decided to keep all of its original functionality. All it took to signal the Pi was a simple circuit tied to the doorbell’s status LED which turns off whenever the doorbell is pushed.

The Raspberry Pi runs a python program that handles the GPIO pin which is wired to the doorbell. When the doorbell is pushed, the program processes and sends the push notification while taking pictures of the visitor with an attached webcam. The pictures are included in the message so [Sander] can see who is at the front door. The code for the project is included on his project page.

This project rang a bell for us since we’ve seen projects using a Raspberry Pi and push notifications. None of them so far have included a webcam or utilized an existing wireless doorbell though, and this is a great step forward!

Apple ][ Graphics as your Screensaver or Second Screen

apple2-xscreensaver-weather-demo

Hipsters rejoice, you can actually make those high-tech IPS panels look like crap. Really nostalgic crap. [Kaveen Rodrigo] wrote in to show how he displays weather data as his Apple ][ emulated screensaver.

2014-07-08-234300_1366x768_scrotHe’s building on the Apple2 package that is part of the xscreensaver available on Linux systems. The program has an option flag that allows you to run another program inside of it. This can be just about anything including using it as your terminal emulator. [Adrian] recently sent us the screenshot shown here for our retro edition. He is running bash and loaded up freenet just to enjoy what it used to be like in the good old days.

In this case, [Kaveen] is using Python to pull in, parse, and print out a Yahoo weather json packet. Since it’s just a program that is called when the screensaver is launched, you can use it as such or just launch it manually and fill your second monitor whenever not in use.

We gave it a whirl, altering his code to take a tuple of zip codes. Every hour it will pull down the data and redraw the screen. But we’ve put enough in there that you’ll be able to replace it with your own data in a matter of minutes. If you do, post a screenshot and what you’re using it for in the comments.

[Read more...]

Android Doorbell Notifier

Breadboarded circuit to detect when doorbell rings

It’s always unfortunate to find a FedEx tag on your door saying you missed a delivery; especially when you were home the whole time. After having this problem a few times [Lee] decided to rig up a doorbell notifier for his Android phone.

[Lee]‘s doorbell uses a 10 VAC supply to ring a chime. To reduce modifications to the doorbell, he added an integrated rectifier and a PNP transistor. The rectifier drives the transistor when the bell rings, and pulls a line to ground.

An old Netgear router running OpenWRT senses this on a GPIO pin. Hotplugd is used to run a script when the button push is detected.

The software is discussed in a separate post. The router runs a simple UDP server written in C. The phone polls this server periodically using SL4A: a Python scripting layer for the Android platform. To put it all together, hotplugd sends a UNIX signal to the UDP server when the doorbell is pushed. Once the phone polls the server a notification will appear, and [Lee] can pick up his package without delay.

Extending EagleCAD With Python

eagleAlthough it’s derided for not being open source, EagleCAD is an extremely popular piece of schematic and PCB layout software. Most of the popularity is probably due to the incredible amount of part libraries – it’s certainly not the features Eagle has to offer or its horrible scripting capabilities. [Rob] had enough of the lack of good scripting support in Eagle, so he’s been spending his time making Eagle’s ULP work with Python. He’s only been at it a short time, but already it’s much more usable than the usual Eagle scripts.

Below you can check out a pair of videos of [Rob]‘s Python tools for Eagle in action. The first video goes through aligning a few symbols and creating a board outline (with proper curves!) from a DXF file. The second video shows exactly how valuable these tools are when laying out a board: imagine hundreds of LEDs and resistors automatically aligned to each other with a single click of a mouse. Beautiful.

All the PyEagle stuff is available on [Rob]‘s github, with a DXF importer, group manager, and alignment tool included. Now that everything’s Python, it’s easy to build your own tools without relying on Eagle’s odd ULP language.

[Read more...]

WiFinder is a Python Driven Roommate Warning System

WiFinder

We’ve all been there. Your roommate is finally out of the house and you have some time alone. Wait a minute… your roommate never said when they would be back. It would be nice to be warned ahead of time. What should you do? [Mattia] racked his brain for a solution to this problem when he realized it was so simple. His roommates have been warning him all along. He just wasn’t listening.

Most Hackaday readers probably have a WiFi network in their homes. Most people nowadays have mobile phones that are configured to automatically connect to these networks when they are in range. This is usually smart because it can save you money by not using your expensive 4G data plan. [Mattia] realized that he can just watch the wireless network to see when his roommates’ phones suddenly appear. If their devices appear on the network, it’s likely that they have just arrived and are on their way to the front door.

Enter wifinder. Wifinder is a simple Python script that Mattia wrote to constantly scan the network and alert him to new devices. Once his roommates are gone, Mattia can start the script. It will then run NMap to get a list of all devices on the network. It periodically runs NMap after this, comparing the new host list to the old one. If any new devices show up, it alerts with an audible beep and a rather hilarious output string. This type of scanning is nothing new to those in the network security field, but the use case is rather novel.

Autonomous Balloon Popping

Quadcopter drone for popping balloons

Taking on an autonomous vehicle challenge, [Randy] put together this drone which can locate and pop balloons. It’s been assembled for this year’s Sparkfun Autonomous Vehicle Competition, which will challenge entrants to locate and pop 99 luftbaloons red balloons without human intervention.

The main controller for this robot is the Pixhawk, which runs a modified version of the ArduCopter firmware. These modifications enable the Pixhawk to receive commands from an Odroid U3 computer module. The Odroid uses a webcam to take images, and then processes them using OpenCV. It tries to locate large red objects and fly towards them.

The vision processing and control code on the Odroid was developed using MAVProxy and Drone API. This allows for all the custom code to be developed using Python.

The Sparkfun AVC takes place tomorrow — June 21st in Boulder, Colorado. You can still register to spectate for free. We’re hoping [Randy]‘s drone is up to the task, and based on the video after the break, it should be able to complete this challenge.

[Read more...]

Follow

Get every new post delivered to your Inbox.

Join 94,593 other followers