Mixed Content Blocking in Firefox 23

A website that I use at work all of the sudden started to render in a very broken way. Since we had had similar issues in the past I originally thought that it was a problem on the web application itself. However, after asking a co-worker I learned that the breakage is caused by a new feature that is enabled by default in Firefox 23: mixed content blocking. The feature is explained well at the following URL, but it basically boils down to “Firefox will block HTTP content referenced from a page served over HTTPS”.


The feature is a nice security feature. However, I think it has been terribly implemented in my opinion — first, you cannot create persistent exceptions (whitelist); second, you cannot create exceptions for entire domain (you have to create them on a page by page basis) so next time you open a page on the same site that also has mixed content then the mixed content will be blocked too. For the second issue, reading the comments in Mozilla bug 873349 is enlightening.

So, I can appreciate all the work the Mozilla developers have put into this feature but I have no option other than to disable it because it really puts a dent on my productivity. Let’s see if this feature is enhanced in a future Firefox release.

ZoneMinder Memory-Mapped Files

After tweaking the capture image size of some of the IP cameras connected to our ZoneMinder installation we started to get the following error in the ZoneMinder log right after launching a viewer to watch the camera’s video stream:

Got unexpected memory map file size 36865192, expected 9217192

Googling for this error took us to this blog post:


Which in turn took us to the ZoneMinder FAQ.

The recommendation is to increase the setting /proc/sys/kernel/shmmaxsize so ZoneMinder has enough memory to memory-map the files it needs during streaming.

However, upon checking our /proc/sys/kernel/shmmaxsize setting we found that it had pretty high setting (the recommended [in the ZoneMinder FAQ] 536870912, for 128 MB of maximum shared memory allocatable at a time), because we had run into the issue before and tried to fix it by following the recommendation in the ZoneMinder FAQ. In addition, the error message indicates that it expects a file with a size that is smaller than it currently has, so increasing the /proc/sys/kernel/shmmaxsize setting would not have fixed the problem.

It turns out that ZoneMinder had created the memory-mapped file for a specific capture image size:

$ ls -l /dev/shm/
 total 90016
 -rw------- 1 www-data www-data 36865192 Apr 9 08:24 zm.mmap.6

And when we changed the capture image size to a smaller resolution, the required size of the memory-map filed decreased. However, because ZoneMinder had not been restarted, the memory-mapped file had not been recreated, and it still had the size that ZoneMinder allocated for the original, higher resolution video capture.

Re-starting ZoneMinder caused the memory-mapped file to be recreated, now with the correct size for the new (smaller) capture image size:

$ ls -l /dev/shm/
 total 63016
 -rw------- 1 www-data www-data 9217192 Apr 9 08:47 zm cialis online ohne rezept.mmap.6

After this, ZoneMinder did not generate the error anymore.

Update 20130415:

We increased the capture image size of one of the ZoneMinder monitors and received again the “Got unexpected memory map file size …” message, this time indicating that the size of the file is smaller than expected. This makes sense and shows that the issue has nothing to do with the configured value in /proc/sys/kernel/shmmaxsize but with a memory-mapped filed created by ZoneMinder that is not recreated when the size of the image capture is changed. This should be considered a bug in ZoneMinder, in our opinion. We are running ZoneMinder 1.25.0.

Orbit 62035 Redux

The Orbit 62035 water valve was part of a yard watering system sold by Orbit around 2005 (it has been superseded by a newer generation of valves, and their corresponding timer/controller, although it is probably still possible to find the old valves on Amazon or eBay). This yard watering system, and its valves, were sold in the United States at big retailers like Lowes, The Home Depot, and BJs. We bought two of these systems, which includes a couple of 62035 water valves and their controller (timer) to water our front and back yards, and they have been working wonderfully for about six summers. The following picture shows a 62035 water valve and its controller (click image to enlarge). Note from the picture the 3.5 mm connector and that the controller can control up to four valves.

The controller is pretty good and user-friendly, and the three AA batteries it uses to run last a long time, but for a while we have wanted to be able to control the valves from a computer, or to have more intelligence on the controller itself, like taking into consideration whether it has rained, or that the forecast calls for rain soon, because it is not fun to go outside in the middle of the night and in the middle of a thunderstorm to override the system so it does not waste water the next morning. This sent us into a quest to figure out how to control these valves to then try to build a controller that suits our needs. (Note: Sure, without a doubt there is something that can be bought that will suit our needs, but we also have fun doing this ourselves, which is why we do it.)

