All | Aquariums | Arduino | Btrfs | Cars | Cats | Clubbing | Computers | Dining | Diving | Electronics | Exercising | Festivals | Flying | Halloween | Hiking | Linux | Linuxha | Monuments | Museums | Outings | Public | Rc | Sciencemuseums | Solar | Tfsf | Trips



Table of Content for computers:

More pages: December 2023 August 2021 May 2020 February 2016 July 2014 December 2013 November 2013 January 2013 August 2011 July 2011 August 2010 June 2010 May 2010 March 2010 February 2010 December 2009 November 2009 March 2009





2023/12/30 National Videogame Museum in Sheffield, UK
π 2023-12-30 01:01 in Computers, Sciencemuseums, Uk
While briefly in Sheffield, I had a little bit of time before going back to Manchester, and the most enticing place to visit was the National Videogame Museum.
Once there, I only had about 1H as it closes betweeen 13:00 and 14:00. I didn't have a much time to play, but enough time to look around and enjoy the collection:






The various historical collections were fairly good:












Hopefully I'll be back in Sheffield one day, and will have time to play more next time.


2021/08/25 Bletchley Park & National Museum of Computing
π 2021-08-25 01:01 in Computers, England2021, Sciencemuseums
I did not know anything about Bletchley Park or National Museum of Computing just 1H north of London until I was in London and had dinner with my friend and EFREI schoolmate, Jerome Abela, who told me about it. It is purposely 1H outside of London just next to a train station, because it was a very secret encrypted message breaking and decoding base during WWII and in case London ever were to be bombed, this place that didn't look like anything, would be spared.

