debian/postinst froze when restarting apache2

With my flugbuch2 and flightpred projects I had a problem for a while in the debian packages. Namely the installation froze after restarting apache2, while the installation seemed to have succeeded as the websites were accessible. When I reloaded apache instead of restarting, the installation ran through but the websites could not be found.

After endless googling, I found that the debian gallery packages used to suffer the same problem and that it was fixed. So I examined the source. What triggered the problem is an apache installation that’s not properly configured. Namely, if your apache complains that it cannot resolve the fully qualified hostname upon startup, then restarting apache inside my old postinst script would fail the postinst script. It has something to do with debconf waiting on some open file descriptors.

To make it short: move the db_stop to just before the apache restart and that solves the problem.

Receptiongreet basic functionality working

Today I did important progress in another toy project. It’s name is receptiongreet and you can find out more on SourceForge.

Basic functionality was running today for the first time! The app starts up, reads all the face images provided in a sub directory and trains them. It then observes the area with the web cam, looking for faces. If it detects a face, it compares it to the trained ones. And if that leads to a match, it outputs a personalized greeting to the pc speakers.

So, from here on it’s polishing.

Weatherstation problem

The plan was to build a mobile weather station with an arduino, two old windspeed sensors from the local paragliding school, a temperature sensor, a solar panel and an old cellphone.

As the first part I wanted to read the anemometers. I got them for a bargain from Touch&Go. Only I couldn’t figure out how to read them. It was no simple switch, so I suspected a hall effect sensor. From Flytec I got a schematic how to make the circuit. On the breadboard it worked immediately, but on the PCB, I got no readings. After a bit of measuring and thinking, I added two more resistors, to have the oscillating voltage pass the reference voltage.

Next, I started to calculate the wind direction from the two sensors for X and Y direction. Only then I realized that the windspeed alone is not enough. I would need a sign (+ or -) meaning if the wind blows from the front or back through the sensor. With only the speed I know only the angle but not which quadrant. And the quadrant is actually more important than the angle for me.

Ideas are welcome…

Arduino proto board

Handheld 2.4GHz Spectrum Analyzer

Finally I got my Spectrum Analyzer to work.

At first I was curious if I could use the display from an old Nokia cellphone I disassembled in conjunction with the Arduino. So I was looking for anything that could help me in doing so.

Then I stumbled across Miguel A. Vallejo’s Handheld 2.4GHz Spectrum Analyzer.

Putting it into a cellphone case would be too cool, but I don’t solder SMD, and I had an Arduino Nano lying around. So I ported the project to the Arduino platform. As the Arduino Nano operates at 5V and the display and the radio both at 3.3V, I had to use voltage dividers on the signal lines.

The CYWM6935 is kind of hard to get in Switzerland. Either you pay 3 or 4 times the regular price for the device or ridiculous shipping fees or both. I ended up ordering one from Farnell for CHF 48 including shipping.

The main problem I was chasing for a while resembled to the following: I made a voltage divider for the 3.3V to power the display and radio without considering the resistance of the circuits. So the driving voltage was too low for operation. Ha, out of training in designing electronics… In the end I’m using the 3.3V from the Arduino. I thought I read somewhere that it works only when powered from USB, but in my tests it works on battery as well.

Then I used the delay() function common in arduino instead of _delay_us() in Miguel’s code. Until I figured out the difference, It took about 30 seconds for a full sweep. Now it does about five sweeps a second.

Now, It works! I can see Bluetooth, Wifi and microwave oven radiation. The only drawback is that it doesnt always pick up very short transmissions like beakons.

Here is the source code for Arduino on github. Make sure to also look at the forks that improved my design.

It’s now also on the Arduino Playground.