• Conserve like every day is hot

    San Diego has been experiencing a major heat wave and our local utility, SDG&E, has asked people to conserve electricity so that the grid isn't taxed too much. If people sign up for "Reduce Your Use" rewards, SDG&E will pay people if they use a certain amount less than normal at peak times. This annoys me to no end as I conserve everyday and can't conserve any more. We use ceiling fans all the time, turn off lights in rooms we're not using, run appliances at non-peak times, installed high efficiency appliances and lights, etc.

    Our house has gotten so hot, that I had no choice but to turn on the air conditioning. When the house hit 88 degrees today, I set the temperature to 76, but the house only reached 83 before I turned it off. I work from home and stand under a fan all day; this keeps me reasonably comfortable so I don't run the air too much. When I've left the house, I close the downstairs windows and leave fans on for the dog. It has been so hot this week, that I had to turn on the air conditioning for the dog.

    So I definitely won't be getting credit for conserving during these really hot days because I already conserve! Yes, my reward is I pay less for electricity, but providing people extra incentives to conserve when they should conserve all the time anyway rubs me the wrong way.

  • Wireless Link Becoming Limiting Factor

    I've been experimenting with WiFi access points in the past few weeks and have tested the performance of the wireless link. The max speed of 802.11 n (most of my devices are n devices with a few ac and even a g device or two) is 300 Mbps or 450 Mbps depending on the number of antennas. That may sound fast, but actual performance is a lot less than that and in my testing, I was able to get about 225 Mbps using Iperf. Usually I can get between 50 and 150 Mbps. That should be plenty fast enough to max out many Internet connections; I currently pay for 50 Mbps down/5 Mbps up.

    At the end of November, Time Warner Cable should be rolling out its MAXX service here in San Diego and will have a maximum speed of 300 Mbps down/20 Mbps up. I'll be opting for 200/20 which will lower my bill each month at the same time quadrupling my Internet speed. So where does that put me? That would put my wireless link at about the same speed as my Internet service! I really didn't think this day would come where the airlink can't keep up with my Internet. Of course all these speeds are theoretical and performance will varying depending on conditions, but it now becomes even more important to tune my WiFi network in order to get the most performance out of it otherwise I could be paying for Internet speeds that I can't use.

  • Determination or insanity?

    For the last week I've been tracking down a bug in my current project. I've spent just about every spare minute including the weekend trying to figure out why my code works in a test app, but not the main app. I rewrote a huge piece of some communications code to no avail. I tried threading the communications, putting in proper locks, changed how I processed the bytes, etc. Basically when I was receiving large amounts of data from a Bluetooth device, some data was lost in the transmission and the checksum was incorrect; for small amounts of data, this problem didn't show up. At this moment in time, I believe I'm the only person in the world working with this combination of hardware and software which made using Stackoverflow useless.

    A co-worker of mine kept sending me ideas to try as I was completely out of ideas. His latest idea was to put the files from my test app into the main app to make sure the project settings weren't the problem. That didn't solve the problem, so I started ripping out pieces of the code and came across some code we had put in for a demo.

    All of the communications code that I was working on was using the External Accessory protocol over Bluetooth. The demo code we had in there was using Multipeer Connectivity which uses WiFi and Bluetooth to discover peers. Once I removed that code, all of my communication issues went away! Now I should file a Radar issue with Apple on issue, but I can't reproduce it outside of the particular hardware I'm using, networking library I've written, and a few other pieces so a bug report would be quite lacking.

    I must have spent 40+ hours on this one issue which has caused me to lose sleep and be a bit on edge all week. As failure was not an option and I had no place to turn, I had to solve this. I'm sure that others would have given up as 40+ hours is far too long to spend on a bug. For me, however, I actually spent 4 months full time chasing down a bug in a network router for a cellular base station; like this one, I did eventually discover the fix.

    Lesson learned...be careful of using different communication libraries in an app.

  • Troubleshooting OS X Server's Websites

    Today I was trying to install a program on my OS X Server and the software complained that something was listening on port 8080. I couldn't figure it out, so after a bit of searching I found a command that could get me closer:

    sudo lsof -iTCP -sTCP:LISTEN -P -n | grep 8080
    

    The output had in it:

    httpd     21950        _www    7u  IPv6 0xc086bca85e9b29f7      0t0  TCP *:8080 (LISTEN)
    httpd     65328        _www    7u  IPv6 0xc086bca85e9b29f7      0t0  TCP *:8080 (LISTEN)
    

    OK, so now I know that the _www user was running the process. Next up was to do:

    ps awuwx | grep _www
    

    Which gave me:

    _www            23128   0.0  0.0  2518828   1132   ??  S     8:41PM   0:00.00 /usr/sbin/httpd -D FOREGROUND -f /Library/Server/Web/Config/apache2/httpd_server_app.conf
    

    Ah, this tells me that OS X's Server App is running Apache which is fine, but I had Websites turned off in OS X Server!

    Screen Shot 2015 09 01 at 8 33 06 PM

    Hmmm, how do I disable Apache without hacking away on the http files? Well, I noticed on the Websites section I had an entry listening on port 8080. I removed the entry and presto, my server stopped listening on port 8080. Very odd because Websites is off, but OS X Server decided that if Websites is off, it should still listen and serve up a page that says "Websites are turned off."

    Screen Shot 2015 09 01 at 8 46 55 PM

    Besides Apple ending the text with a preposition, this is absolutely the wrong behavior in my opinion. I understand that certain services (CalDAV, WebDAV, etc.) run through Apache and OS X Server has to have it on to work, but Apple needs to have better messaging to indicate that it is listening on various ports and how to turn off the websites.

    Maybe I'm not the average OS X Server user in that I run various other services including Jenkins, but OS X Server still is not up to snuff; I'm not sure why I keep running it. OK, I do know why I keep running it; the caching server is excellent, VPN service is good, and file sharing is pretty easy to setup. Good thing I'm not afraid of the command line and can figure this out.