With apologies to Paul Simon…
Having locked myself out of house on several occasions I decided to fix the problem with having an RFID door lock and an implanted tag. The door lock was no problem but the implanted tag gave me pause for thought. But then I thought, what is I always wear when I’m out? Shoes! Obviously whenever I’m out I’m wearing shoes!! Just put the RFID cards/tags in all of my shoes. Problem solved. Since I only own two pairs of shoes this is not too difficult to achieve. There is of course the corner case when I’m putting my bins (trash) out whilst wearing my dressing gown and in bare feet but this is unlikely to cause me to be locked out.
Ah, but not quite so easy as that. I wanted to build the entire system myself. I’m not one to be happy to buy a system that, almost, does what I want. I want a system that does exactly what I want. Did I mention I also wanted a bluetooth interface? Anyway, I do, so I can open the door with my Android ‘phone. Also I can give people guest access. Not that I ever have any guests these days.
Anyway, it’s now built and installed, so I can open the door with my shoe, key, wallet or ‘phone. I need never climb over the neighbors wall again. Which is a bit risky late at night as there’s a large drop into into the next terrace’s garden, being as I live on a hill.
Technical details follow: Obviously some variety of Atmega(8) was going to be involved. I found some really cheap Chinese RFID readers, (I bought two), that output Wiegand code plus a really cheap bluetooth module, add an electric door catch and I was set to go. A bit of wiring and programming later, combined with some cheap RFID access cards, I have a custom door lock that I can open with my shoe. Total cost approx £22. Labour is not included as I count it as a learning asset rather than a cost.
Also handy if I’m ever laid up in bed and I need to open the door for visitors via my laptop or ‘phone. Giving out key cards is not an issue either as I can always cancel them when I decide they are no longer welcome to my domicile.
Following on from my comuting on the cheap trend. Some time a go I bought a cheap 32GB SD card from the well known on-line shopping site. It didn’t work very well in my Android ‘phone, so I bought a smaller and more expensive one. recently I decided to test it, yes I still kept it even knowing it was a pile of crap. I downloaded f3 from http://oss.digirati.com.br/f3/ and ran it on the card, output below.
Free space: 29.94 GB
Creating file 1.fff ... OK!
Creating file 2.fff ... OK!
Creating file 3.fff ... OK!
Creating file 4.fff ... OK!
Creating file 5.fff ... OK!
Creating file 6.fff ... OK!
Creating file 7.fff ... OK!
Creating file 8.fff ... OK!
Creating file 9.fff ... OK!
Creating file 10.fff ... OK!
Creating file 11.fff ... OK!
Creating file 12.fff ... OK!
Creating file 13.fff ... OK!
Creating file 14.fff ... OK!
Creating file 15.fff ... OK!
Creating file 16.fff ... OK!
Creating file 17.fff ... OK!
Creating file 18.fff ... OK!
Creating file 19.fff ... OK!
Creating file 20.fff ... OK!
Creating file 21.fff ... OK!
Creating file 22.fff ... OK!
Creating file 23.fff ... OK!
Creating file 24.fff ... OK!
Creating file 25.fff ... OK!
Creating file 26.fff ... OK!
Creating file 27.fff ... OK!
Creating file 28.fff ... OK!
Creating file 29.fff ... OK!
Creating file 30.fff ... OK!
Free space: 0.00 Byte
Average writing speed: 913.84 KB/s
[mikee@saxicola f3-2.2]$ ./f3read /run/media/mikee/77ab21a2-818a-472c-81cf-f8a73e9c3de7
Validating file 1.fff ... 414704/ 1682448/ 0/ 0
Validating file 2.fff ... 0/ 2097152/ 0/ 0
Validating file 3.fff ... 0/ 2097152/ 0/ 0
Validating file 4.fff ... 0/ 2097152/ 0/ 0
Validating file 5.fff ... 0/ 2097152/ 0/ 0
Validating file 6.fff ... 0/ 2097152/ 0/ 0
Validating file 7.fff ... 0/ 2097152/ 0/ 0
Validating file 8.fff ... 0/ 2097152/ 0/ 0
Validating file 9.fff ... 0/ 2097152/ 0/ 0
Validating file 10.fff ... 0/ 2097152/ 0/ 0
Validating file 11.fff ... 0/ 2097152/ 0/ 0
Validating file 12.fff ... 0/ 2097152/ 0/ 0
Validating file 13.fff ... 0/ 2097152/ 0/ 0
Validating file 14.fff ... 0/ 2097152/ 0/ 0
Validating file 15.fff ... 0/ 2097152/ 0/ 0
Validating file 16.fff ... 0/ 2097152/ 0/ 0
Validating file 17.fff ... 0/ 2097152/ 0/ 0
Validating file 18.fff ... 0/ 2097152/ 0/ 0
Validating file 19.fff ... 0/ 2097152/ 0/ 0
Validating file 20.fff ... 0/ 2097152/ 0/ 0
Validating file 21.fff ... 0/ 2097152/ 0/ 0
Validating file 22.fff ... 0/ 2097152/ 0/ 0
Validating file 23.fff ... 0/ 2097152/ 0/ 0
Validating file 24.fff ... 0/ 2097152/ 0/ 0
Validating file 25.fff ... 0/ 2097152/ 0/ 0
Validating file 26.fff ... 0/ 2097152/ 0/ 0
Validating file 27.fff ... 0/ 2097152/ 0/ 0
Validating file 28.fff ... 0/ 2097152/ 0/ 0
Validating file 29.fff ... 0/ 2097152/ 0/ 0
Validating file 30.fff ... 18320/ 1896544/ 0/ 0
Data OK: 211.44 MB (433024 sectors)
Data LOST: 29.71 GB (62299248 sectors)
Corrupted: 29.71 GB (62299248 sectors)
Slightly changed: 0.00 Byte (0 sectors)
Overwritten: 0.00 Byte (0 sectors)
Average reading speed: 14.89 MB/s
Yep, of the claimed 32 GB it managed to corrupt 29.71 GB. None of the test files were uncorrupted, not a single one. Also note the that the write speed is very slow.
F3 is also on GitHub at https://github.com/AltraMayor/f3
I went on a one day Arduino course last week, just for fun, and it got me thinking. I’ve been developing stuff on raw Atmega chips for a while, long before this new-fangled Arduino thing existed, back in the day when you had to write your own display and serial drivers. Anyway, I bought an Arduino Uno Rev3 on that well known on-line auction site at a very reasonable price. And all was well with the world. The Arduino SDK worked with it just fine. But then…
I decided I wanted to use my (homebuilt) STK200 programmer with it so I can use my old code without having to convert my (proper) C code into something called a “sketch”. It didn’t work! Using the JTAG pins I kept getting errors from avrdude that it was the wrong chip!! Further investigation was abviously called for. Looking up the spec for the Arduino I see that it calls for an Atmega328P-PU, looking at the chip on the Uno I see a Atmega328-PU. No “P”. The P designates it as a pico-power chip that’s otherwise identical to the regular one. Basically it has a lower current requirement.
Now the higher current consumption could possibly be an issue for someone using a Chinese Arduino for a battery powered project, or if they are push it to the limit on peripherals and CPU usage there may be an impact on the power supply and on board voltage regulator. I’m assuming, without checking, that these would be over specified anyway.
The main issue was I couldn’t upload any code. As by now I’d messed with the bootloader and neither the serial upload using the Arduino SDK or the parallel, STK200 worked. One wat thought is was a m328p chip and refused to upload, the other way thought is was an m328 (no ‘p’) and again refused to upload. The problem and solution lay within the various config. files used by the SDk and avrdude. On Linux there’s a config file in ~/.arduino name preferences.txt. First this had to be edited to get the STK200 working.
In ~/.arduino/preferences.txt change:
and lower down the file,
Next edit /etc/arduino/programmers.txt to add the STK200 programmer to the arduino list by adding the following to the bottom of the file.
Then as root again we need to edit /etc/avrdude/avrdude.conf by adding another section for the ATmega328. Because there isn’t one for the -m328 at all, just the -m328p! Do this by copy/paste the ATmega328P section, editing the descriptive fields and changing the signature to 0x1e 0x95 0x14 from 0x1e 0x95 0x0f.
So three files have to edited to get these cheaper Aduinos to behave. To be fair most people could happily program these with their “sketches” via the Ardiono SDK and never know the difference. Some of us though aren’t satisfied with that and want to get our hands/brain inside the little beasties to tweak and trim as we please without the nice comfort of it all being hidden behind the niceties of the SDK. I’d save a couple of quid but it cost me in time. Still all learning is good and I consider that time well spent.
Click image to enlarge.
Ok, I had help. It’s a Model Avro DH9 WW1 bomber destined for the Imperial War Museum. Build in Narberth by Autodromo Ltd.
Ah what fun it was, I thought I was going mad, then again perhaps I was. I’d mostly installed a utility on my local webserver; three php pages. All it had to do was talk to my MySQL server and send a mail out to subscribers. My maillog looked like this:
Jan 15 19:43:53 host postfix/sendmail: fatal: open /etc/postfix/main.cf: Permission denied
Jan 15 22:21:30 host postfix/sendmail: fatal: open /etc/postfix/main.cf: Permission denied
Jan 15 22:27:39 host postfix/sendmail: fatal: open /etc/postfix/main.cf: Permission denied
No matter what I did with postfix’s config it wouldn’t send mail. Yet I could send mail from the command line. After a loooong web search I discovered that SELinux is the culprit, yet again. A temporay disable of selinux using:
setenforce permissive proved the point. But this is a web facing server and I didn’t want to disable SELinux and let all those nasty crackers get into my server. Oh what to do. Of the many command I tried it seems to be
setsebool -P httpd_can_sendmail on
that fixes it.
Along the way I also did:
setsebool -P httpd_can_network_connect=on
semanage port -a -t http_port_t -p tcp 25
But I’m not sure these were the critical commands to get this working.
Eventually I’ll have to migrate this to a real server. What a fun day that will be.
Python doesn’t have multiline comments, but triple quoted multiline strings are often used as comment blocks. These “comment blocks are enclised by triple quoting ”’ like this ”’. Geany, or more specifically Geany’s editing component Scintilla sees anythin inside quotes as an ordinary string and colours them accordingly. This is OK but it’s not ideal behaviour as I want my triple quoted blocks in comment colour.
I filed a bug at https://sourceforge.net/p/geany/bugs/1020/ then I withdrew the bug as not-a-bug, because it isn’t. It’s just that I required different behaviour to the standard (correct) way. The very usefule replies to my non-bug did fix my issue with the following suggestion.
First you need an alternate colour scheme in ~/.config/geany/colorschemes, I use geany-tango-dark.conf as it reduces eyestrain for me. In that file add a line triple=0x43D731;0x2e3436;false;false, It doesn’t matter where but I put it just below the comment group. Then in filetype.python add triple=triple in the [styling] section. Close and restart Geany. You should now see your multi-line strings/comments in the comment colour.
If this doesn’t suit your way of working, don’t do it. Don’t complain to me about it or tell me I’m doing it wrong.
The original logger has now been retired with a much neater single board. The old one, pictured, was much too fragile and only had a single input. Modifying it would probably have broken it so a new one was required.
Carried a hi hat and stool to a rehearsal. Tough life this.