Sunday, January 25, 2015

Trade Ubuntu for Linux Mint

I realized during the recent programming activities that my linux workstations are getting too old and out of date. One laptop was Ultimate Edition 2.6 based on Ubuntu 10.4 and the other was Ubuntu 12.10. I couldn't find software to install that matched the systems. And Ubuntu has obsoleted the 12.10 because it was not a 'long term support' (LTS) revision.

I have been becoming more disillusioned with Ubuntu with each revision. Being an old unix traditionalist has its disadvantage! And I don't want it to look/work like Windoz!

Checking around, I was recommended Linux Mint Mate and KDE. Both looked much better. They have some of the sys-admin changes from older Ubuntu that I didn't agree with, but at least not the newest ones.

BUT, the prospect of downloading the install DVD, all the updates and replacing all my favorite packages through my cell phone data link was daunting.

I found OSDisc.com and had the solution. They make a business of copying software to DVDs then mailing them out to people like me that have low network bandwidth. So I ordered the latest 'long term support (LTS)' Mint 17.1. I got the live install disc for the Mate desk top and the KDE desktop in 64bit. Also I got the entire 17.1 64 bit repository, 10 DVDs and about 76GB.




Shipping to the Philippines is almost as slow as the cell phone data connection! It took about 4 weeks for them to show up. When it did, I realized that I should have been backing both systems up so I could install immediately. Oh well, another day of coping and sorting 2 years worth of data on a 500GB and 5 years of data on a 320GB drive.

After backing up and deleting lots of useless  junk, I found I was able to completely clear one partition on my primary laptop. I proceeded to install Mate on this. This time I made /home and /Data separate mountable partitions so I will not have this level of backup problem next time. But since I saved the old system I will have to eventually finish coping the good stuff and delete the rest of the old system partition.

The next step was to create a local repository of the 10 DVDs. Instructions came on the first disk. Basically, copy all the DVDs to /data/repo/ with the provided script. Four hours later, I then had a repo that looks very much like the Ubuntu 14.4 64bit repo. Then install Apache2 and accept the default config so apt-get can access the repo files

Next change /etc/apt/sources.list to use this repo instead of the network:

deb [arch=amd64] file:///Data/repo/linuxmint rebecca main upstream import
deb [arch=amd64] file:///Data/repo/ubuntu trusty main restricted universe multiverse
deb [arch=amd64] file:///Data/repo/ubuntu trusty-updates main restricted universe multiverse
deb [arch=amd64] file:///Data/repo/ubuntu trusty-security main restricted universe multiverse
#deb cdrom:[Linux Mint 17.1 _Rebecca_ - Release amd64 20141126]/ trusty contrib main non-free


Then I updated and installed most of my applications. Over one hundred packages. Next I needed to access the repo from both laptops, so figure out how to access a local repo with apt-get. I found these guides:

http://www.unixmen.com/setup-local-repository-ubuntu-14-0413-1013-04-server/
https://www.packtpub.com/books/content/create-local-ubuntu-repository-using-apt-mirror-and-apt-cacher



But the first problem was that it has been so long that I forgot how to network the two laptops without wire or hubs etc. Since I connect my cell phone directly to my primary system, and "Never" connect the navigation computer to the INTERNET I didn't think I had any way. I had purchased a TP-Link 702N WiFi Router to try to hack with linux (with openwrt). I did have a way. It turns out I got the wrong model, it should have been the 703N. So I didn't hack it and it still works as an access point (AP mode). So picking out IP4 addresses and setting /etc/hosts up everywhere, I finally got there. Lots of sneaker-net till I had ssh and hosts and all working.

Then I converted the /etc/apt/sources.list on the second laptop to access the first repo, and then it was just install, update, and add the required packages.


deb [arch=amd64] http://Nav/Data/repo/linuxmint rebecca main upstream import
deb [arch=amd64] http://Nav/Data/repo/ubuntu trusty main restricted universe multiverse
deb [arch=amd64] http://Nav/Data/repo/ubuntu trusty-updates main restricted universe multiverse
deb [arch=amd64] http://Nav/Data/repo/ubuntu trusty-security main restricted universe multiverse
#deb cdrom:[Linux Mint 17.1 _Rebecca_ - Release amd64 20141126]/ trusty contrib main non-free


It is a little slow installing over wifi compared to the local repository, but much better than the Internet here.

Tuesday, January 6, 2015

My Workspace

My workspace hasn't gotten any larger than last time, nor better organized. But it is all I have. Too many projects, too little time, too little space on the boat. It has to provide space for repairing the electrical failures of the boat, a radio station, a computer access area as well as a micro-processor development and software lab.

The closet on the left was supposed to be a hanging locker. I've added shelves and stacked lots of parts boxes on the shelves. I have to leave room at the top to turn them sideways to pass out the door.  I have the less used parts in the opposite closet behind my chair. I would love to find more of the little box with the yellow latches below! Most of the anchorages we stop in have little for sale in the way of parts. Almost no SMD parts and only older, more common through-hole parts. Shipping is only available in larger cities and then only if I think we are staying long enough to not be restricted to "waiting for the package before we can go on"!

