Project Debian

IMG 3302

A short while back, while I was working on my KiCAD project; I had to create a Debian VM to finish up work on the PCB. Why did I pick Debian? Well, I have several Raspberry Pi’s around the house and so I have used it and am comfortable with it. 

Sidebar: While a Macintosh user since 1985, I have always had a curious spot for UN*X. It started at university. While they had PC labs setup, they were often full or busted. And they hadn’t installed the Mac lab as of then. The Sun workstation lab always seemed to have at least once seat open. From there it just seemed to grow, my interest in UN*X. I longed to have a NeXT Cube (which I do now). I did install Apple’s version of UN*X. Oye Vey, that was a monster and I forget how many floppies I loaded onto that Mac IIfx. I was amazed when Linus came out with Linux. The first version I installed was on some tossed aside 386 and it took a small stack of floppies. When Steve brought NeXT to the Mac that was the cat’s meow!! I have been pretty happy every since with my BSD based Macintosh. 

So why this, why now? The original goal is to have a permanent Minecraft server believe it or not. I have been trying to use one of the Pi’s for the server, but it keeps getting roped into a project, experiment, or something. I stumbled upon an old, used AMD box. Since I don’t need much in the way of horsepower; we won’t be gaming or doing any serious work with it, I thought it would work out just fine. I didn’t want it to be so old that it wouldn’t really be useful. I have tried using an older iMac and Mini, both core2Duo and neither worked out very well and were abandoned for other projects and sold on eBay. 

The old PC I am starting off with is the:

IMG 3301

Lenovo Thinkcentre 

• Phenom II X2 B53 (2.80 GHz) – Kept
• 2 GB DDR3 – added to
• 320 GB HDD – kept, upgrading
• Windows 7 Professional 32-bit – SO GONE
• ATI Radeon 3000 – kept, tired to upgrade

The computer didn’t come with wireless and my router is too far away to tether it. I found an old Asus USB wireless adapter. It worked right out of the box with Debian, which was really nice to see. I was expecting to be tracking down drivers and troubleshooting the installation. The throughput isn’t the greatest, but for setup right now it is doing its job. 

2GB of RAM got me through the installation, but it was a little doggy when setting it up. I was able to find 2x2GB sticks of extra RAM so I added it for a total of 6. It seems quite happy now. Update 15 Aug: While digging around my Studio I found 2 2GB sticks of RAM from when I upgraded my Mac Pro. Woo-Hoo, now it has a total of 8GB and should be good for the future!!

The drive is old, and to be honest that 5400rpm shows when booting up. I am looking around for a bargain SSD drive to replace it with. Car repairs come first, so instead of a shiny new SSD, I found an old, new stock, still sealed, Apple 250GB Server SATA drive. It will work much better for now. 

Windows was ditched right away. I didn’t know the password to the system, so I just popped in the Debian 9 (Stretch) minimal install disc and went from there.

OOoo – shiny penny moment. . . 

I found a Radeon 6350 card in a box. Hey, not much of a card, but a little step from the 3000 on the box now. I installed it quick to see if it would just work or if I would have to play around. I had to play around with it just to get it to fit in the chassis. LOL.

 

SP Card

It worked, just not at a decent resolution. I found a couple of sites with drives and installation suggestions, but I decided to just take it out and keep on going. In the end this will be a headless box sitting someplace quite. If I need to get to it there will be the VNC. It would have been nice, but I will leave the distraction for another day. 

IMG 3325

 

I have been taking some notes during my installation. I started with the Debian Minimal setup, so I have been going through updating and installing the software I will need for my endeavors.

Here is one of the well, done guides I found in my research for setting up this box. Here is a second one. About the one place I deviated from both installs is that I just installed everything on one partition. I understand the reason behind it, but I just toss it all on one. I may learn a Linux lesson the hardware down the road, that will be ok. 

Before I go too much further I need to make a snapshot, or quick clone of the drive. I am hoping it will be as easy as Super Duper or CCC on the Mac. To date, I am quite please at how easy all of it has been to setup to date.

The Agenda for tonight:

  1. Snapshot debian install to date
  2. Install git
  3. Install sudo
  4. Install 
  5. Install Java
  6. Install Spigot
  7. Setup Spigot
  8. Testing 

Near-term

  • Firewall     
  • VNC server, tigervnc
  • ?

Adventures with KiCAD

I have been threatening to learn KiCAD over the past months. I finally sat down for a week and went through the Contextual Concepts tutorials. They are very well done. I also referenced these other web sites. 

Getting to Blinky 4 from Contextual Electronics. This one really goes through all of the KiCAD processes. They also have a newer, down and dirty, how to create a PCB with KiCAD. This one is called Shine On You Crazy KiCAD

KiCAD Like A Pro from Tech Explorations was also a great reference when I needed to find a quick command or how to do something. 

