Gas station without pumps

2016 March 31

PteroDAQ bug fixes

Filed under: Circuits course,Data acquisition — gasstationwithoutpumps @ 21:55
Tags: , , ,

I spent much of my lunch break today using a laptop borrowed from a student in the Applied Electronics course to debug a problem in PteroDAQ (one that I thought I had fixed on 2016 Feb 6 and again on 2016 March 30).

The problem was that on newer versions of Mac OS X, our original way for finding the serial ports and listing them in PteroDAQ (with good names) was failing, and the serial ports weren’t appearing. I fixed it for Mac 10.11.3, but that fix was breaking for most of the students in the course.  Yesterday, a student who is a friend of a student in the class suggested that the problem was just that I was only looking for USB 2 ports, and that the new USB stack used different data types for USB 3 ports.

Since I did not have any hardware with USB 3 ports (yes, I hang onto my computers for a while—the machine I’m typing this on is a MacBook Pro bought in mid-2009), I was unable to test the fix, so I released it to the class and asked them to test it.  A few students reported it working, but in the lab this morning, several students with Mac OS X computers were still unable to use PteroDAQ.  It was clearly a USB 2 vs. USB 3 problem still, since they were able to use PteroDAQ if they connected using my cable that has a USB 2 hub in it. One other student had gotten PteroDAQ to work for her by using a USB 2 hub that she had bought just for the purpose (probably a $7 or $8 one from Staples).

So instead of eating my lunch of raw vegetables, I sat with one of the laptops that was failing, uncommented some debug print statements that I had left in the code (I don’t delete debugging statements—I just comment them out, precisely for this sort of later bug fixing), and looked at the data structure for that Mac.  Apparently there are many different USB stacks for Mac OS X, with all sorts of differences. I put together ways of finding the appropriate name for the serial port using as many different methods as I could think of, based on either the child or the parent of the object in the chain that had the name I wanted.

After it was working on his computer, I handed it back to him and redid the bug fixes on my laptop and pushed them back to the bitbucket site, asking students to test the new code.  So far, everyone who has tested it has gotten it working (except for one student who seems to have a fried Teensy LC board—we were not able to get even the Arduino environment on my Mac to see his board). We don’t have any spare Teensy boards, so I suggested he order one from PJRC with the male headers already soldered on.  That makes two students (out of 48) who have had to order replacement boards (the other one soldered the male headers on the wrong side of the board, and delaminated some of the pads in attempting to correct the problem).  Perhaps next year we should order an extra 5% of Teensy LC boards, to cover for this sort of problem and have a local source for replacement boards.

I managed to finally finish my lunch after lab ended (around 5:30pm), but I’m glad to have gotten PteroDAQ working for (almost) everyone.  It is now 10pm, and time for me to prepare for tomorrow’s lecture.

2013 January 3

Plumbing karma

Filed under: Uncategorized — gasstationwithoutpumps @ 18:42
Tags: , , , , ,

A couple of days ago in Is coding for everyone?, I wrote

Atwood makes an analogy to everyone learning to do plumbing, as if that were a ridiculous idea.  Personally, I think that everyone should learn a little plumbing: enough to clear a toilet or sink trap, or replace a faucet washer, and to know when to call in a professional plumber.

So, naturally, yesterday the kitchen faucet started dripping for the first time in about 15 years.  I figured I knew how to change a faucet washer, and that it would just take a few minutes today. Ha!

The first problem was that the faucet had not been opened up in so long that the threads had seized, so it took two people to get it apart: one under the sink holding onto the valve body with channel-lock pliers, the other using a lot of leverage with an 8″ adjustable wrench.  Even that wasn’t enough, so I had to go down to the hardware store for some penetrating oil and let it soak in for a while.

The Grohe faucet cartridge from the kitchen faucet.

The Grohe faucet cartridge from the kitchen faucet.

Eventually, the threads eased up and the the faucet came apart.  But there was no washer to replace.  Instead what I had was a Grohe washerless faucet cartridge.  The Grohe cartridges are pretty good (which is why I hadn’t had to do anything with the kitchen faucet in so long), but when they fail, there’s not much you can do but replace the cartridge.

I tried smearing everything with vaseline and replacing the cartridge, just in case the problem was with the rubber gaskets, but the drip continued as before.

Unfortunately, the local hardware store does not carry Grohe parts (too upscale for Ace Hardware), so I had to bicycle 3.7 miles across town to Bay Plumbing, the closest place I could find that stocked the part.  I was pleased that their prices were essentially the same as I would have paid online (cheaper than some of the online places), and I could get the part immediately, rather than waiting 3–5 business days for delivery.

I was not so pleased that Bay Plumbing had no bike parking, so I told them about the Santa Cruz County Regional Transportation Commission bike parking program.   Unfortunately, I found out when I got home that SCCRTC no longer has the Bike Secure parking program.  That’s a shame, because there are still a lot of businesses that need bike parking!

In other news, the Arduino Leonardo that I had ordered arrived today. I ordered the Leonardo to test whether the data logger code worked with the Leonardo’s different way of handling the serial interface and different pin mapping.  But I goofed—despite my admonitions to the students in the circuits class to make sure that they got the right USB cable to go with the Arduino board they bought, I had not checked to see if we had a micro-B USB cable in the house.  We had so many USB cables sitting around, that I was sure one of them was a micro-B.  It turns out that they were all either B or mini-B, not micro B, so we were unable to test the data logger code on the Leonardo until I got a new cable.  (Actually, we had one micro-B cable, but it was a power-only cable for recharging my son’s bicycle headlight.)

I ordered a couple of the cables online earlier in the day, but they won’t come until next week, so after buying the faucet cartridge at Bay Plumbing, I stopped in next door at Santa Cruz Electronics to pick up a cable. Unlike Bay Plumbing, their prices were about three times what the online price would have been, so the only reason to buy there was to get the cable immediately. I’ll report on the status of the data logger software later, when I get an update from my son on the code he’s been adding today and when we’ve had a chance to test the Leonardo.

The Rubric Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 346 other followers

%d bloggers like this: