Mosh is a pretty good tool, almost indispensable when working in places with crappy internet. While it is designed to help with situations like “LTE on the beach,” it actually works very well in places where internet connectivity is genuinely bad: 1500msec RT, latency, 30% packet loss, and frequent drops in connectivity that last seconds to hours, otherwise known as most of the world. On a good day I lose an SSH connection randomly about every 3-6 hours but I’ve only ever lost a Mosh session when my system went down.
It does a lot of things, but two are key for my use: it syncs user input in the background while local echoing what you type so you can finish your command (and correct a typo) without waiting 1500msec for the remote echo to update; and it creates persistent connections that survive drop off of almost any type except killing the terminal application on one end or the other (anything between can die and when it recovers, you catch up). This means compiles finish and you actually get the output warnings…
…some of them. Because Mosh’s one giant, glaring, painful, almost debilitating weakness is that it doesn’t support scrollback. So compared to tmux or something else that you can reconnect to after your SSH session drops, you really lose screen content, which is a PITA when ls-ing a directory. I mean, it isn’t that much of an efficiency gain to have to type “ls | less” instead of just “ls” every time you want to see a directory.
I found a solution that works for me. I also use Tmux with Mosh because Tmux will survive a dead client and working with Windows client reboots are a fact of life (I know, sad, but there are some tools I still need on windows, hopefully not for much longer).
Tmux has a facility for creating a local log file, which I then “tail -f” using a separate SSH window. If the SSH client disconnects, no loss, I can pick up the log anytime. It is just mirroring everything that the mosh terminal is doing and the scroll bar scroll back works fine. And it is a raw text file, so you can pipe the output through grep to limit what’s displayed to something of interest and review the log asynchronously as, say, a build is progressing.
Although there are some nice advantages to this, when/if Mosh supports scrollback, it’ll be far more convenient having it in the same window, but for now this is the easiest solution I could come up with.
# portmaster sysutils/tmux # portmaster net/mosh # ee ~/.tmux.conf -> bind-key H pipe-pane -o "exec cat >>$HOME/'#W-tmux.log'" \; display-message 'Logging enabled to $HOME/#W-tmux.log' -> set -g history-limit 30000 Start a Mosh session (for example with Mobaxterm on windows) # tmux # [CTRL]-b H start SSH session (Mobaxterm or Putty on windows) # tail -f csh-tmux.log ("csh" will be the name of the mosh window - so really "(MoshWindowName)-tmux.log"
You can tmux the ssh session too and still have scrollback and then just reconnect into the same tail command, which preserves the whole scrollback. If you’re on a connection like I’m on, your scrollback logfile will drop off a couple of times a day, but you won’t lose your Mosh session, and it’ll be waiting for you when you’re reminded that you need to see those security warnings from the compile that just scrolled off the Mosh screen forever.
A couple of years back a random sprout appeared in the yard. It looked like a volunteer avocado and grew bizarrely fast. After a few years, it is about 15′ tall and this year it fruited for the first time. It really is an avocado tree.
My kitchen has had halogen lighting for 20 years, from back when it was a slightly more efficient choice than incandescent lighting and had a pleasing, cooler (bluer, meaning the filament runs hotter) color temperature.
Progress has moved on and while fluorescent lights still have a lead in maximum luminous efficacy (lm/w), for example the GE Ecolux Watt-Miser puts out 111 lm/W, they’re less versatile than LEDs and installation is a hassle while low voltage LEDs are easy to install and look cool.
[wp_charts title=”Luminous efficacy of lighting types” type=”bar” align=”alignleft” margin=”5px 20px” datasets=”17.5,24,111,101.9,200″ labels=”incandescent,halogen,fluorescent,LED,LP Sodium” width=100% scaleFontColor=#FFF]
The goal of this project was to add dimmable, pleasing light to the kitchen that I found aesthetically interesting. I wanted a decent color rendering index (CRI), ease of installation, and at reasonable cost. I’ve always liked the look of cable lighting and the flexibility of the individual, adjustable luminaires.
I couldn’t find much information on how variable output LEDs work and what can be used to drive them. I have a pretty good collection of high quality power supplies, which I wanted to take advantage of, but wasn’t sure if I’d be able to effectively dim the bulbs from the documentation I found. So I did some tests.
I bought a few different 12V, Dimmable LEDs and set up a test configuration to verify operation and output with variable voltage and variable current. The one bit of data I had was that using standard commercial controllers, the lowest output is typically stated to be around 70% of maximum output: that is the dimming range is pretty limited with standard (PWM/Transformer) controllers. The results I found were much more encouraging, but revealed some quirks.
I used a laboratory-grade HP power supply with voltage and current control to drive the LEDs, decent multimeters to measure voltage and current, and an inexpensive luminance meter to measure LED output.
I measured 3 different LEDs I selected based on price and expected compatibility with the aesthetics of the project and because they looked like they’d have different internal drivers and covered a range of rated wattage.
These bulbs have internal LED controllers that do some sort of current regulation for the diodes that results in a weird voltage/current/output response. Each bulb has a different turn-on voltage, then responds fairly predictably to increasing input voltage with increasing output, reaches the controller stabilizing voltage and runs very inefficiently until voltage gets over the rated voltage and then becomes increasingly efficient until, presumably, at some point the controller burns out. I find that the bulbs all run more efficiently at 14V than at the rated 12V.
As a side note, to perform the data analysis, I used the excellent
xongrid plugin for excel to perform Kriging interpolation (AKA Gaussian process regression) to fit the data sets to the graphing function’s capabilities. The graphs are generated with WP-Charts and the table with TablePress.
Watts v. Volts
This chart shows the wattage consumed by each of the three LEDs as a function of input voltage, clearly demonstrating both that the power consumption function is non-linear and that power consumption in watts improves when driven over the rated 12V. Watts are calculated as the product of the measured Volts * Amps. Because of the current inversion that happens as the controllers come fully on-line, these LEDs can’t be properly controlled near full brightness with a current-controlled power supply, though it works well to provide continuous and fairly linear dimming at low outputs, once the voltage/current function changes slope, the current limiting controller in the power supply freaks out.
[wp_charts title=”wattvolts” type=”line” align=”alignright” margin=”5px 20px” datasets=”0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.015,0.017,0.024,0.035,0.048,0.108,0.279,0.594,1.040,1.603,2.292,3.100,4.069,4.865,4.801,4.559,4.511,4.494,4.478,4.457,4.438,4.415,4.391,4.366,4.348,4.330,4.311,4.291,4.271,4.250,4.228,4.206,4.186,4.166,4.145,4.124,4.104,4.083,4.063,4.041,4.017,3.993,3.971,3.955 next 0.051,0.086,0.146,0.293,0.669,1.209,1.879,2.738,3.466,4.259,5.530,6.700,6.995,6.972,6.524,6.000,5.803,5.673,5.560,5.457,5.379,5.307,5.239,5.176,5.127,5.082,5.039,5.000,4.970,4.944,4.919,4.896,4.878,4.862,4.846,4.831,4.817,4.802,4.788,4.772,4.752,4.731,4.710,4.689,4.657,4.631,4.621,4.654,4.845,5.066,5.274,5.419,5.293,5.066,4.817,4.589 next 0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.314,2.205,4.725,4.747,4.928,5.124,5.346,5.550,5.726,5.883,6.035,6.169,6.273,6.343,6.332,6.283,6.217,6.145,6.091,6.040,5.988,5.937,5.898,5.864,5.830,5.798,5.772,5.746,5.721,5.695,5.668,5.642,5.615,5.590,5.571,5.554,5.537,5.521,5.502,5.484,5.466,5.448,5.428,5.410,5.394,5.383″ labels=”2.25,,,3.00,,,,4.00,,,,5.00,,,,6.00,,,,7.00,,,,8.00,,,,9.00,,,,10.00,,,,11.00,,,,12.00,,,,13.00,,,,14.00,,,,15.00,,,,16.00″ width=100% scaleFontColor=#FFF fillopacity=”0.0″ colors=”#FF3300,#66FF33,#3399FF”]
4W LED 5W LED 7.5W LED
Lux v. Volts
This chart shows the lux output by each of the three LEDs as a function of input voltage, revealing the effect of the internal LED driver coming on line and regulating output, which complicates controlling brightness but protects the LEDs. The 5W LEDs have a fairly gentle response slope and start a very low voltage (2V) so are a good choice for a linear power supply. The 4W LEDs don’t begin to light up until just over 6V, and so are a good match for low-cost switch mode supplies that don’t go to zero.
[wp_charts title=”luxvolts” type=”line” align=”alignright” margin=”5px 20px” datasets=”0,0,0,0,0,0,0,0,0,0,0,0,2,4,15,34,57,172,484,996,1632,2360,3110,3870,4629,5220,5156,4956,4925,4920,4908,4890,4877,4861,4838,4813,4795,4778,4760,4741,4722,4703,4682,4662,4643,4623,4604,4583,4559,4534,4509,4483,4455,4426,4400,4380 next 7,42,103,255,663,1180,1731,2380,2859,3311,3848,4340,4599,4762,4789,4770,4778,4781,4778,4770,4772,4773,4772,4770,4771,4772,4771,4770,4771,4772,4771,4770,4768,4766,4763,4760,4762,4764,4764,4760,4743,4721,4699,4681,4676,4676,4678,4680,4680,4680,4680,4680,4679,4677,4677,4680 next 0,0,0,0,0,0,0,0,0,0,376,2490,4810,4976,5200,5421,5687,5940,6168,6372,6546,6700,6848,6969,7017,7030,7025,7011,7008,7006,7000,6991,6987,6982,6977,6970,6966,6961,6956,6950,6948,6946,6943,6940,6936,6931,6925,6920,6917,6915,6913,6910,6904,6899,6896,6898″ labels=”2.25,,,3.00,,,,4.00,,,,5.00,,,,6.00,,,,7.00,,,,8.00,,,,9.00,,,,10.00,,,,11.00,,,,12.00,,,,13.00,,,,14.00,,,,15.00,,,,16.00″ width=100% scaleFontColor=#FFF fillopacity=”0.0″ colors=”#FF3300,#66FF33,#3399FF”]
4W LED 5W LED 7.5W LED
Lux/W v. Volts
This chart shows the luminous efficiency (Lux/Watt, Lumen measurement is quite complicated) by each of the three LEDs as a function of input voltage, showing that overdriving the LEDs past the rated 12V can significantly improve efficiency. There’s some risk it will overheat the controller at some point and result in failure. I’ll update this post if my system starts to fry LEDs, but my guess is that 14V, which cuts the power load by 20% over 12V operation with the 7.5W lamps I selected, will not significantly impact operational lifetime.
[wp_charts title=”effvolts” type=”line” align=”alignright” margin=”5px 20px” datasets=”0,0,0,0,0,0,0,0,0,0,0,0,20,230,621,977,1200,1594,1732,1678,1570,1472,1357,1248,1151,1073,1072,1087,1092,1095,1096,1097,1099,1101,1102,1102,1103,1104,1104,1105,1106,1107,1108,1108,1109,1110,1111,1111,1111,1111,1110,1109,1108,1107,1107,1108 next 133,487,708,868,991,976,921,869,825,777,707,648,654,683,738,795,822,842,859,874,888,900,911,922,931,939,947,954,960,965,970,974,978,980,983,985,989,992,995,998,998,998,998,998,1004,1009,1011,1006,970,929,891,864,887,929,976,1020 next 0,0,0,0,0,0,0,0,0,0,1196,1129,1018,1048,1055,1058,1064,1070,1077,1083,1085,1086,1092,1099,1108,1119,1130,1141,1151,1160,1169,1178,1185,1191,1197,1202,1207,1211,1216,1220,1226,1231,1237,1242,1245,1248,1251,1254,1257,1261,1265,1268,1272,1275,1278,1281″ labels=”2.25,,,3.00,,,,4.00,,,,5.00,,,,6.00,,,,7.00,,,,8.00,,,,9.00,,,,10.00,,,,11.00,,,,12.00,,,,13.00,,,,14.00,,,,15.00,,,,16.00″ width=100% scaleFontColor=#FFF fillopacity=”0.0″ colors=”#FF3300,#66FF33,#3399FF”]
4W LED 5W LED 7.5W LED
Total System Efficiency
The emitter efficiency is relatively objective, but the total system efficiency includes the power supply. I used a Daiwa SS-330W switching power supply I happened to have in stock to drive the system, which cost less than a dimmable transformer and matching controller, and should be significantly higher quality. The Daiwa doesn’t seem to be easily available any more, but something like this would work well for up to 5A total load and something like this would handle as many as 40 7.5W LEDs on a single control, though the minimum 9V output has to be matched to LEDs to get satisfactory dimming. It is important not to oversize the power supply too much as switch mode supplies are only really efficient as you get close to their rated output. An oversized switchmode power supply can be extremely inefficient.
With the Daiwa, driving 13 7.5W LEDs, I measured 8.46A at 11.94V output or 101 Watts to brightly illuminate the entire kitchen, and providing far more light than 400W of total halogen lights. I measured the input into the power supply at 0.940A at 121.3V or 114 Watts. That means the power supply is 88.6% efficient at 12V, which is more or less as expected for a variable output supply.
Increasing the output voltage to 14.63 Volts lowered the output current to 5.35A or 78 Watts without lowering the brightness at the installation; I measured at 168 lux at both 12.0V at 14.6V. The input current at 14.63V dropped to 0.755A or 91.6 Watts, meaning the power supply is slightly less efficient at lower output currents (as is usually the case).
- Overdriving the 12V rated LEDs to 14.63V improves plug efficiency by 20%.
At the low end, the SS-330W’s minimum output is 4.88V, which yields 12 lux at the counter or a 14x dimming ratio to 7% of maximum illumination, a far better range than is reported for standard dimmer/transformer combinations.
- 7.5W LED modules from JackyLED
- Daiwa power supply (alternate version)
- 16 gauge speaker cable
- MR-16 cable lamp mounts
- Digital light meter
(MS Excel file, you will need the
xongrid plugin to update the data as rendered in the graphs)