Wayne and Layne – It is for older versions, but the basics for PCB building are there. 

 

I have a couple of projects coming up using the ATTiny series of micro controllers. Having tired of fussing with wires and a breadboard, I decided to dedicate an UNO for programming. And at the same time design and have fabricated a programming shield. 

Atty shield 3d

The schematic is simple for the first version. I have all of the programming pins in place, an LED for testing, and all of the pins broken out so something more complex than a LED can be tested, such as a sensor. 

Att sheild schematic

During the process of running the traces on in PCB I ran into an issue with the Mac trackpad where the cursor would go off with a mind of its own. I tried with just a mouse and had the same issue. I read up on the issue and saw where others have had the same thing. Having worked in tech for 30 years now, I know when to find an easier path to my problem. I already Debian Linux from having Raspberry Pi’s around the house, so I just downloaded version 9.x, and created a VM in Parallels, and loaded up KiCAD 4.x. To date it has been running fine and was able to finish up the project using my KiCAD VM. 

Att shield pcb

 

I completed my first PCB of my own design and effort. I generated the gerber files for production. In my research I also found a good site to use, https://gerblook.com. You can upload your gerber files and they will generate an image of what it will look like. And as in my case, find out if there are any error before you send them off. I forgot to turn on a layer when I generated them, and it barked about it. I went back and fixed the error and tried again with success. Then I sent them off to OSHpark.com already. I received an email that they are off to manufacturing and they should arrive in about a week and a half. I will be sure and update on how they turn out. 

This is just version one of this project. I am already working on some improvements and modifications for it coming up here in the near future. And since practice makes prefect I also have two more Christmas projects. I figure if I start now I should be able to finish them up just about the Christmas season is upon me. LOL.

What’s new. . .

 A quick update as to what I have been up to before I start to write and edit the individual pages. It seems like it has been forever since I have posted, but it has only been a week or so. 

The weather has been more than a little bipolar in this neck of the woods. 

I making some changes to the site. I have added some new pages and ideas to fill them with. 

Here is my quick list of what I have been up to. . . 

• Drywall and tiling the bathroom. 

• Network clock 

• Neopixel / ESP8266 controlled night light

• The House of Pi’s.

• A list of ATTiny projects I am really looking forward to. 

And I know I will find a couple of more things to add in yet. 

A Test in Time – Updated

A Test in Time

My Clock Making Adventure begins. . . 

IMG 2228

Clocks seem to be one of the good-ole-standbye projects. And why not? They are useful and it is easy to get creative with them. In this post I show you how I have started on my journey of time. 

I have looked at my options for keeping time. Micro controller a yes and then a time source. Micro controllers themselves are terrible timekeepers over long periods of time. A popular option is an Arduino Uno (or other such board) and a RTC (Real Time Clock) such as the DS3231 or DS1307. Once it is configured, it does keep time quite well and over a long period of time. It uses a backup battery to keep time if power is lost. There is some drift in the clocks, but over a year it is fairly small. 

I played around with RTC on a Nano, but lately I have been playing with the ESP-01. It is a fun little chip. It is part of the ESP8266 family. I found my controller and way for time, NTP (Network Time Protocol) to keep accurate time. The ESP requires an active internet connection for it to keep time, which is the con(?) of this project, but the time is kept spot on. 

I have used the LED and OLED displays in the past and like using them. In this project I wanted the display to be simple. My main focus is to learn about time. The packet getting the time, picking the packet apart, and displaying the correct time for where I am at. For that purpose I picked a 4-digit, 7-segment display using a TM1637 chip to drive it. And I had one in my displays drawer. 

IMG 2134

 

From the schematic above the pin to pin table is:

      Display -> ESP-01

  • CLK -> IO2
  • DI0  -> IO0
  • Vcc  -> 3.3v
  • Gnd -> Gnd

As a quick test here, you can plug everything into 3.3volt power and the display should read 0123. Now it is time to move on to the code. 

I am not sure where I found the core time code I am using (if anyone recognizes it let me know and I will give due credit), but I started with a code base that would get a NTP UDP packet from a NTP time server. This method does not use one of the NTP libraries, but relies on decoding the packet and calculating the time. One other feature I added was the WiFiManager library. It is a wonderful addition to any wireless project as it makes setting up wireless a breeze and you don’t have to have people edit the sketch. I like to give away some of my projects and this makes it easy for the people I give the to. All they need is a web browser to set it up and get it running. 

IMG 2332

I stared around the workshop for two nights trying to come up with a clever display for the second attempt at dead bug soldering. This time wasn’t as successful. I do admit there wasn’t much planning involved. I started started bending wires and winging it. Next time I will have to do a little more planning as this example is something I am impressed with. 

deadbugheadphone

I finally found something that is half whimsical and half just sad, but it will display my little clock until I can (or a family member) come up with something more suitable. 