Another parts box, with the USB sound card for xoscope, an XprotoLab scope, Bus Pirate, capacitance meter, arduinos, clones and programmers is used as a mouse pad. A 9x12" cutting board with a homemade swing arm LED lamp, soldering iron holder and pan-a-vice serves for a work area. The DVM and LED flash light (off to right on top of the HAM radio), seldom get put away.

Electronics workstation aboard the sailing vessel Katie Lee.

The HP printer/copier/scanner makes a platform for the laptop. I wish for a more reasonable solution. Above are a couple power strips with individual switched outlets, They have universal sockets for Australian, European, US and Chinese plugs. The printer, laptop charger and variable power supply are to the left as well as a 9v and 5v wall wort with the leads hanging on the left wall. Before, every time I wanted to use one, the cord was so tangled it wouldn't reach the breadboard.  The strip on the right has the adjustable temp soldering iron. The other side is usually open for the 110v appliance of the moment. Above that is a car charger outlet for 12v unregulated (12.2v to 14.3v depending on state of charge) and a terminal strip with a few open positions. I also have an old PC-power supply and the ATX breakout board from Dangerous Prototypes but the boat is 12volt with battery and solar power. It takes an inverter to get 110v to plug in a power supply to get 12 volts! I have all the current I need there too.

The high wattage soldering pistol hanging on the left wall needs a step-up transformer as it was replaced here where there are no 110v irons are for sale. The headphones are for the few times that the internet access is fast enough to listen to youtube videos. (I sure wish people would do written instructions and photos instead.) Below are the glass plates and white board for exposing the pre-sensitized pcb in the sunshine. So no making boards at night.

A small tools-toolbox holds up the fan. (It is running, the camera just stopped the action. Its 31C or88F here now.)  And it rests on a plastic cookie box full of extra USB devices. The tools include the usual I imagine. They include: close side cutters, needle nose and mini lineman's pliers, wire strippers, jewelers screw drivers, stainless tweezers straight and angled, long and short, hemostats, exacto-knife, manual PCB drill and bits, strip-board trace cutter, manual nibbler, solder sucker, solder wick, solder dispenser, flux pen and a handful of other junk that keeps the lid from closing most days.

Make an ATTiny85 Progrsmmer and Development Board

I got a few of these small cheap chips from Atmel in the AVR family, like the arduinos. Not sure why I need cheap, with the atmega328p around $4, these tiny85s were about $3 when the STM32 ARM family of NUCLEO boards are only $12. That's over 100 times faster and already a development board. It is cheap enough to put in a project or two and just leave there.

But anyway, I have a few and a couple target projects that could use a small cheap controller. Like a fridge fan that turns a small fan on to control the temperature in a small compartment. Or an automatic shutoff for the cooling exhaust fan inside the generator room when the temp drops enough.

Everybody else is making clones, so here's a go. No, really I just need a way to program a few. My programming seems to be the kind that is, change a line of code, download it, test, repeat,...for days... so I need to be able to re-program the devices multiple times without hassle.

Poking around the web I find numerous posts about programming on a breadboard with a bunch of jumper wires either from a programmer or via an arduino. Also I found a few custom boards and even Sparkfun.com has the Tiny AVR Programmer for the ATTinyx5s.  But ordering things here to the Philippines is traumatic at best.

Since I already have the Adafruit USBtinyISP AVR Programmer Kit (and several others) I don't need a programmer, I need an adapter for it. I got most of my final ideas from Arvydas and his programmer.


I decided as long as I was soldering somethin up, it might as well have a few comnnectors so I can use a prototype board to test a design easily

Here is the strip-board diagram in Fritzing.


The bottom of my strip-boards are always ugly.
Starting from upper left is the 6-pin AVR programming header. I chose it because it has +5 and GND as well as the programming signals and can power the board. Next a red LED to show power to the board. Upper right is an LED tied to pin 4 for the default blink 'hello world' program. But with so few pins available, a jumper to disconnect the LED for pin 4 in case the application wants that pin. Below it is a reset switch.

Next across the bottom are headers, arduino like, bringing out each pin as well as an extra +5 and GND. There never seem to be enough. I also thought it could support a mini shield too.

AVR AT Tiny85  programmer and development board.

Abusing Cheap USB Chrgers

A while back I found this nice looking LED clock in a local store. Of course in this part of the world everything comes with a great big 3-prong plug for 220 volts. But this time the plug was a standard wall wort outputting 5 volts.


No problem. Also around here these car-chargers are from $1 to $5 US and are sold everywhere. Since the boat is wired for 12 volts, it is the easiest power source to use.
A seventy-five cent USB charger to the rescue
So a small screw driver and here is a step-down converter from 12 to 5 volts. Just cut the wire  and clock plug off the wall wort and wire it to the USB connector. Solder on pigtails to connect to the boat wiring. Cover it with shrink wrap and finished.

Cheaper than an LM7805 and parts and much cheaper than an 220 to 110 volt step down transformer. Also it is very efficient compared to the alternatives.