I didn't quite know that Bletchley Park is actually separate from the National Museum of Computing (they are adjacent, but separated by a fence, needing an annoying 10-15mn walk all the way around), and Bletchey Park actually opens earlier, so it's probably best to visit first (also check the National Museum of Computing's website for which dsays they have guided tours and guides showing the hardware (well worth it).

I'll start with the National Museum of Computing as it was the most exciting to me with its fully functional rebuild bombe and colossus decryption machines for Enigma and Lorenz (the much more secure encryption system German Command used):



One big mistake the germans did was to send a weather report starting with the same german word (known plaintext) every morning. This allowed building a computer (bombe) that tried all rotor combinations to turn the crypted message into the known platintext:



The even more impressive machine (by a lot) was the aptly named "Colossus" which was build from scratch from a reverse engineered design (that part is so impressive), to decrypt the much more secure Lorenz encryption:








the computer reads the encrypted message from this paper tape (5 bit ASCII)
the computer reads the encrypted message from this paper tape (5 bit ASCII)


this machine did the decryption once the other machine had output the decryption parameters
this machine did the decryption once the other machine had output the decryption parameters


How lorenz was reverse engineered and cracked is complicated and super impressive, but basically all came down to the almost same message being sent twice with the same key which allowed for a known plaintext attack:


This video shows the different machines in action Bombe rebuild (to break enigma), Colossus rebuild (to break Lorenz), plus the oldest still working half-mechanical computer (Harwell Dekatron):

And the museum had lot of other computers, a collection that is close to being as good as the one at the computer history museum in Mountain View, CA:


they have a whole collection of tubes (pre-transistors) to replace the ones that break on their machines
they have a whole collection of tubes (pre-transistors) to replace the ones that break on their machines





core memory
core memory





impressive they had so many of those machines, still working
impressive they had so many of those machines, still working




I had one of those
I had one of those

this too
this too

and this too (Asmtrad CPC464+memory upgrade+floppy)
and this too (Asmtrad CPC464+memory upgrade+floppy)

didn't have this one at home, but worked with them at SGI
didn't have this one at home, but worked with them at SGI

those I never had, but I wish I did. Archimedes was awesome and way ahead of its time with Arm RISC CPUs
those I never had, but I wish I did. Archimedes was awesome and way ahead of its time with Arm RISC CPUs

The Harwell Dekatron was also a very cool (and still working) computer I had never seen:



Watch it in action:

Bletchley Park had different buildings each with their story and what they were used for:





Lots of info on the machines, an earlier crack of older enigma machines was to use EINS for plaintext attacks:








They had many displays on the brilliant mathematicians that broke the codes and built the machines. Alan Turing was one of them, but they were multiple others:


Despite some inefficiencies in having to go back and forth between the 2 museums to join a timed tour at Bletchley (which actually is skipable if you are short on time), I spent the entire day there (open to close) and it was very well worth it.

2020/05/04 Hacking Power Supplies and Battery Pack To Get Around ThinkPad P73 Broken Power Supply Design
π 2020-05-04 01:01 in Computers, Electronics, Linux
While I wrote this for my Lenovo Thinkpad P73, this is likely equivally relevant to P53, P72, and P52.

Thinkpad P73 vs P70, not a win all around: only one 2.5" drive instead of 2, and a badly designed power system

So, when lenovo came out with the Thinkpad P70, I wasn't very happy because if you had a 90W power supply, it refused to charge from it, at any rate whatsoever. I was not impressed, but eh, at least it would still power the laptop so that its batteries didn't go flat while plugged in.
Well, leave it to lenovo engineers to make things worse the for the P73. The minimum power supply was raised from 135W (170W recommended) to 170W (230W recommended) which is understandable, but lenovo decided to ensure that the laptop will not take any power from any power supply that does not identify itself as 170W or more. This means that even ifit only needs 40W to sustain itself without digging into the batteries, it will completely refuse to use a 90W or even 135W power supply for anything at all, and kill the battery instead. Lenovo, you just plain suck, there is no excuse for this.

P70 vs P73, they look pretty similar
P70 vs P73, they look pretty similar

*Update*: it seems if that if you get a cheaper nvidia chip with the P73, it is then configured to accept 135W power supplies as the minimum required. That said, it will still refuse to work with any regular 90W power supply or external battery back, unless you force it with the center pin resistor swap.

While I have no plans to use windows on that machine, I thought I'd just try it out to see how it does on power. This is where I was impressed, windows can idle at less than 10W for more than 11H runtime, while I'm lucky if I can get linux at 15W. This is definitely a place where linux should do better, of course, it's not as if Lenovo put any work into making linux more efficient on their hardware either:


*Update* : with tlp and using the nouveau driver just enough to turn off the nvidia chip, I'm now able to tune the laptop down to 10W, almost matching windows.
See tlp issue 494 for details on how to setup tlp to run in low power mode when power is plugged in.

Another disappointment is that the P73 is mostly the same size and weight than the P70, but it has less room for storage. It has a bunch of empty spaces that aren't used for anything, and it can't use two 2.5" SATA drives anymore, like the P70 could. Worse, the now single 2.5" slot uses a lenovo only ribbon cable that does not ship with the laptop and basically means you cannot even add a 2.5" drive without that special ribbon cable, which isn't in stock yet. Well done... Ah yes, the battery is also not hot swappable, even if it is replaceable (unlike a Mac laptop where everything is sealed shut).


this shows the unobtanium lenovo cable for the now only single drive that fits, along the unused space
this shows the unobtanium lenovo cable for the now only single drive that fits, along the unused space

Ok, stop complaining, just buy a bunch of 170w or 230W power supplies and move on with your life

Well, yes and no:
  • I literally have 10 power supplies between home and work, not really looking at replacing all 10. Lenovo wants $137 per power supply by the way, even if they are $85 from other sellers
  • those 170W/230W power supplies are huge. They also weigh as much as some small notebooks (!)
  • I have 12V to 20V car adapters, those won't work anymore
  • I have external battery packs for extended runtime, and I haven't found a single one that can deliver the amps a P73 tries to needlessly require
  • Tricking the P70 and P73 into accepting a power supply it wouldn't otherwise use

    Lenovo uses the a center pin resistor to know how much power they can draw from the power supply, see: http://www.thinkwiki.org/wiki/Power_Connector .

    For the P70, I built this power supply adapter with a resistor bridge to tell the laptop how big it should think the power supply, is:


    It's basically a configurable version of this. Yes, lenovo, I thank you for the hours I wasted opening up power supply plugs and replacing the center pin resistors:


    Here's how the P73 responds:

    - 230W works fine   4.6k => I have seen power supplies work with 170W but fail at 230W, so the laptop does draw more
    - 170W works ok     1.9k (1.8k also ok)
    - 130W rejected     1k
    - 90W  rejected     550 

    The rejected power supplies will be used to charge the laptop if it is shutdown, but they will not be used in any way otherwise. On the P70 the laptop would at least use the power supply to keep the laptop alive, and use half battery half external power supply. Not so with the P73, it just ignores it entirely.
    This is utter bullshit as I have plenty of 90W power supplies, including 12V car converters, or a 90W external 20V battery pack I can't use anymore.

    You can go read my Hacking a thinkpad slim tip adapter to output more than 90W (required to charge a Thinkpad P70) page for details, including this nice battery pack I couldn't use anymore:


    *Update* : so, actually with some serious tlp hacking (basically I told it to force battery mode even if a power supply is plugged in), I've managed to throttle the laptop enough, even when plugged in, so that it only uses 20W. At that point, I'm actually able to use my old external battery pack, as well as a 90W power supply, as long as I lie to the laptop and pretend they are 230W power supplies with the resistor trick. In my tests with windows, it was not possible to throttle the laptop enough when plugged in, not to have it overwhelm a smaller power supply (not that 90W is small for a laptop that normally uses 20-30W when it's not charging batteries).
    If you scroll to the bottom of the page, you'll also see a terrible buffer lipo hardware hack I did that allows to use the battery pack with higher amp draws, but it's a bit ridiculous (and bulky).
    See tlp issue 494 for details on how to setup tlp to run in low power mode when power is plugged in.

    Without the tlp hack or the buffer lipo hack, when I lie to the laptop and tell it is connected to a a bigger power supply, manage power draw with what I run, and disable battery charging in software, but the laptop will still draw the power supply for over 100W when you plug it in for a fraction of a second, and refuse it if the voltage drops.
    Obviously this would not be a problem if the laptop simply had a 90W power supply mode where it throttle things down and turned off battery charging. This is mostly what the P70 does.

    In the meantme, on top of hacking my power supplies, I also made this for my laptop, it looks silly and makes the thinkpad not look like a professional laptop, but well, that's lenovo's fault:


    this takes any power supply and replaces the center tip resistor with a 1.9k one to emulate a 170W power supply
    this takes any power supply and replaces the center tip resistor with a 1.9k one to emulate a 170W power supply

    From talking to Lenovo, they don't think that this is really a problem, so since I'm an engineer, I made my own external battery pack, but I otherwise recommend to road warriors to avoid thinkpads from now on, given the backward power design in this one.

    Making a Thinkpad P73 compatible external battery pack

    I did some testing and confirmed that the laptop is very picky about power supplies. It even rejects a 19.7V 20A power supply I had, because it's 19.8V and not 20V. Same thing for amps, it needs to be able to draw maybe around 5A for a short time to accept the power supply (they sure are putting a lot of effort into making sure the power supply is not under-spec'ed).

    Prototype with 150W step up converter which takes my 16V lipo to 20V while delivering enough amps to make the laptop happy:


    it works, and the laptop thinks it's connected to a 230W power supply thanks to the center pin resistor.
    it works, and the laptop thinks it's connected to a 230W power supply thanks to the center pin resistor.

    Here's a quick demo:

    Version 2 was to have a way to recharge the battery pack while it's being used. I've used this to use the battery pack as a buffer to absorb peaks from the laptop without tripping an external power supply, including in a car limited to 100W or a plane power supply limited to even less:

    this works in theory, but the lipo charger is quite slow and wouldn't keep up for long, but I made a better version shown lower down
    this works in theory, but the lipo charger is quite slow and wouldn't keep up for long, but I made a better version shown lower down

    Lenovo's P73 airplane mode simply stops using the external power supply and reverts to batteries. Sigh...

    Oh yes, let's talk about airplane mode. The lenovo engineers thought of everything: if they detect that the power supply drops a few times in a row, they offer a nice setting which is supposed to make the plane more airplane friendly. How friendly you ask? Well, you could throttle down the CPUs, disable battery charging, do smart stuff like that. Or, if you're lenovo, you can have airplane mode simply refuse to use the power supply altogether. Thank you lenovo, you wrote a feature that saves me the trouble of unplugging an otherwise perfectly good power supply that you refuse to use (to be super clear, my 230W power supply is plugged in and airplane mode just disabled it):


    Making a battery pack to act both as buffer for a smaller power supply, and as emergency external power (even power the laptop from 12v)

    Anyway, back to the battery pack, I found the ISDT H605 Air lipo charger which is small enough and can charge the lipo at 5A, which should be enough to keep up with the laptop when not doing CPU crazy stuff. This also allows using a 12V power supply or a lower wattage lenovo power supply to recharge the pack while it's in use, or not:


    version 1 was a bit bigger than I wanted, 90W power supply shown for scale
    version 1 was a bit bigger than I wanted, 90W power supply shown for scale

    here, the 90W power supply is recharging the battery at 2.5A while it's being discharged at 3A on the output side, using the battery as buffer
    here, the 90W power supply is recharging the battery at 2.5A while it's being discharged at 3A on the output side, using the battery as buffer

    I made version 3 a bit smaller, with a built in 12V lipo to act as buffer for a smaller power supply. Yes, it's a beautiful piece of art, I know :)
    I made version 3 a bit smaller, with a built in 12V lipo to act as buffer for a smaller power supply. Yes, it's a beautiful piece of art, I know :)

    Pushed to the extreme, I can now use my original external battery pack again by having it recharge my lipo+150W step up that can output more amps than the ravpower pack can. Of couse, it's inefficient, the ravpower pack outputs 20V that gets down converted to 12V by the H605 Air lipo charger, which charges the built in 3S lipo in the box, and then gets up converted back to 20V without the amp limitation (the phone used to control the lipo charger also inside the box):


    The really cool thing is that by using tlp, it's actually possible to tune the laptop down to very low power use, even when plugged in, something that windows probably can't do:

    7.3W with the screen off (and around 10W with wifi off and the screen on low dim) is not bad for a laptop that big
    7.3W with the screen off (and around 10W with wifi off and the screen on low dim) is not bad for a laptop that big

    4S Lipo vs 4x 18650 or 26650 batteries

    I do have a few lipos laying around, so that's free energy for my laptop if I'm willing to carry them. I have however found that for higher draws, the step up converter doesn't quite keep up at 20V/5A+ with just 12V input (3S), but is fine with 16V input (4S):


    That said, as I recently found out that 16650 (or better 26650) batteries are both lighter and smaller. The only thing the lipos do, is offer a better discharge rate, but while that's useful for a high power RC plane motor that can empty the batteries in 10mn, it's not needed for a laptop:


    Outside of 26650 batteries, there are other ones like https://www.18650batterystore.com/21700-p/samsung-50e.htm .

    26650s are 195 Wh/kg while the lipo I gave was 184Wh/kg. The 3rd battery listed is supposed to be 260Wh/kg which is much nicer, that said, it looks like those samsung batteries are actually smaller than 26650s, lighter, and yet offer the same 5Ah at 3.6V. If so, that's very impressive.

    As of this writing, I have however not found 26650 battery holders that hold 26650 protected cells that are a bit longer. This seems to the be only one available, and it's too short to hold the batteries: https://www.amazon.com/gp/product/B074GVPWSH


    A few months later, I ended up cutting them and taping them to make them longer. It doesn't work great, but it was enough for a few tests. In the end, I found that somehow I wasn't getting enough amps out of them, which surprised me, so they didn't work that well compared to a lipo:


    Conclusion

    Lenovo, please make the P73 work like the P70, and fix this airplane mode thing that turns off the external power supply. That's embarrassing...
    2016/02/29 Hacking a thinkpad slim tip adapter to output more than 90W (required to charge a Thinkpad P70)
    π 2016-02-29 01:01 in Computers, Electronics, Linux
    The thinkwiki power connector page explains very nicely how Lenovo power supplies come in round and slimp (rectangular) tip, and can be 35, 45, 65, 90, 135, 170, and 230W. The way the laptop knows how much power it can draw, is by measuring a resistor between the center pin and ground. So far, most of my power supplies had been 90W, and all my thinkpads, including the T540p, were ok enough with that, even if maybe they were not always charging at full speed.

    However, when I got my thinkpad P70, although it also uses around 25W in typical use, which means plenty of extra wattage on a 90W power supply to charge the battery, the P70 was unfortunately designed not to charge under any condition unless it recognizes a power supply that's at least 135W (it ships with a 170W power supply, and it's a huge monster brick). I'm pretty mad at lenovo for that because they could totally have designed the P70 to charge at a slower rate from a 90W power supply, or at least when the laptop is sleeping, but no, even when it's sleeping, it will just not charge at all. Sadly, this means that the RAVPower 23000mAh Portable Charger Power Bank External Battery Pack I bougght, was able to power the laptop, but not charge it. I guess in this case, it's not a huge issue since energy would be wasted trying to charge the laptop battery instead of just powering it, but still, that was disappointing.

    here, the pack is powering my laptop at 20V, 2.1A
    here, the pack is powering my laptop at 20V, 2.1A

    The P70 will function off a 90W power supply by just not discharging its battery, and consuming around 1.5A at 20V (i.e. 30W), so that meant that not only I had to buy some bulky 135W power supplies (less bulky than 170W thankfully), but also that I was now unable to use my travel iGo 110W 12V DC power supply, which I use to charge in cars. For AC, I did buy a Lenovo ThinkPad 135W (Slim Tip) Replacement AC Adapter for lenovo ThinkPad T440p 20AN 20AW, Lenovo ThinkPad T540p 20BE 20BF: https://www.amazon.com/gp/product/B00HOMBO0M


    But for car use, I was upset about the situation, so I read up and realized I only had to change the resistor in my barrel connector to slimtip adapter and that would likely allow my thinkpad to start charging from my 110W iGo power supply. The hard part was finding where the resistor was since I had to replace a small resistor with a bigger one (the other way around, I could have trivially added a resistor in series).

    So, I started with the AC Charger Power Supply Adapter Converter Cable Cord For Lenovo ThinkPad : https://www.amazon.com/gp/product/B00T013J44 and had to find where the resistor was hidden. After cutting the cable in 2, I convfirmed it was on the slimtip side, so I had to take the plug apart until I found it.



    After that, it was just a matter of adding a new resistor, and in the end, I added a resistor bridge, so that I could select no resistor, 550 Ohm (90W), 1kOhm (135W), or even 1.9kOhm (170W). For my laptop, though 135W was enough, and my iGo only delivers 110W anyway.



    I added a amp/volt meter (RioRand 2in1 4.5-30V 10A Digital Voltage Detector DC Current Volt Amp Meter), so I can tell how much current is flowing and whether I might be exceeding the wattage of the power supply. When my laptop is running, and the battery charging, it's now using 5.6A (just about 110W)


    So problem solved. I'm not super happy at Lenovo for having stupidly designed their Thinkpad P70 not to charge from a 90W power supply under any use case, even at reduced speed, or even with the laptop sleeping or off, but since I already had the laptop, I was stuck with it, so this little resistor hack did the trick. Hope this helps someone.

    Oh yeah, for car use, instead of this old obsolete iGo brick, I made my own 12V-20V DC-DC converter, and you can read more about it on this page


    2016/02/22 Thinkpad P70 NVME vs M2 Sata vs 2.5inch Sata SSD
    π 2016-02-22 01:01 in Computers, Linux
    So far I had been using the Lenovo T540 which I got because of its 3K 15" screen, but I really hated that generation of thinkpads due to the lack of mouse buttons (hence the bluetack on the pad, used to know where I can click to emulate buttons 1, 2, and 3), and someone who decided it would be great to remove almost all LEDs, including caps lock, and hard drive activity. So when the P70 came out, I was very interested in it, not just because they fixed the LED and mouse button situation, but especially because of the first thinkpad with a 4K screen. The P50 has the same resolution in 15", but I figured if I'm going to have 4K's worth of dots (8 million pixels), I might as well have a 17" screen.

    So let's be honest and say that it is a big a heavy laptop, but that was an acceptable tradeoff for me. CPU wise, it's actually no faster than the T540, but the big new thing is the 2 M2 slots in addition to capacity for 2 2.5" Sata drives, like the T540 (one goes in place of the DVD Burner using a special tray).

    yes, it's big
    yes, it's big

    the 2 M2 slots are on the right, and the 2nd drive goes under where the SSD is visible in this picture
    the 2 M2 slots are on the right, and the 2nd drive goes under where the SSD is visible in this picture

    size of M2 sticks compared to the SSD (with free shot of the 96Wh battery :) )
    size of M2 sticks compared to the SSD (with free shot of the 96Wh battery :) )

    Comparison with the T540
    Comparison with the T540

    So the P70 can currently house 5TB of storage and I was interested to see how well the M2 slots worked compared to the Sata ones under linux. First thing to note is that currently M2 slots can only house 512MB of storage each vs 2TB for the 2.5" Sata slots that have more room. Sadly, Lenovo is still not selling the Drive Caddy Adapter for the P70, but the good news is that you can buy this $17 Soogood 2nd HDD SSD Hard Drive Caddy Adapter Use For Lenovo Thinkpad T440p T540p W540p from Amazon, unscrew the little tab from the DVD Drive, screw it on the drive caddy adapter, and it'll work in the P70.

    To try that out, I got the following (with price by GB as of 2016/02), in increasing price per GB: - 4.6c/GB: Seagate 2TB Laptop HDD SATA 6Gb/s 32MB Cache 2.5-Inch Internal Bare Drive (ST2000LM003) - 30c/GB: SATA6G: Samsung 850 EVO 2 TB 2.5-Inch SATA III Internal SSD (MZ-75E2T0B/AM) - 33c/GB: M2/SATA Samsung 850 EVO 500 GB M.2 3.5-Inch SSD (MZ-N5E500BW) - 64c/GB: M2/NVMe: Samsung 950 PRO -Series 512GB PCIe NVMe - M.2 Internal SSD 2-Inch MZ-V5P512BW

    So it's interesting to note that SSDs still cost 6.5x more than a hard drive (actually I was surprised to see how cheap the 2.5" 2TB hard drive was). Next, it's good to know that M2/Sata SSDs cost about the same price per GB than full size Sata SSDs. And last, at twice the price, the M2/NVMe SSD is no bigger than the SATA M2 version, but clearly more expensive. It's supposed to be up to 4 times faster in bulk transfer rate due to the use of 4 PCI lanes, but I was curious to see how much faster it would actually be for real use with linux.

    First, is looking at support. To make things interesting, I decided to make the NVMe SSD my boot drive. The Thinkpad bios of course supports it fully, but a big gotcha is that it'll only boot if you use a GPT partition with EFI. Setting that up from scratch was a pain, but I got through it, and it's out of topic for this post.


    Next, is linux support. Thankfully linux has supported NVME for a while now. I just set CONFIG_BLK_DEV_NVME=y in my kernel so that I didn't have to worry about the module being in my initrd. Device partitions show up as /dev/nvme0n1p1 and so forth.

    Now, the benchmarks. For my main filesystems, I have btrfs on top of dmcrypt, created with:

    cryptsetup luksFormat --align-payload=8192 -s 256 -c aes-xts-plain64 /dev/device

    In the tests below, I did used hdparm, iozone, and 2 kinds of dd, ddd with data, and dd0 copying just /dev/zero:

    ddd test: sync; dd if=/mnt/ram/file of=file bs=100M count=100 conv=fdatasync; dd if=file of=/dev/null bs=100M
    dd0 test: sync; dd if=/dev/zero of=file bs=100M count=100 conv=fdatasync; dd if=file of=/dev/null bs=1M

    Let me start with the summary conclusions first, since this is what most people probably care about:

  • NVMe is faster for big contiguous I/O, even through dmcrypt, that's good.
  • M2 NVMe and M2 sata do not seem to go through buffer cache for writes, but SATA/6GB does
  • When using buffer cache, SATA/6GB beats NVMe/M2 and SATA/M2 by a lot on block reads. Why?
  • For random I/O, NVMe is up to 50% faster, and faster with ext4 than btrfs
  • Encrypted NVMe is a bit faster than non encrypted Sata/M2
  • At $328 for 512GB M2/NVMe vs $168 for 500GB M2/Sata, unless you're doing big contiguous I/O, the 2x price difference is hard to justify, cached I/O and random I/O are not significantly faster on NVMe.
  • More detailled summaries related to the test results below:

  • NVMe only really looks faster on big block sequential read/write (indeed 4X read, 2X write). On Random I/O, it's no faster. Other overheads seem to kill its performance advantage.
  • 2TB Sata 6GB SSD is faster for read/write encrypted than NVMe is non encrypted (except hdparm). Looks like the block caching layer works better for Sata than NVMe?
  • iozone through block cache is faster on M2/SATA than M2/NVMe, very weird.
  • iozone direct I/O shows NVMe is fastest (by 50% only) and external SATA just a bit faster than M2/Sata. Clearly the block caching layer hides differences for iozone.
  • when using dmcrypt, NVMe is only marginally faster in iozone than Sata/M2 or Sata/6G
  • kernel build speed is same on SATA/M2 and NVMe/M2, encrypted or not, but SATA6G is 10% faster (probably the same effect that block cache works better on SATA/6G than SATA/M2 or NVMe/M2)
  • Thankfully on big sequential IO (ddd test), NVMe finally shows being 4x faster on read, and 2.5x faster on write.
  • ext4 does better on iozone -I (directIO) than btrfs, 2x as fast on random read for NVMe
  • So there you go. I realize that my test suite may not have been perfect, but hopefully the results are helpful to others. I'm hoping linux will get fixed, or that I can find a tunin g parameter to bridge the gab in cached IO speed between Sata 6G 2.5" and M2 slots. Below are test results in more details are you go down the page.

    Here are test results for cached IO:

    		SATA/M2 dmcrypt	 SATA/M2	NVMe dmcrypt	NVMe		SATA6GB/dmcrypt
    hdparm -t	 534MB/s	 517MB/s	1307MB/s	2140MB/s	 534MB/s
    

    ddd 10GB read 550MB/s 560MB/s 2000MB/s 2400MB/s 550MB/s ddd 10GB write 500MB/s 503MB/s 1300MB/s 1200MB/s 506MB/s

    dd with /dev/zero hits optimizations that actually penalize NVMe: dd0 10GB read 7GB/s 6.7GB/s 2.3GB/s 4.4GB/s 6.6GB/s dd0 10GB write 495MB/s 503MB/s 1.3GB/s 1.3GB/s 2.0GB/s

    iozone -e -a -s 4096 -i 0 -i 1 -i 2 (cache makes Sata6G faster than M2, weird): ioz read 4KB 1760MB/s 1790MB/s 675MB/s 766MB/s 7863MB/s ioz write 4KB 268MB/s 298MB/s 295MB/s 291MB/s 777MB/s ioz ranread4KB 5535MB/s 7392MB/s 3185MB/s 7261MB/s 7892MB/s ioz ranwrite4KB 288MB/s 329MB/s 205MB/s 381MB/s 796MB/s

    For comparison, I then used directio to bypass the caching layer:

    iozone -I -e -a -s 4096 -i 0 -i 1 -i 2 (direct IO):
    		SATA/M2 dmcrypt	 SATA/M2	 NVMe dmcrypt	 NVMe		 SATA6GB
    										 dmcrypt notcrypted
    		 btrfs		 btrfs   ext4	 btrfs		 btrfs   ext4	 btrfs     ext4
    ioz read 4KB	 255MB/s	 303MB/s 408MB/s 303MB/s	 396MB/s 562MB/s 310MB/s 379MB/s
    ioz write 4KB	 195MB/s	 238MB/s 344MB/s 257MB/s	 358MB/s 361MB/s 233MB/s 365MB/s
    ioz ranread4KB	 305MB/s	 351MB/s 482MB/s 476MB/s	 699MB/s1434MB/s 309MB/s 475MB/s
    ioz ranwrite4KB	 265MB/s	 223MB/s 392MB/s 260MB/s	 217MB/s 315MB/s 254MB/s 366MB/s

    Details of each test, per type of drive;

    ===============================================================================
    saruman M2 SATA 512GB encrypted btrfs
    

    saruman:/tmp# hdparm -t /dev/mapper/cryptroot Timing buffered disk reads: 1604 MB in 3.00 seconds = 534.03 MB/sec

    iozone -e -a -s 4096 -i 0 -i 1 -i 2: random random kB reclen write rewrite read reread read write 4096 4 257076 281089 1761711 6094733 6066754 290373 4096 512 277108 295167 1588844 8426437 11128258 318731 4096 4096 268940 308248 1760087 8062616 8377131 320802

    iozone -I -e -a -s 4096 -i 0 -i 1 -i 2: 4096 4 38626 45227 102236 111141 30936 64317 4096 512 138467 128878 134674 137832 140067 126248 4096 4096 195439 273100 255379 307300 305605 265093

    saruman:/mnt/mnt# sync; dd if=/dev/zero of=file bs=100M count=100 conv=fdatasync; dd if=file of=/dev/null bs=1M 10485760000 bytes (10 GB) copied, 21.1761 s, 495 MB/s 10485760000 bytes (10 GB) copied, 1.49373 s, 7.0 GB/s

    kernel 4.4.1 make -j8: real 17m54.712s user 126m26.620s sys 6m21.948s

    btrfs send/receive encrypted partition to non encrypted, 87GB: 10mn30

    saruman M2 SATA non encrypted btrfs ----------------------------------- saruman:/mnt/mnt4# hdparm -t /dev/sdc4 /dev/sdc4: Timing buffered disk reads: 1554 MB in 3.00 seconds = 517.93 MB/sec

    iozone -e -a -s 4096 -i 0 -i 1 -i 2: random random kB reclen write rewrite read reread read write 4096 4 285020 297565 1739944 7434579 6605595 305785 4096 512 310937 336617 1298278 3703511 5483860 299416 4096 4096 298433 317101 1790911 7392988 7434579 337476 iozone -I -e -a -s 4096 -i 0 -i 1 -i 2: 4096 4 47219 93497 118900 126065 39160 86462 4096 512 214381 213388 194307 209215 206951 209289 4096 4096 238792 221839 303768 352951 351342 223618 ext4 iozone -I -e -a -s 4096 -i 0 -i 1 -i 2: 4096 4 119524 146035 150173 159105 53090 140697 4096 512 358954 354810 366466 423088 419760 375542 4096 4096 344087 398828 408259 478337 482569 392487

    saruman:/mnt/mnt3# sync; dd if=/dev/zero of=file bs=100M count=100 conv=fdatasync; dd if=file of=/dev/null bs=1M 10485760000 bytes (10 GB) copied, 20.8537 s, 503 MB/s 10485760000 bytes (10 GB) copied, 1.55651 s, 6.7 GB/s

    kernel 4.4.1 make -j8: real 17m55.612s user 126m31.952s sys 6m27.452s

    ******************************************************************************** saruman M2 NVMe 512GB encrypted btrfs

    saruman:/tmp# hdparm -t /dev/mapper/cryptroot2 /dev/mapper/cryptroot2: Timing buffered disk reads: 3924 MB in 3.00 seconds = 1307.56 MB/sec

    iozone -e -a -s 4096 -i 0 -i 1 -i 2: random random kB reclen write rewrite read reread read write 4096 4 284205 341651 742181 6195843 6178018 341101 4096 512 314351 319573 864883 8865630 8902382 384993 4096 4096 295741 201042 675234 3281854 3185110 205974 iozone -I -e -a -s 4096 -i 0 -i 1 -i 2: 4096 4 80042 83160 122616 127129 41421 53963 4096 512 168713 153333 167710 209923 198123 168026 4096 4096 257968 258566 303023 490828 476440 260014

    saruman:/mnt/mnt2# sync; dd if=/dev/zero of=file bs=100M count=100 conv=fdatasync; dd if=file of=/dev/null bs=1M 10485760000 bytes (10 GB) copied, 8.01494 s, 1.3 GB/s 10485760000 bytes (10 GB) copied, 4.63397 s, 2.3 GB/s

    kernel 4.4.1 make -j8: real 17m57.513s user 126m58.360s sys 6m25.164s

    btrfs send/receive encrypted partition to non encrypted, 87GB: 7mn (33% faster than Sata M2)

    saruman M2 NVMe non encrypted btrfs ----------------------------------- saruman:/mnt/mnt4# hdparm -t /dev/nvme0n1p4 /dev/nvme0n1p4: Timing buffered disk reads: 6422 MB in 3.00 seconds = 2140.38 MB/sec

    iozone -e -a -s 4096 -i 0 -i 1 -i 2: random random kB reclen write rewrite read reread read write 4096 4 274808 271851 684271 2634219 2280673 177630 4096 512 290191 336755 668196 3362795 4039655 184779 4096 4096 291427 340345 766588 7355007 7261741 381768 iozone -I -e -a -s 4096 -i 0 -i 1 -i 2: 4096 4 94814 117116 147645 159695 44075 108039 4096 512 271130 267800 239969 325933 301841 271062 4096 4096 358602 275933 396591 719099 699939 217665 ext4 iozone -I -e -a -s 4096 -i 0 -i 1 -i 2: 4096 4 107281 200735 205900 263035 54832 124219 4096 512 537478 374641 525060 1173664 1139338 558807 4096 4096 361545 526137 562632 1483477 1434069 315883

    saruman:/mnt/mnt4# sync; dd if=/dev/zero of=file bs=100M count=100 conv=fdatasync; dd if=file of=/dev/null bs=1M 10485760000 bytes (10 GB) copied, 7.90653 s, 1.3 GB/s 10485760000 bytes (10 GB) copied, 2.35863 s, 4.4 GB/s

    kernel 4.4.1 make -j8: real 17m54.221s user 126m46.264s sys 6m10.592s

    ******************************************************************************** saruman Samsung Evo 850 2TB SSD encrypted btrfs

    hdparm -t Timing buffered disk reads: 1606 MB in 3.00 seconds = 534.87 MB/sec

    iozone -e -a -s 4096 -i 0 -i 1 -i 2: random random kB reclen write rewrite read reread read write 4096 4 513924 738957 8586475 9144037 8017464 697665 4096 512 772100 820362 9287391 10136778 10586522 840551 4096 4096 719099 777517 7863339 8047509 7892238 796108

    iozone -I -e -a -s 4096 -i 0 -i 1 -i 2 4096 4 76626 47961 92886 80947 36063 63788 4096 512 135087 138998 143127 150981 144393 132219 4096 4096 233245 234058 310797 311552 309855 254080

    ext4 iozone -I -e -a -s 4096 -i 0 -i 1 -i 2 (unencrypted) 4096 4 118013 141212 130575 111534 42343 138654 4096 512 336347 312192 332847 414404 424542 342707 4096 4096 365227 364638 379298 484160 475122 366536

    saruman:/tmp# sync; dd if=/dev/zero of=file bs=100M count=100 conv=fdatasync; dd if=file of=/dev/null bs=1M 10485760000 bytes (10 GB) copied, 5.23919 s, 2.0 GB/s 10485760000 bytes (10 GB) copied, 1.58287 s, 6.6 GB/s

    kernel 4.4.1 make -j8: real 16m4.305s user 104m0.816s sys 7m2.832s

    2014/07/23 Making a super cheap water/flood sensor
    π 2014-07-23 00:00 in Computers, Linuxha
    I wanted a water sensor for my water heater that would both alert me in the house, and as remotely when the sensor was tripped.

    This is what it looks like:


    I analysed how the DS10A worked, and due to sheer luck in its design, the wires going to the magnetic sensor turn out to be ground and signal, and the water sensor conducted enough current between them to allow triggering of the DS10A:


    Wiring is totally trivial, you only need to use a 3rd wire connected to the plus from the 2 batteries, and it "just works". For extra credit, I wired a buzzer between signal and ground, and my water sensor passed enough current to allow the buzzer to run.

    I used the Phantom YoYo High Sensitivity Water Sensor which was $10, but apparently you can get one that should work too from seedstudio for $3

    The DS10A, I have a stack of, which you can sometimes find on ebay for cheap in bundles, and my house is already wired to receive those signals, so it was trivial to generate an Email and page from misterhouse when this sensor got triggered.

    2013/12/09 Keeping Track of How Much Your Roomba is Really Working
    π 2013-12-09 00:00 in Computers, Linuxha
    I have had roombas with a scheduler that sends it to work, or often send my roomba to work just before leaving somewhere, but my old Roomba used to get lazy when no one was around to watch it, and would get back to its charger quickly.

    With my new roomba, I even setup 3 zones with virtual walls, and I really wanted to have an idea how long my roomba went out to see how much work it was doing and how its battery was doing over time.

    In the end, I ended up using a DS10A door/window sensor and glued a magnet on top of my roomba, which closes the contact when it goes back to its dock. I then have misterhouse code that kept track of how long I left my doors opened to also keep track of my roomba and long it goes to work, as well as warn me if it doesn't make it back to its dock after too many hours:



    My mailbox now shows:

    Chg: Roomba Just Left                                    
    Chg: Roomba Just Returned after 41.1 mn                  
    Chg: Roomba Just Left                                    
    ChgTmr: Roomba Left longer than 300 mn                   
    Chg: Roomba FINALLY Returned after 2881.1 mn             

    That way, I know when the timer worked, how long my roomba worked, and whether it got stuck somewhere or not. Ok, it'snot perfect, it would be nice to know when it crossed the zones, and how long it ran before getting stuck. This sounds a lot more involved though, maybe later.

    2013/11/10 Reviewing IP Webcams for Linux and Zoneminder:Dlink DCS900, Ubnt Aircam, Foscam FI8904W FI8910W, FFI9820W, FI9821W, Wansview NCB541W, and Zavio F3210
    π 2013-11-10 00:00 in Computers, Linux, Linuxha
    Links to cameras:
  • DCS900
  • FI8904W
  • NCB541W
  • FI8910W
  • FI8920W
  • FI8921W
  • Aircam
  • Edimax3115w
  • F3210
  • FI9826PB
  • FI9805P
  • FI9900P
  • NCM625GA (aka Wansview Q1)
  • NCM751GA (aka Wansview W1)
  • Wansview K1
  • Wansview W2
  • Wansview Q2
  • Reolink RLC-410
  • Wansview K2
  • I hearby want to thank Wansview for giving me some of the above cameras for review (I bought some of them on my own, and after seeing my reviews, they asked me to test and review a few more). Note that while wansview cameras do not offer the sharpest 1080p pictures I've seen (Zavio and FI9900 win, even I hate foscam), the nice things I've written on wansview are not based on the free cameras, but the fact that they have always answered my support queries, including the technical ones showing issues with the firmware, and fixed the firmware after that (including making it work on linux and other other operating systems), while Foscam tells people that they're running the wrong version of windows, and that's it.
    zavio truly sells good cameras, but sadly they cost more than double, which may be a bit out of reach for many people.

    Zoneminder

    I have tried a bunch of IP cameras with linux and zoneminder. Here is a short review of them below if that helps others.

    One good page to know about is ispyconnect, which gives all the entrypoints for many cameras:

  • http://www.ispyconnect.com/man.aspx?n=foscam
  • http://www.ispyconnect.com/man.aspx?n=wansview
  • http://www.ispyconnect.com/man.aspx?n=zavio
  • Camera in 2009

    Dlink DCS900

    My first IP Cam was a Dlink DCS900. Today, it's utter crap, the picture is bad, the camera is slow, but back in the day it was cheap-ish and there weren't many other ones:






    Cameras in 2013/11

    Foscam FI8904W

    This is an outdoors camera. It's not wide angle at all, which I don't like, and it's low res (640x480), but the picture is decent enough for that resolution:




    Wansview NCB541W

    It's a clone of the FI8904N. The firmware isn't great, but it works well enough for image capture and it's the cheapest you'll find for 480p with a motorized base _and_ night view.



    Foscam FI8910W

    Similarly the FI8910W is ok enough for 640x480, but don't expect miracles:






    Because it wasn't wide angle enough, I got a 3rd party (cheap) wide angle F2.0 lens for it. It blurs the picture around the edges quite a bit, but gives me the shot I wanted:



    Foscam FI8920W

    It's supposed to be an HD camera (720p), but the picture is horrible and the web interface too (does not work with linux). It's not even wide angle. DO NOT BUY:




    Foscam FI8921W

    It's the not as bad version of the FI8921W. To be honest, the 720p HD picture is still blurry, but it's better than 480p. You get what you pay for. The web interface does not work with linux but you can capture screenshots from it with zoneminder on linux after you've set it up. It also has an RTSP stream, but I found it often gave me frames where the picture was aborted half way (actually I found out later that reducing the frame rate seems to fix this), so I use image capture instead of RTSP for zoneminder.



    I also changed the F2.8 lens to a wider dealextreme F2.0 lens that's blurry around the edges:



    Ubnt Aircam

    It wins for the very wide angle and cheap price for 720p, but that's because the sensor is not 720p, only the output is. If you take a 480p shot and you blow it up to 720p, it looks almost the same. Sad... The newer firmware offers image capture if you turn off authentication, but I didn't get it to work well with zoneminder (it's too slow), so I use RTSP. I would not really recommend this camera unless you want the very wide angle. Note that some cameras ship blurry because the lens (very very hard to turn, it's stuck with glue I think), is not focussed. At times, it'll also show you wrong colors.

    out of focus out of the box, this is kind of sad
    out of focus out of the box, this is kind of sad

    this is only barely better than the 480p version but great wide angle
    this is only barely better than the 480p version but great wide angle

    480p picture blown up to 720p to compare with 720p 'native'
    480p picture blown up to 720p to compare with 720p 'native'

    Edimax 3115w

    This is a nice cheap camera with an honest resolution of 960p. The caveats are that it's not motorized, and it does not have night/IR vision, but otherwise the picture and resolution are good and you can't beat them for the price (assuming you can still find it for sale anywhere)



    Zavio F3210

    It's more expensive ($260), but the picture is fantastic, even in 1080p (reduced here for the web page). Too bad it does not come motorized, and for Wifi you'll need the F3215 which is not motorized either ($280).
    The web interface and protocol support are fantastic. This is a camera that all other manufacturers should inspire themselves from. You can fully configure it in any browser (including from linux of course), and see the live view without any special plugin.






    Cameras in 2015/08

    My old Foscam fi8904w died (it was my only outdoor camera), so I looked at replacements. Sadly foscam only got worse software/firmware-wise, sometimes even making cameras that work with virtually no OS (including new versions of windows in some cases), and they continued to have lots of fake 5 star reviews on amazon, which is enough of a reason not to by from them anymore.
    A few cameras I looked at first though:

    Foscam FI9826PB

    Don't buy this, get the cheaper Wansview NCM625GA/Q1 (or Q2) which comes with higher resolution and no cheating fake reviews on amazon.

    Foscam FI9805P

    This one might have worked, again if you forget all the fake amazon reviews, but it's superseeded by the FI9900P.

    Foscam FI9900P

    The amazon reviews are saying: good camera quality, and questionable firmware with bugs, a foscam specialty still... I ordered one out of morbid curiosity and to replace my outdoors Foscam FI8904W which just died, but really I (or you) shouldn't be giving any money to Foscam anymore...
    If you don't mind spending more ($300), the Zavio B6210 seems like a good serious replacement.

    Anyway, here's what I found on the Foscam 9900:

  • The firmware is even more horrible than it was before. I could not even get it to display a picture in windows with MSIE and their stupid windows only plugin that I shouldn't even have to trust to see a picture. I was able to change video settings on windows, but not see the picture.
  • With the android software, I can see the picture/video, but not change the video settings
  • And get this, if I try to login on linux, I cannot even login. Yes, login denied without the stupid windows plugin (i.e. I cannot even access settings and non video related stuff).
  • If you guessed that I think Foscam sucks by now, you guessed right. First to me, they look like liars and cheaters by what really looks like buying fake reviews on amazon, and then in the last 2 years, they actually made their web interface worse since the FI8921W where you could at least login on linux and change settings.

    While I'll repeat that life is too short to deal with this crap and give money to that company, I used jpeg URL ( /cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=user&pwd=pwd1 ) to make it work with zoneminder, and it works well enough. As other reviews have said, the optics are actually quite good, I do like the very wide angle picture without barrel effect:






    Too bad that Foscam's firmware sucks so much, the optics are good now. If you need an outdoor camera, and value your time and sanity a few dollars, I'd recommend the Zavio B6210. If an indoor camera used outdoors with light weather proofing is good enough, try the cheaper and somewhat better Wansview NCM625GA/Q1 below (although its picture isn't as wide and show barrel effect):

    Wansview NCM625GA (aka Wansview Q1)

    I ended up continuing with an indoor camera that I'm going to use outdoors. A Zavio F3215 would have been very good, but this new Wansview is half the price and is motorized. It's much much better than the old NCB541W I have (and actually that was a very good camera for the price too). The Wansview NCM625GA is sold on amazon as Wansview 1080P 2.0MP WiFi Wireless IP Security Camera, Full HD.
    Note that there is new firmware for this camera. The original firmware was mostly windows only, but the new one has a flash interface that works on linux and most operating systems.

    Cons:

  • It used to require a windows plugin, but now it works with flash too on most operating systems (including linux)
  • Pros:

  • Price/features is unbeatable ($80), video quality is good
  • Nice wide lens (maybe not what you needed, but that's what I wanted)
  • the motorized mount almost has 360 travel
  • relay outputs if you care about that
  • Updates:

  • If you install firmware 0.40 and this firmware patch I got from Wansview (both can be installed in the web upload interface), http://ipaddr/mjpeg/snap.cgi?chn=0 now returns a proper Content-Type: image/jpeg header and will work with Zoneminder and other software that expects a jpeg. You can also get official firmware updates from this site: http://www.wansview.com/Service/download/25.html
  • Info:

  • Turns out you can get simple jpegs from that camera without a plugin. The magic URL is http://ipaddr/mjpeg/snap.cgi?chn=0 . Note that the firmware did not return a proper "Content-Type: image/jpeg" header, so the jpeg URL does not work with zoneminder and may not work with other software. This is now fixed with a firmware patch_.
  • I installed the recommended iSmartViewPro on android, scanned the QR code on the back of the camera, and had it working instantly.
  • The video works fine on linux with ( vlc rtsp://ipaddr/live/ch0 , vlc rtsp://ipaddr/live/ch2 , vlc rtsp://ipaddr/live/ch3 ).
  • PTZ can be controlled with GET ipaddr/hy-cgi/ptz.cgi?cmd=ptzctrl&act=left|right|up|down|stop|home|hscan|vscan (you can also add &speed=1-4 for a slower/faster scan speed).
  • Move to a preset: GET ipaddr/hy-cgi/ptz.cgi?cmd=preset&number=1&act=goto (I gathered those by dumping strings in the npHYPlayer.dll they provide for windows).
  • From the command line, try wget -q -O - --user=admin --password=pwd 'http://ipaddr/hy-cgi/ptz.cgi?cmd=preset&number=2&act=goto'
  • To move the camera just a bit to the left, try this: wget -q -O - --user=admin --password=pwd 'http://ipaddr/hy-cgi/ptz.cgi?cmd=ptzctrl&act=left&speed=2'; sleep 1; wget -q -O - --user=admin --password=pwd 'http://ipaddr/hy-cgi/ptz.cgi?cmd=ptzctrl&act=stop&speed=2'
  • It works fine with zoneminder 1.28 although I have to configure the 1080p stream on the camera to only be 3fps, or my zoneminder backend cannot process it quickly enough and the picture gets truncated (also there is up to a 5 second delay, but that seems to be true for zoneminder with many RTSP streams). If this does not work well for you, you can also simply configure zoneminder to pull the jpeg without using RTSP.
  • With the newer firmware, you can now do jpeg image capture too like you would with any basic webcam:
  • http://wansview-ncm625ga-1/mjpeg/snap.cgi?chn=0 gives you a single jpeg snapshot (which on newer firmware like 48 is 1920x1072 instead of 1920x1080, beware!)
  • http://wansview-ncm625ga-1/mjpeg/stream.cgi?chn=0 gives you an mjpeg stream that works with zoneminder but for me it gives a lower frame rate (1fps while I can do about 5fps on jpeg pulls from snap.cgi).

  • The 1920x1080 shots are truncated to 1280 for display on this page
    The 1920x1080 shots are truncated to 1280 for display on this page





    Wansview NCM751GA (aka Wansview W1)

    Wansview just came out with a competitor to the Foscam 9900, it's priced at the same $150 (now $100-ish 2016/12). If you need a cheap 1080p outdoors camera, and you hate foscam like I do (as explained above: bad firmware, and dishonest fake reviews on amazon), it's a decent option. However, the optics/video capture are inferior to both the foscam 9900 and the Wansview NCM625GA. For some reason, the 1080p picture looks like a blown up burry 720p or maybe 480p picture (this turned out to be due to my lens being out of focus, it's better after I fixed that). Also this camera is big and heavy compared to the Foscam 9900 (try the W2 instead).
    Please read the Wansview Q1 review for details on magic URLs to use, and firmware updates.

    This camera was superseeded by the Wansview W2 which is both much smaller and cheaper. Honestly, the only advantage of the W1 is the onboard storage if you care about that. For remote capture support, the W2 will be a much better bet (and almost half the price).

    The viewing anble is pretty narrow. That's either a good or a bad thing depending on your needs, but if you need wide, prever the NCM625GA if you can put it outdoors safely, or consider the foscam or a higher priced camera. The night vision is decent though:

    The 1920x1080 shots are truncated to 1280 for display on this page
    The 1920x1080 shots are truncated to 1280 for display on this page





    My camera was giving blurry pictures because the lens was mis-adjusted. I had to open it up and readjust the lens for the picture to a bit more clear.

    Like the NCM625GA, it now comes with firmware that works fine with linux and any operating system, and the android app gets the camera working in no time after you scan the QR code.

    Wansview K1

    This is wansview's smaller version of the NCM625GA that adds temperature and humidity monitoring while removing the motorized base.
    Please read the Wansview Q1 review for details on magic URLs to use, and firmware updates.

    It's a great little camera. Just like its big brother, I installed the recommended iSmartViewPro on android, scanned the QR code on the back of the camera, and had it working instantly. The picture quality is very good and this is the widest picture of any camera I've reviewed so far (even if it comes at the price of barrel effect).
    Please refer to my Wanview NCM625GA review for configuration details. The only real downside is the placement of the ethernet jack, making it hard to fit some ethernet cables unless you remove the flexible sleeve, but that's a manageable problem :)

    If you have firmware 0.39 or 0.40 and install this firmware patch I got from Wansview (via the web upload interface), http://ipaddr/mjpeg/snap.cgi?chn=0 now returns a proper Content-Type: image/jpeg header and will work with Zoneminder and other software that expects a jpeg. If your firmware is 0.41 or later, it should just work without the patch.

    It is the best 1080p camera you can get for that price, I'm quite impressed with it.

    The 1920x1080 shots are truncated to 1280 for display on this page
    The 1920x1080 shots are truncated to 1280 for display on this page





    Wansview W2

    This is wansview's smaller version of the Wansview W1 (NCM751GA). It's much smaller, cheaper, and otherwise short of onboard storage, it's really identical in functionality, including the narrow 6mm lens, which may or may not be good depending on your application.
    Please read the Wansview Q1 review for details on magic URLs to use, and firmware updates.

    My camera shipped with firmware 0.42 which supports http://ipaddr/mjpeg/snap.cgi?chn=0 out of the box with a proper Content-Type: image/jpeg header and will work with Zoneminder and other software that expects a jpeg.

    This is definitely a good alternative to the Foscam FI9900 if you are ok with a narrow lens in exchange for better firmware froma better company. However I'm not going to lie, the picture is not ultra sharp. It doens't look blurry but it feels like the sensor is not truly 1080p, or something is robbing a bit of resolution or sharpness.

    The 1920x1080 shots are truncated to 1280 for display on this page
    The 1920x1080 shots are truncated to 1280 for display on this page





    Wansview Q2

    I really liked my Wansview Q1, it was a great motorized camera with good wide lens, for a good price. The Q2 is a similar camera that's just a bit smaller, and offers similar performance. At the time I'm writing this, they are similarly priced. The Q1 is tiny bit bigger and offers a it more I/O. The Q2 is smaller and white if you prefer that over white, but the more important difference is that the Q2 has a lens that is a bit wider, so you will see a little bit more of your room with it than with a Q1. On the minus side, I found the picture less sharp on the Q2 than the Q1. You can compare the screenshots for yourself.
    Please read the Wansview Q1 review for details on magic URLs to use, and firmware updates.

    My camera shipped with firmware 0.42 which supports http://ipaddr/mjpeg/snap.cgi?chn=0 out of the box with a proper Content-Type: image/jpeg header and will work with Zoneminder and other software that expects a jpeg.

    The Q1 picture is a bit more narrow and looks a bit more sharp
    The Q1 picture is a bit more narrow and looks a bit more sharp

    The Q2 picture is a bit wider and bit less sharp
    The Q2 picture is a bit wider and bit less sharp

    Here are the other Q2 screenshots, they look fairly good at night;






    Reolink RLC-410

    I tried a reolink since it offered 1440p resolution instead of 1080p like the wansview, and despite the low price, the firmware worked pretty well (no problems on linux/chrome), and http jpeg downloads work fine too, although the download URL is weird: http://192.168.205.206/cgi-bin/api.cgi?cmd=Snap&channel=0&user=user&password=pwd . Actually, let me scratch that, jpeg downloads work fine in a browser, but return a content-type chunked that does not work with software that expects a simple image/jpeg in return. As a result, zoneminder does not work with this camera unless you use RTSP which itself is full of problems since it can easily push data faster than zoneminder can process it, yielding broken frames.

    Setup was a breeze, the one downside is because it's a PoE camera, it does support 12V input, but it does not ship with a 12V power supply. Thankfully I have a drawer full of those :)
    The default picture was way too bright (over exposed) and the sharpening was turned up too high, making the picture grainy. On the last picture, I turned the brightness down as well as the sharpening, and the results are better. The lens is about as wide as Wansview Q2. *Update* a firmware update seems to have dramatically improved the picture quality, which to be honest, was pretty poor. The screenshots below are the old picture quality, I have not had the chance to get shots with the new firmware yet since my camera is installed outdoors at the moment.

    Here are screenshots (resized to 1280, but you can click on them to get the full original size). Again, these are very poor quality and a new firmware fixes those:






    Wansview K2

    This is wansview's smaller and cheaper version the K1. It's about as barebones as you can get for an IP camera: $30.
    This camera is about half the size of the K1 (on top of being half the cost), and is wifi only. Setting it up is interesting as it doesn't use the typical methods of acting as an access point that your phone connects to, or having a side channel to configure it via bluetooth (probably for cost reasons). Instead you use the wansview smartphone app to enter your access point details and it'll emit a loud sound that encodes the Wifi name and password, which get picked up by the camera's microphone. That's a pretty cool hack :)
    To be fair, setting up the camera is a bit blind, you only have 2 LEDs close to one another and you need to send the sound sequence at the right time and hope it works, or reboot and try again. Also, don't forget that if you send a 5Ghz network, it won't work since the camera only does 2.4Ghz wifi. It worked for me on my second try, but basically you're working kind of blind. This may get a bit annoying if you're having problems setting it up, and in that case spending more money on the K1 may be a better option.

    So, for that limited price, you still get most of the typical wansview interface without any sdcard or recording support, but you can tell the CPU is slow. It's slow enough that you have to wait for the web page to load, and also slow enough that a reboot takes a while. Last, but not least the picture is only 720p, not 1080p, and when comparing a downsided picture from a K1 and a native 720p picture from the K2, the K2 picture is not as sharp but still very usable
    It's far from a perfect camera, but again, you only paid $30 (my favourites from Wansview are definitely K1 and Q1). If you want a camera that's more capable, the K1 is a very good small camera, so get that one instead. The choice is yours :)

    Here are the screenshots in native 720p:








    Using cameras outdoors

    I'm in California, so we don't have extreme weather. I use indoor cameras outdoors because the choice of good outdoor cameras with wide angles and reasonable pricing, was limited to say the least. This is probably an example of what not to do :) (but it's been working fine for over 2 years, and as luck would have it, my real outdoor camera is the only one that died after 2.5 years of use).

    Foscam FI9821W and Zavio F3210, along with an IR booster for better distance vision at night with the Zavio
    Foscam FI9821W and Zavio F3210, along with an IR booster for better distance vision at night with the Zavio

    we don't exactly have harsh winters here, or really bad rain, so part of my equipment is just outdoors under the gutter
    we don't exactly have harsh winters here, or really bad rain, so part of my equipment is just outdoors under the gutter

    I then have ethernet and power going in my yard to the malibox
    I then have ethernet and power going in my yard to the malibox

    I do use a waterproof box for equipment outside (includes an insteon iolinc to control the mailbox and flood light if you open it)
    I do use a waterproof box for equipment outside (includes an insteon iolinc to control the mailbox and flood light if you open it)

    very tight fit, but I used a 7A 12V power supply to power the gigabit switch, floodlight (12V LEDs), and 4 IP cams
    very tight fit, but I used a 7A 12V power supply to power the gigabit switch, floodlight (12V LEDs), and 4 IP cams

    this should take care of any mailbox thieves :)
    this should take care of any mailbox thieves :)

    2013/01/30 2 way talking to a Lockstate LS-DB-500R lock because the Lockstate wifi Remotelock is no good for me
    π 2013-01-30 00:00 in Computers, Linuxha
    WARNING: because lockstate is not willing to release anything about the safety of their RF protocol, you should assume that it is vulnerable to both replay attacks (i.e. a neighbour or a van listening to your unlock code, and replaying it later to unlock your door), as well as high speed code sweeps (assume that it is possible to have a custom transmitter transmit all unlock codes in a few seconds and unlock your door).

    Actually, the lock is not from lockstate, they simply resell a Taiwanese product from Ez Set which is available through other channels like QVC.

    User manual: https://support.remotelock.com/hc/en-us/articles/360001749972-DB-500R-User-Manual

    To be fair, many locks are unsafe and can be hacked. Also, the default key lock can likely be unlocked with a bump key, making any fancy unbreakable electronics a bit worthless anyway. So as long as you don't expect a high security lock for $100, let's continue... (but yeah, since I changed their key with a better one that can't be brute forced so easily, I'd feel better if I knew that the RF code can't be trivially sent by a van in the street). It's very possible that Lockstate doesn't know either and only the Ezset folks in Taiwan know.

    So, I've been wanting to have a deadbolt (not a lock since electric strikes won't work on my front door), that I can control from my misterhouse PC. For a while smarthome has had an insteon module that talks to Morningstar deadbolts, but it's not a 2 way link: there is no way to know if the door is locked or unlocked.

    As a result, I never bought the smarthome/morningstar solution since it was important to me to know that my door wasn't closed right, or closed but unlocked.

    Then, I found out about lockstate, and quickly found http://www.lockstateconnect.com/ . A wifi lock, that sounds great, right?

  • It reports local changes
  • No wiring required
  • But, then I read up more about it, and found out it wasn't actually what I was hoping for, nor is it something I can recommend:

  • It will only talk to their server over the internet. Sorry, but I don't want MY lock to report state and be controllable by a remote company
  • How well will your lock work if that company is gone in 5 years, or decides to stop supporting their lock (don't think this never happens, it has many times for other companies 5-10 years after the product is shipped).
  • I want lock updates to go directly to MY server, not theirs.
  • I want MY server to initiate door unlock right away if needed (that lock will only respond to remote events every minute or so depending on how quickly you want the batteries to die, unless someone pushes a button). This is ok for many uses, but not the 'lock the unlocked door now' required by the bug I'll explain below.
  • Right, you said lock bug?
    Yes. After some testing, I confirmed that there is a flaw in lockstate locks with auto-lock. If auto lock fails just once, because your deadbolt is not aligned with the hole (happens easily on my door if I push it too far or not far enough), the firmware will remember that auto lock is not working, and not try to auto lock later.
    The big flaw is that if you manually close the lock, the firmware is not aware of that fact, and it will refuse to autolock until you either power cycle the lock, or your force a lock event using a motor (either using the lock button on the wrong side of the door when you're inside, or using the remote control for the -R models).
    I have notified lockstate of that flaw, but they didn't seem very interested in notifying their customers about it. The fix would include having their CPU read back the microswitches state even when it wasn't given a command (probably having a microswitch event trigger an interrupt that wakes up the CPU and tells it to notice the new state and re-enable auto lock if the deadbolt just got locked ok).
    I have personally fixed that problem by having my computer keep track of the lock state and try to re-lock it using the RF remote if it stays unlocked for too long. But understand that without that, you'll most likely end up with the door unlocked sooner or later if you don't close it in perfect alignment every single time.

    Proof if you don't believe me (it has 30 second delays since I have my door auto locks after 30 seconds)

    Ok, so the wifi lock isn't it. What now?
    Well, I did go with lockstate afterall, because they did have cheap locks that exactly matched the black color motif of my door, and aesthetics was important for the WAF :)

    I bought the Lockstate LS-DB500R-RB (rubbed bronze) because it was a great deal for $100 onsale, and I knew I could very likely hack it to do what I wanted. So, it comes with a remote control, and I knew I could trivially connect its micro switches to a relay and control the door from my PC, just like the Morningstar option, but bypassing insteon and another module I'd have had to pay for.

    The more important part however was how to know whether the door was closed, and whether it was locked.

    The closed part, I solved first by simply using an X10Sec/X10RF DS10A door/window sensor: http://www.x10.com/security/ds10a_s.html . This is a wireless option working on batteries, and it will fail after 1-2 years when the batteries die, but I already have a fully working monitoring setup with those and misterhouse will tell me when the batteries are low or dead.


    Next, I just did not want the lock to require batteries, many comments make it clear that the batteries never last long enough, so I decided to hot wire the door to a power supply.
    First, I used a flat phone cable, which I painted, and only found out later that there wasn't enough copper in that cable (just a few thin wires) and it didn't have enough 'oomph' to actuate the motor, doh! So, I put a second thicker cable with enough copper for just the power, using the phone cable for the return path. I just wired the power where the batteries would go if I had put any.


    Yes, the wires fit on my door because I have a small gap. Your door may be different
    Yes, the wires fit on my door because I have a small gap. Your door may be different

    Return path you said? Yes, I found out how to connect to unused pins on the microswitches and know whether the door is locked or unlocked. You can do this easily without even soldering. See picture:


    Be very careful not to pull the gears. They are in a very specific place and you'll be sorry if you have to put them back after you lost which way they went.

    Now, if you're counting, you'll say that I had 4 wires in my phone cable, and I only used 2 to get the lock/unlock status. It would be nice if the other 2 wires could be used to tell the lock 'lock' or 'unlock', but AFAIK, this is non trivial to do since you don't want a lock to unlock by just easily shorting 2 wires on the board. This is why I got the LS-DB500R with remote control support.
    The interesting bit is that the remote receiver is in the keypad, and the keypad actually will tell the lock CPU: "I received an unlock code, please unlock". This does mean that lock/unlock can be sent over the few wires that go through the door, but I'm somehow hopeful that it's not as easy as just shorting 2 wires :)

    So, instead of explaining in long details, I'll show a few pictures on how to modify the remote control to connect it to relays. I used a small breadboard with a voltage regulator to get 3V from 5V which I have on my 1-wire relay board, and you can send lock/unlock codes by shorting one of the green wires with ground.

    note the holes for power wires, nicely labelled 3V + -
    note the holes for power wires, nicely labelled 3V + -

    finished setup with voltage regulator and power LED (since the remote will not show if it has power)
    finished setup with voltage regulator and power LED (since the remote will not show if it has power)

    And I then connected everything to my 8 Channel 1-wire I/O board from hobby-boards.com.



    If you look at the above picture carefully, relay 7 is an input relay that gets the 2 wires saying whether my door is locked. Locked shows as LED on. Relay 5 is an output relay to send the unlock command to the remote, and relay 6 sends the lock command. From there, you can watch the video showing how sending the unlock command from my PC (off camera) shows relay 5 going on, then input 7 going off showing unlocked, and later relay 6 going on for lock, closing the lock sense relay and turning input 7 LED back on.

    And this is how I got a fully locally controllable lock with lock state sense and door open sense for barely over $100 and a little bit of time.

    By the way, if you want to debug RF, the LS-DB-500R (aka Ez Set), transmits on 433.92Mhz.

    Last, but not least, the lock has another issue where it locks/unlocks the deadbolt on power reset. This is not a huge problem if you are using batteries, but with house power, that means that a power outage would unlock your door for a brief time when the power comes back up. Not so great... So I hacked mine with a Voltage regulator, put the lock behind it and also connected the batteries behind a diode to give backup power if the wall power goes away (diode stops the wall power from trying to recharge non chargeable batteries):


    Also, I figured I'd show the voltage regulator I use to power the door. My original one was a 5V Vreg and it just wasn't enough for the lock. It would often complain that the voltage was too low.
    I now use a 6V LM regulator and add a big diode that prevents both backflow and drops the voltage by only 0.3V, giving me 5.7V. The door is very sensitive to low voltage and will complain loudly if your voltage drops to 5V or less. The batteries can give up to 6.2V or so, and their voltage gets dropped to 5.5V by regular diode that drops 0.7V. The end result is that the battery voltage is always lower than the power supply, and the batteries never power the lock unless the power supply is disconnected (which in my case means a power failure):

    end result
    end result

    2011/08/03 Weather Monitoring with Oregon Scientific WMR968
    π 2011-08-03 00:00 in Computers, Linuxha
    A fair amount of people get weather info (wind, rain, and others) using 1-wire equipment, which is a pain both for having to run 1-wire to places outdoors (although I already was doing that), but more specifically because the mast the wind sensor is on is a lightening rod which has fried many people's home computers and networks.

    The simplest way to avoid this problem is simply to go wireless so that lightening does not reach your inside computers and networks. As a side note, the WMR968, while far from perfect, is cheaper than 1-wire equivalent solutions (only $200). The equivalent functionality with 1-wire is about $500

    The kit comes with solar panels that recharge your device batteries, so they're supposed to run forever (i.e. until they eventually die), and you get:

  • Indoor temp / humidity / baro pressure
  • Outdoor temp / humidity
  • Wind speed / direction
  • Rain gauge

  • wind sensor on the roof with the portable receiving console
    wind sensor on the roof with the portable receiving console

    rain sensor on top and hygro/temp sensor in the shade under the roof
    rain sensor on top and hygro/temp sensor in the shade under the roof


    little 'hack' to make the rain sensor more sensitive
    little 'hack' to make the rain sensor more sensitive

    The main thing that is nice with that kit outside of the fact that it's cheap, is that you can buy more receivers than there are in the kit (like multiple indoors BTHR receivers to get humidity in different rooms) and while the main console will not receive more than one, the rfxcom receiver I have plugged in my PC can receive as many as you can have (even your neighbours' :) ).
    This allows for having the console in the kitchen for instance, and not have to run a cable to your computer in the closet by having it use its own receiver with a bigger antenna and processing ability for many more devices (see list).

    Here is a link to all the WMR 968 graphs received from the rfxcom via XPL, with a couple of samples below:



    The only caveat is that it's a bit cheaply built, some of the outside sensors are not super water proof, so I slightly modified mine to make sure I had good water seals, and so far so good: can't beat the price and it hasn't failed for me yet :) Not having to climb on the roof to change batteries every so often is a nice bonus :)


    More pages: December 2023 August 2021 May 2020 February 2016 July 2014 December 2013 November 2013 January 2013 August 2011 July 2011 August 2010 June 2010 May 2010 March 2010 February 2010 December 2009 November 2009 March 2009

    Contact Email