IMG 2354

 

My code can be found over at my GitHub

Taking a break. I will be back to update this soon. . . 

New Wireless!!! Linksys Velop Review

Home Wireless Upgrade to the Linksys Velop

A confluence of circumstances recently had me upgrade my home wireless. It has been on my plate the past few months as my connection in the basement is up and down like The Beast, there is no connection at the other end of the house, and standing outside; forget about it!

I have been doing my homework while waiting for the right time. In one of my careers as a Network Engineer, I spent a lot of time supporting wireless; enterprise wireless. 2 controllers and over 900 access points, thousands of devices per day, yet at home it was the dark ages. I tried a couple of remedies such as wireless extenders (worthless) and playing with OpenWRT to see if I could tweak the settings to pull out a little more life from the aged Netgear 600. 

I knew from my quick survey out of iStumbler that the airwaves were getting a little crowded.  

OldNetworkPeek

 

Once iStumbler confirmed what I already knew, I brought out Chanalyzer to take a closer look. Yikes, that is some dirty air out there and 2.4GHz is a wasteland. I already knew from my experience that 5GHz was a necessity!! All of my major devices are Apple and ready for 5GHz. Having AC on board the access point would be a nice addition as it is the up and coming next standard. The 5GHz range is looking quite nice in my area right about now, so it is a great time to move in. 

HomeWiFI Analyzer

Knowing I have to cover my whole house and I also want it to bleed outside by the pool and porch, multiple access points would serve my purpose. Part of the enterprise setup I had my hands in also used a series of access points that didn’t use a main controller per say. There was one that acted as the controller for all the others, creating a MESH network. It was pretty cool and kept the cost down for our remote sites; but the price was still out of range for home. Then last fall I started to read about MESH networks for the home. Now this is something I can get on the band wagon about. 

Reading over the specs for all of them I believe that the Linksys Velop it on top of the stack right now. At least for my wireless upgrade it does. It has 2.4/5GHz (some other brands only work with 2.4, yikes) b/g/n/ac. The setup really is, almost as easy as they claim. 

I am still reading up on how the do their backhaul between the APs. My understanding so far is that 2 of the channels are bonded for speeds to the clients and there is a single 5GHz channel for talking between the two. And after seeing my iStumbler chart from above, I have some other questions as well. 

After unboxing them, I placed the new one, right where the old one sat; right next to the cable modem. I wiped out my phone. side note. at work i actually bothered to download the manual and read it. yes it was the simple users guide, but i was able to make sure i was doing everything right to get it working, i can dink later. oh and i also installed the app so i was ready to go. I fired up the Velop app and just like the screen said it took a couple of minutes for it to find the access point and link up. Once I had the first one up I wandered around the house to see how it was. WOW, I was impressed already and there was only one AP up. I had signal in the kitchen and some outside! A small victory. 

Now to place the second one. I already had a place in mind for it. Velop has other plans and they are kind of hit and miss in my opinion. I first started with the AP in one room over, up on a shelf. So it was going through 2 2×4 drywalled walls, about 40-45 feet away. Nope it complain that I need to try closer. It was during this time, setting up the second one that was most frustrating. The progress bar is honest when it says it will be a few minutes. And it also took out my iPhone a couple of times. By 1:30am I gave up on the second one. It was late and I was frustrated. 

The next day I gave it another try after and fresh cup of joe. This time, the last time, I place it with one wall and about 30 feet between the two. Shazam! The two started talking and doing their thing. 

IMG 2053

Wireless, I am now King of the Hill on my end of the street. The drops in the basement are gone. I can surf from the car, through the house, and out to the pool. The speeds are very nice between devices, especially for backups. After having it up and working now for a little over a week, the whole family is very pleased with the results. 

HomeWiFiPeek

My Valentine’s Dead Bug

*** This was a quick copy and paste. I will be back to edit it soon!

 

This was one of those projects were I had a good idea in hand, but by the end it turned out quite different; and I am quite pleased how it turned out.

I wanted to make my Wife something nice this year for putting up with my various projects. Those on the “list”, those in planning, those in progress, those finished, and some abandon.

My original idea was to cut a heart out of wood, mount the 8×8 matrix in a hole in the middle, and mount the ATTiny on a PCB somewhere. I couldn’t make up my mind in front or back. While those ideas where being pondering and experimented with, I started on the hard part of the project.

I looked in my stock as I had both the ATTiny85 and 8×8 matrix handy. Wow, that seemed like a first, I didn’t have to order anything. I hadn’t really used the matrix before so I downloaded the Adafruit libraries and hooked it up to my Uno clone and started to play around. I used both the Adafruit_LEDbackpack and Adafruit_GFX. The animations are pretty straight forward. You have to create your image with 0 & 1’s, then call each of them as you need them. 