What we found was that some people had already, for the most part, figured out the specifications of the valve, and even built drivers to operate them. Here are the relevant links that we found:

There was a lot of information, but some of it seemed contradictory or insufficient. For instance, here is what we were able to gather regarding the valves, their specifications, and how to make them work:

  • There are two latching solenoids, one for opening the valve and another for closing it.
  • The standard 3-pin 3.5mm stereo audio plug used by the valve uses a common contact to supply the voltage required for operation, and separate contacts for the open and close solenoids.
  • The resistance of each solenoid was different. One (the open solenoid) was around 4 ohms, but the other (the close solenoid) had a fairly low resistance of around 1 ohm.
  • The voltage required to operate the valves was not clear — some people thought it was 24 volts, some others claimed it was 17 volts, and then Orbit technical support claimed it was 13 volts.
  • The original Orbit controller works by charging a 2,200 uF capacitor and then discharging it through the solenoids. To charge the capacitor, and because the controller only uses three AA batteries, a voltage booster circuit is used. Our guess would be that the exact value of the capacitor was found after someone opened the original Orbit controller and took a peek at the components inside.
  • In one of the links above someone claims that to close the valve the controller first sends an open pulse followed by the big close pulse.
  • The length of the pulse needed to open or close the solenoids, per someone that apparently watched the operation on an oscilloscope, was around 22 milliseconds, although Orbit technical support provided a different figure.
  • Since the resistance of the close solenoid is so low, there is a 3.9 ohm current-limiting resistor. This was discovered after some people (Ray) opened an original Orbit controller and saw the 3.9 ohm resistors.
  • Orbit support, supposedly, provided the following specifications for these valves: 13V, 22ms pulse and 1 to 1.5 amp current max.

Armed with this information we tried to recreate the circuits that others had designed. We managed to make things to work on a breadboard, with some minor modifications of our own, but when we moved the design to SMT devices on a real PCB, things did not work.

So, to be able to figure out why our SMT design was not working we decided to hook up the original Orbit controller to an oscilloscope and collect some data. This is what we found after we connected an oscilloscope to the original Orbit controller and a 62035 water valve…

The following oscilloscope screenshot shows the original Orbit controller opening an Orbit 62035 valve (click image to enlarge):

The yellow line is the voltage applied to the solenoid that opens the valve and the blue line is the voltage at the solenoid that closes the valve. The graph shows a capacitor discharging through the solenoid (a resistance with a low value). The initial voltage is 18.1 volts. Not 24 volts as originally thought, and not the 13 volts that Orbit technical support claimed, though both voltages are close. The 0 volts across the close solenoid makes sense. Note also the length of the pulse — 22 milliseconds. The resistance we measured across the solenoid that opens the valve is 4.2 ohms, which means that at the beginning of the discharge there is a peak current of 18.1 volts/4.2 ohms = 4.2 Amps.

Finally, the following oscilloscope screenshot shows the original Orbit controller closing an Orbit 62035 valve (click image to enlarge):

A few things to note here: First, notice the different vertical scale — 0.5 volts/division. Next, note that we forgot to turn on the cursor so we can easily see the the exact voltage at the trigger point, but it is easy to see that the blue line (voltage across the close solenoid, as in the first screenshot) has a value at trigger point of 4 divisions x 0.5 volts/division = 2 volts. Since the resistance of the close solenoid is different (0.9 ohms), then at the beginning of the discharge the peak current is approximately 2 volts/0.9 ohms = 2.2 Amps. The length of the pulse is also about 20 milliseconds. This opens two possibilities with regards to the value to which the 2,200 uF capacitor is charged: 1. it is charged to a lower voltage than the voltage it is charged to in the case of opening the valve, or 2. it is charged to the same value (~ 18 volts) but there is a resistor in series with the solenoid to limit the current. (2) is what is actually happening based on Ray’s findings, i.e. there is a 3.9 ohm capacitor inside the original Orbit controller, but it would be interesting to experiment with (1) to see if in our design we could somehow (through software, assuming we can control the voltage produced by the voltage booster circuit) eliminate the current limiting resistor.

