October 30, 2012
300 dpi
September 30, 2012
Slave to PowerPoint
PowerPoint remotes are one the most ovepriced things on the planet. I could get a whole set of wireless keyboard and mouse for less than the price of a wireless remote with three buttons. Sure, I get an integrated laser pointer with the remote, but laser pointers are such cheap things they shouldn't bring up the price of hte remote.
I do quite a bit of presentation these days, and it's always a pain to hover over my notebook to advance to the next slide instead of being able to walk around and mesmerize the audience with my charisma and wit. Fortunately, a few weeks ago I discovered a Chinese-made wireless remote in a local shop that doesn't cost several arms and legs. Surely enough, the first one I got had stiff buttons with bad contacts that took several presses to register a single press. I took it back to the shop and got a second one. The second one still had stiff buttons (I realized then that's how it was designed), but at least each press would register correctly, so I was actually very happy with it. It's a really simple remote with just three buttons: PgUp, PgDn, and laser pointer. It doesn't even have a power switch, but the buttons are stiff enough to not be pressed accidentally. (Funnily enough, I discovered Amazon.com sells this particular remote
However, PowerPoint remotes are like crack, so after using the cheapo remote for a while, I finally ended up with the Real Thing (tm). The Logitech Wireless Presenter R400. There is also a more expensive "Professional" Presenter R800 with Green Laser Pointer and vibrating alarm. But I tested some green laser pointers and they only proved to be a distraction.
Officially, the Logitech R400 (and R800 as well) don't work with Mac OS X. The reason is quite simple really. The presenter is seen by newer Macs as a regular keyboard, but the buttons on the remote are hard wired to send out F5/ESC (start/stop presentation), "." (blank screen), PgUp, and PgDn; which are the standard keys for PowerPoint for Windows. The remotes are not magically designed to work only with PowerPoint for Windows, they just happen to be mapped that way because those key presses are the de-facto standard, which is why they work fine for Windows and even Linux. But OS X people prefer different keyboard shortcuts, so for Keynote or whatever other OS X apps that don't follow the Windows style standard, you can either change the default shortcut keys using Keyboard Shortcuts from System Preferences, or re-map the remote to send the correct key presses. This post and KeyRemap4MacBook (great name!) teaches you how accomplish this.
In fact, even though I do use Windows and PowerPoint, I still need to remap the F5/ESC key since it's such a pain in the butt to accidentally press the start/stop button during a presentation, and then accidentally press it again to start my presentation all over from the beginning! (They should've at least made it Shift-F5 to resume presentation from the current slide.) The solution is to use HID macros, which can detect key presses originating from different keyboards (or really HID devices) and re-map them accordingly. So I can re-map the F5/ESC on my R400 to send out something besides F5 and ESC, without messing with my actual F5 and ESC keys.
Oh, while writing this, I discovered that Epson finally has 64-bit USB display drivers for their projectors. They used to only have 32-bit drivers. Using a USB cable to connect to the projector is far better than connecting using a regular VGA cable.
August 6, 2012
Arduino RFID (part 3)
(... continued from part 2)
I'm famous!
I'm famous!
When I presented my new standalone RFID box to HR and management, their only reaction was... why is there no beep when a card was scanned?
Right. I know that audio feedback is one of the easiest and simpliest forms of physical feedback, and I should know that management wouldn't care about little technical details like being able to access logged data over http. Hmmf. Anyway, I managed to find a $1 piezo buffer for some hi-fi beeping.
Final BOM of my little RFID box:
Arduino Mega (clone)
Stronglink SL018 Mifare module
Ethernet Shield with POE
16x2 character LCD display
DS3232 RTC module
Generic piezo buzzer
Generic plastic project box
All parts were purchased locally from ETT (Arduino, LCD, DS3232) and ThaiEasyElec (SL018 and Ethernet Shield).
All parts were purchased locally from ETT (Arduino, LCD, DS3232) and ThaiEasyElec (SL018 and Ethernet Shield).
Standard Arduino libraries used to support the hardware include SPI.h, Wire.h, LiquidCrystal.h, Ethernet.h, EthernetUdp.h, EEPROM.h, and wdt.h. External libraries include SL018.h, Time.h, DS1307RTC.h, and SdFat.h. The Arduino Mega uses the Optiboot loader with working watchdog timer. Due to all the libraries and strings, the compiled sketch is around 45K, so it will not work with the smaller Arduinos.
I'm still not sure if making my own RFID box is a good idea. However, the completed RFID box has far more features than any commercial RFID readers available locally (not counting eye candy like color touchscreen LCD display and talking clock), and costs a fraction of the price even though I'm putting the full Arduino board inside. I'm just not sure about the longevity of the individual parts or my soldering skills. But then again, the old RFID reader we had that died with the flood had frequent failures and the clock was never accurate. The 125 KHz prox cards used with that system was prone to failure too. Plus, I've opened up the reader and it was a rat's nest of wires.
I've been really busy lately with family matters. But I will post the source code of my RFID box in the next and final installment of this series.
(... continued in part 4.)
I've been really busy lately with family matters. But I will post the source code of my RFID box in the next and final installment of this series.
(... continued in part 4.)
July 28, 2012
SysAdminDay 2012
I imagine most sysadmins are lazy like myself, that's why we make great sysadmins: we make scripts and automate things to make life easier for ourselves. We also like tools, especially multi-tools. Three years ago I bought myself a Leatherman Skeletool CX that I still use almost daily. This year I bought myself a Sea to Summit spork.
Unfortunately, I didn't take the rest of the day of cause I was still stuck in non-stop meetings.
July 1, 2012
Saving lives
My mom passed away from metastatic breast cancer to the lungs two weeks ago. Near the end, she had a lot of difficulty breathing, and I was at the hospital day and night to take care of her for the last few weeks.
When she was awake, I would talk with her or help her eat or wash. While she rested, I would roam the hospital and chat with the nurses. After a few days, the nurses finally noticed that no matter what shift they're in, I was always awake and around.
"How is it that every time I'm taking a shift, you seem to be awake?"
"I'm an IT guy, and I fix computers. I'm always on a 24-hour standby, and before I became a manager, I used to work around the clock all the time. My job is actually a lot like yours."
"Eh? We save human lives, you fix machines."
"We save machines and data. Machines can be repaired or bought new, data are often irrecoverably lost."
The nurses still weren't convinced, "Yeah, but when we lose a patient, we lose a human life."
"True, but think about this. Dying is a natural process of life. When you lose a patient, the family grieves for the dead, they might even blame you or sue you for the loss. But as time passes, they accept the loss, recover, and then go on living. It is a fact that no one lives forever.
"For us computer guys, losing data is permanent. A manager accidentally deleted a file that he took days to make on the night before his big presentation to his bosses, and he came to us to bring back the file. How do you bring back the dead? He then went to his bosses to blame us for the loss. And each time he encounters a new problem, he remembers all his past problems, and the past never goes away. Essentially, my users never recover from their losses, and every loss is cumulative.
"My job is thankless like yours. Do you get thanked for lives saved? Me neither. No thanks, and always blames."
"..."
"Thank you for taking care of my mom. You guys are the best."
When she was awake, I would talk with her or help her eat or wash. While she rested, I would roam the hospital and chat with the nurses. After a few days, the nurses finally noticed that no matter what shift they're in, I was always awake and around.
"How is it that every time I'm taking a shift, you seem to be awake?"
"I'm an IT guy, and I fix computers. I'm always on a 24-hour standby, and before I became a manager, I used to work around the clock all the time. My job is actually a lot like yours."
"Eh? We save human lives, you fix machines."
"We save machines and data. Machines can be repaired or bought new, data are often irrecoverably lost."
The nurses still weren't convinced, "Yeah, but when we lose a patient, we lose a human life."
"True, but think about this. Dying is a natural process of life. When you lose a patient, the family grieves for the dead, they might even blame you or sue you for the loss. But as time passes, they accept the loss, recover, and then go on living. It is a fact that no one lives forever.
"For us computer guys, losing data is permanent. A manager accidentally deleted a file that he took days to make on the night before his big presentation to his bosses, and he came to us to bring back the file. How do you bring back the dead? He then went to his bosses to blame us for the loss. And each time he encounters a new problem, he remembers all his past problems, and the past never goes away. Essentially, my users never recover from their losses, and every loss is cumulative.
"My job is thankless like yours. Do you get thanked for lives saved? Me neither. No thanks, and always blames."
"..."
"Thank you for taking care of my mom. You guys are the best."
April 1, 2012
Arduino RFID (part 2)
(... continued from part 1)
Just because the HR people loved something doesn't mean the management loved it. When the HR guys presented the Arduino RFID scanner connected to a PC with huge LCD TV's that displays employee photos to the management, the management people immediately asked, who watches the photos, and who watches the watchers?
Okay... back to the drawing board. I had previously hooked up my 16x2 character LCD display as a backup display in case the TV's blow up, I decided to take the idea further. I also decided since we're no longer going to use large LCD TV's, there's no point in hooking up a computer any more, and perhaps I could make the whole thing self-contained...
More importantly, being self-contained means I need connectivity directly from the Arduino, so I added an Ethernet Shield to the setup. The Ethernet Shield has a MicroSD slot that could be used to log data. In order to more clearly show whose card was scanned, I decided to not use the Mifare card's UID, but instead will write the employee name into the card. This way, the employee can see her name shown on the LCD display when she clocks in or out.
Of course, going standalone also means I need RTC and/or NTP. Using NTP seemed to be problematic at first (appears to be fixed in Arduino 1.0.1), and I also wanted my RFID box to be completely standalone, so I added a DS3232 module. The DS3232 would normally keep very accurate time, but a nightly housekeeping function would sync it with NTP if the NTP time is sufficiently similar to the RTC time. The housekeeping function also renews the DHCP lease.
When a card is successfully scanned, the current date and time, the card's UID, and the employee data stored on the card are saved to the MicroSD card. The employee data is then shown on the LCD display. The data is logged on the MicroSD card as plain text files, grouped into year directories and each day is separated into a single file. e.g. entries logged on April 1, 2012 would be saved in /2012/20120401.csv
Entries can be read off the MicroSD card by opening a web browser and going to http://[ip]/20120401 and the CSV file would be displayed in the web browser. I used the cheapest 4GB MicroSD card I could find, and by my calculation, it has enough storage for around 200 years or the Rapture, whichever comes first.
Special admin cards can be created by writing a special employee code to the card. When this card is scanned, pre-determined actions can be performed. In my case, I use the special cards to switch the RFID box from clock-in to clock-out and vice versa. Clock-in/out status are also shown on the LCD display in Thai by using custom characters, and the status is also stored into EEPROM. Because the 16x2 LCD has limited space, I chose to show the day of the week, the current time, and clock-in/out status on the top row. When a card is scanned, the employee name is shown on the bottom row.
After implementing the admin card function, I also added the clock-in/out status as well as the MAC address of the RFID box into the log. This is because we will actually have more than one reader, and it's necessary to differentiate whether the employee is clocking in or out, and at which reader.
In order to write employee data to the Mifare cards, I added some code to make the RFID box as a writer too. I haven't written a nice custom interface for Windows yet, so I'm only using a terminal program. Sending 'a' to the Arduino puts the RFID box into admin mode which allows initializing new Mifare cards and writing, reading, or deleting employee data from the Mifare cards.
(Continued in part 3...)
Just because the HR people loved something doesn't mean the management loved it. When the HR guys presented the Arduino RFID scanner connected to a PC with huge LCD TV's that displays employee photos to the management, the management people immediately asked, who watches the photos, and who watches the watchers?
Okay... back to the drawing board. I had previously hooked up my 16x2 character LCD display as a backup display in case the TV's blow up, I decided to take the idea further. I also decided since we're no longer going to use large LCD TV's, there's no point in hooking up a computer any more, and perhaps I could make the whole thing self-contained...
More importantly, being self-contained means I need connectivity directly from the Arduino, so I added an Ethernet Shield to the setup. The Ethernet Shield has a MicroSD slot that could be used to log data. In order to more clearly show whose card was scanned, I decided to not use the Mifare card's UID, but instead will write the employee name into the card. This way, the employee can see her name shown on the LCD display when she clocks in or out.
Of course, going standalone also means I need RTC and/or NTP. Using NTP seemed to be problematic at first (appears to be fixed in Arduino 1.0.1), and I also wanted my RFID box to be completely standalone, so I added a DS3232 module. The DS3232 would normally keep very accurate time, but a nightly housekeeping function would sync it with NTP if the NTP time is sufficiently similar to the RTC time. The housekeeping function also renews the DHCP lease.
When a card is successfully scanned, the current date and time, the card's UID, and the employee data stored on the card are saved to the MicroSD card. The employee data is then shown on the LCD display. The data is logged on the MicroSD card as plain text files, grouped into year directories and each day is separated into a single file. e.g. entries logged on April 1, 2012 would be saved in /2012/20120401.csv
Entries can be read off the MicroSD card by opening a web browser and going to http://[ip]/20120401 and the CSV file would be displayed in the web browser. I used the cheapest 4GB MicroSD card I could find, and by my calculation, it has enough storage for around 200 years or the Rapture, whichever comes first.
Special admin cards can be created by writing a special employee code to the card. When this card is scanned, pre-determined actions can be performed. In my case, I use the special cards to switch the RFID box from clock-in to clock-out and vice versa. Clock-in/out status are also shown on the LCD display in Thai by using custom characters, and the status is also stored into EEPROM. Because the 16x2 LCD has limited space, I chose to show the day of the week, the current time, and clock-in/out status on the top row. When a card is scanned, the employee name is shown on the bottom row.
After implementing the admin card function, I also added the clock-in/out status as well as the MAC address of the RFID box into the log. This is because we will actually have more than one reader, and it's necessary to differentiate whether the employee is clocking in or out, and at which reader.
In order to write employee data to the Mifare cards, I added some code to make the RFID box as a writer too. I haven't written a nice custom interface for Windows yet, so I'm only using a terminal program. Sending 'a' to the Arduino puts the RFID box into admin mode which allows initializing new Mifare cards and writing, reading, or deleting employee data from the Mifare cards.
(Continued in part 3...)
Subscribe to:
Posts (Atom)