Here is an example from my code that shows part of the heart being drawn, it is the center square.

<span style="box-sizing: border-box;"> heart2_bmp[] = </span><span style="box-sizing: border-box;"> { </span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">B00000000, </span></span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">B00000000, </span></span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">B00000000, </span></span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">B00011000, </span></span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">B00011000, </span></span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">B00000000, </span></span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">B00000000, </span></span>
<span style="box-sizing: border-box; margin-bottom: 0px;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">B00000000, </span>}, </span>

Text scrolling is straightforward, but for those who are new, lets pick it apart a little bit and see what is going on.

<span style="box-sizing: border-box;"> <span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">matrix</span>.setTextWrap(false); </span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672;">matrix</span>.<span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">clear</span>(); </span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672;">for</span> (int8_t x=<span class="hljs-number" style="box-sizing: border-box; color: #ae81ff;">8</span>; x>=<span class="hljs-number" style="box-sizing: border-box; color: #ae81ff; margin-bottom: 0px;">-100</span>; x--){ </span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672;">matrix</span>.<span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">clear</span>(); </span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672;">matrix</span>.setCursor(x - <span class="hljs-number" style="box-sizing: border-box; color: #ae81ff;">8</span>, <span class="hljs-number" style="box-sizing: border-box; color: #ae81ff; margin-bottom: 0px;">0</span>); </span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672;">matrix</span>.<span class="hljs-keyword" style="box-sizing: border-box; color: #f92672;">print</span>(<span class="hljs-string" style="box-sizing: border-box; color: #e6db74; margin-bottom: 0px;">"1 short text"</span>); </span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">matrix</span>.writeDisplay(); </span><span style="box-sizing: border-box; margin-bottom: 0px;"> delay(<span class="hljs-number" style="box-sizing: border-box; color: #ae81ff; margin-bottom: 0px;">100</span>); </span>

To start, the text shouldn’t wrap as a message will be scrolling across the matrix. The first variable, x=8 is where the text will start to scroll across. This example starts on the right and moves towards the left. x>=-100 is allowing room for the characters. I took the total number of characters in my text message and multiple it by 9 and the text displayed correctly. If you miscalculate you might not see the whole message. This happened to me as the original message was about 4 characters and the value was 96. My message was much longer, but I hadn’t changed the 96. Once it was bumped higher all worked out well.

I was using my Uno clone to do the testing. It is just much quicker to make a change and upload it quickly. Everything was moving along great, but I noticed one thing, the message wasn’t oriented right, it was a bit upside down.

There is another command that comes in useful.

matrix.setRotation(<span class="hljs-number" style="box-sizing: border-box; color: #ae81ff;">1</span>)<span class="hljs-comment" style="box-sizing: border-box; color: #75715e; margin-bottom: 0px;">;</span> 

With it you can rotate the screen in any of the four directions depending on where you need/want the pins to orient. Setting it to one put 0,0 in the upper, left-hand corner, with the pins pointing downward. Or as in one part of my code I use the rotation to spin the heart.

Now is was time to program the ATTiny. I do like working with these little guys. They work quite well in a lot of my projects and can take up a lot less space than an Uno. There are some great guides out on the net on programming the ATTiny family of processors. The only hiccup I had was dealing with the Wire library.

While libraries might be compatible within the ATMel family of chips, there is the space consideration. And the ATTiny85 doesn’t have the room of its big brother. There is a Wire library that was made just for the ATTinys, it is also from Adafruit. WireTinyM. Once I updated that it worked much better. I left in both for when making changes and updates. Depending on which one I am using I can just comment out the other. 

During all of this I am still pondering how to make the mount for all of my little bits. I start to look at the 8×8 and the Tiny and figure what the hay. There are only 4 pins that need hooked up. And this would probably look way cooler than protoboard as there is no time to get a PCB fabricated and delivered. It seemed to so simple, 4 pins to 4 pins. It took a couple of tries in trying to find what might look best and also work the best.

Well, it struck me. It had earlier, but wasn’t too hip on the idea at first and then it just started to grow on me the more I thought about it. I got myself a length of electrical wiring. I had a length of 3-wire left over from a kitchen project. I pulled out the ground wire and bent it in the shape of a heart. I would then just be able to hang the matrix and Tiny from the top of it. Shazaam!

After that it was a matter of finding a base (a birch log part that was from a wedding center piece and some Lake Superior lake shore rocks).

Oh last but not least, I had to power it. I was going to use USB cable, but no, that would be just too much hassle. AA?? Naw, too many and won’t last too long. Hey, I have one of those lipos at 3.7, I wonder if it would work? I know the ATTiny will work at 3.3V and that data sheet states the lowest power the for the matrix is 2.7. What the heck. I wired up a JST battery connector and plugged it it – DONE!

SCHEMATICS 

Img 1853 3hpmbc0wrk