Another interesting thing to note is the negative voltage across the open solenoid — this seems to be the pulse that one of the people participating in this discussion mentioned, though we are not sure it is the same thing because in the discussion the gentleman says ‘When the Timer/Controller turns a valve OFF, it first operates the “Valve ON” coil, then recharges the capacitor and operates the “Valve OFF” coil’, and we did not see this exact behavior, as the above screenshot shows.

In a future post we will look at how we are planning to control the Orbit 62035 valve based on the information we have learned through the research done by others as well as our own observations.

Capacitor Discharge

I am working on a project that requires activating a latching solenoid cialis auf rezept. I am trying to accomplish this by discharging a capacitor through the solenoid. I have the “supposed” specifications of the voltage, current and pulse time needed for the solenoid to be activated so it helps to understand the behavior of the capacitor discharge. This is Electricity 101, which I studied many moons ago, and which I remember nothing about, unfortunately.

Fortunately, there are plenty of resources out there that explain what happens when a capacitor is discharged through a resistance and calculators that allow you to plug in some basic parameters and then present you with final voltage of the capacitor. Here are some references:

RC circuits: http://en.wikipedia.org/wiki/RC_circuit

Some online calculators that I found:




BJT Base Resistor Value

It is very common to use <a href="http://en.wikipedia cialis 20mg filmtabletten apotheke.org/wiki/Bipolar_junction_transistor”>bipolar junction transistors (BJT) to drive higher current loads. For example, BJTs is commonly used to drive LEDs, electric motors, relays, etc.

When using a BJT to drive a higher current load a resistor needs to be put between the signal driving the transistor and the transistor’s base. The purpose of this transistor is to limit current going into the base. The resistor’s value is important and should be calculated depending on the circuit’s operating parameters and the load the transistor is driving.

I have never been too serious about calculating base resistor values… until today when a circuit I was working on did not work. Upon closer inspection I realized that I had used in my breadboard prototype a different resistor value than the value of the resistor that I used in the PCB version of the same circuit — in the breadboard test I had used 100 ohms and in the PCB I soldered a 1 kohm resistor. As a consequence, my circuit was not able to drive well the solenoid that I was driving with this transistor. (The mistake, by the way, was caused by incorrect resistor value in the Eagle schematic, which got into my PCB circuit because I was following the schematic and not the breadboard prototype while assembling the PCB. Ggrrr. Note to self: make sure your schematic reflects your working prototype.)

Fortunately, calculating the correct base resistor value is easy, and there are online calculators out there that help with this task. You need to know:

  • Ic — the collector current (the current going through your load)
  • The hFE (gain) of the transistor. This varies depending on the collector current, and its value can be determined from the data sheet
  • The voltage drop across the base to emitter junction. This is called Vbe(sat) in the transistor’s data sheet
  • The voltage used to drive the transistor (at the base). This is typically the voltage supplied by a microcontroller output pin, and is usually very close to the supply voltage to the microcontroller (typical values: 5 V, 3.3V)

Here’s a link to a great online calculator:


The author of this calculator described the formula in the comments of that post as follows:

(Supply voltage – voltage drop) / (Collector current / Hfe)

Finding the parameters needed for this formula (which are very well explained at the top of the above calculator page) is a great way to learn how to read a transistor’s data sheet.

First post!

Since this is the first post in this blog I think it is appropriate to do a little introduction and write about what I am hoping this blog will be about, and what I will try to accomplish with it, so let’s start there…

First of all, I am hoping that having a personal blog will allow me to learn about blogging, which is something that I have never done before. A lot of people are <a href="http://monicalinares internetapotheke cialis.wordpress.com”>blogging these days, and it seems like blogging is a good way to let others know about ideas and projects you are working on.

Since I didn’t want to just go to one of the common blogging sites to create my blog, I decided to install WordPress on my own server and go through the configuration process from scratch. Fortunately, installing WordPress on Ubuntu is just a matter of running apt-get install wordpress. Configuration so far has been pretty easy so there really isn’t much to learn in this area, but I digress…

In terms of content, I honestly think that the only rule is that there are no rules in terms of content that is appropriate for this blog. I have ideas regarding what I would like to write about, but I reserve the right to write about something that is not part of my initial set of ideas.

Specifically, I would like to write about:

  • Adventures in home automation
  • Electronic projects I am working on, or would like to work on
  • Anything related to technology
  • Computers
  • Computer networks
  • Anything my curiosity takes me to…