Sunday, December 31, 2017

Power Supply Build

Finished a project that I'd been working on for too long. A power supply. I built the kit at one point and liked it so I wanted to put it in a professional looking case. It needed a cooling fan though as well. I think I got the kit from Bangood as well as the kit, and I think the case. By itself the kit isn't bad. two rotary encoders set the voltage and current clamps, the LCD screen gives you pretty good feedback. but the problem is that the power transistor doesn't have a thermal sink with the kit. There is a second kit available that does this. So I picked that up. works great except.. if I put the fan on top of the thermal sink, it was too tall for the case I picked out. Additionally, the kit didn't come with a transformer. That was an easy fix though. Essentially, I wired the encoders to the control board. so the control board is behind the LCD screen. then the outputs are just right next to it. I've some knobs on the way, aluminum. But I think they will take awhile. So I decided to just post this now before I forget. I'm pretty proud of how it turned out. Simple, functional, and fun.

Monday, December 25, 2017

Updates and backups and logs oh my!

I run Linux on my laptop. So when my daughter said she needed a laptop, I pieced one together, dropped Linux on it and handed it over. She took it home... and let me make this clear... she took it home. How to do upgrades? She isn't a technophobe, just lazy. So I thought, what if I wrote a script, that configures her laptop to handle updates, backups, then emails me when it's done.

That sounds ambitious. So lets find the best way to do all of this together.

so for backups I use

tar cvpzf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys /

this puts a backup tar in the / folder (we have to start there too)

so we can say

# let's talk to the lUser and let them know it's gonna take awhile
echo HI, I just need to do some configuration stuff, Please wait until I'm done
echo This will take a bit probably

:wq out of that and then change the permissions
chmod u+x updatescript

that allows it to be runnable.

I'm adding an option to shutdown when I'm done. something like


if you use shutdown = true, it will try to run the command shutdown. That's not what we want, we want a bool shutdown that is initialized to true. Conversely, (and we may use this later) delete a variable with unset so unset shutdown, deletes the variable shutdown. We don't want that so we are just going to shut down by default, but ask if she wants us to leave it on.

echo would you like to shutdown on completion?

Windows NEEDS a reboot usually, Linux not so much. Thats just so that she has the option to come back to what she was doing the night before, or see that it's shut down and know it's done. so now we need to read in her answer. so I'm going to let her type in her answer and read it in and check it. so

read shutdown #important to note that c based programmers will pull their hair out with lack of ;

now you can
echo $shutdown

at this point you can read in anything to shutdown. If you type Floppychoppydingdang that's what that will save in the variable

So the NEXT thing that needs to be done, is to parse the input and decide if she wants it shutdown or not... or if one of her kids is banging on the keyboard again.
That sounds like another day.

Sunday, November 26, 2017

forays into the IOT

I've long been interested in the IOT. I've been running a server (ssh port only) and have been tinkering with it more than anything. MySQL, C++, writing my own makefile. Much of this I'll try to remember to document here. I've not been idle so much as horrible at documentation.
I bought this awhile back it came in, and if you think about it, it's awesome! The relay can handle 10A, 120V so it can turn a lamp, or more on and off. Plus, it can do it via wifi. This is an awesome jumping off point, since most of the GPIOs aren't being used. According to linux I'm going to try to use a Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light
basically a some uart I picked up from China. So when I power this up and look there is a network AI-THINKER_####X# and I can connect with a password ai-thinker. Has port 80 open, and when I open it up... nothing. Empty webpage. Blank canvas. 

So with that, the fun will begin.

Saturday, January 9, 2016

Another Software reload

So for those that don't know, last time I went to update my OS things went horribly. I moved my windows partition, and it didn't like it. So I loaded Ubuntu desktop, installed Xfce, and then deleted Unity. This for some reason was very bad. on boot up it would give me errors and rarely would it shut down with out a cpu timeout. Requiring me to hardshutdown almost EVERY TIME. Needless to say this made me unhappy. So while I was on Staycation I took the opportunity to reload software. This time I was determined to do it right... or at least closer to right.

First off I installed Ubuntu server. Next (I don't know why I was surprised) I had to add my wifi and manually bring up my wifi card. It wasn't hard, just took me by surprise. Next I installed Xfce4. Some tinkering and now that works as expected. Then installed just the packages I wanted from synaptic. 

So far so good. It boots up into the shell, and then I start the xfce. Often I'm doing shell work so this doesn't actually bother me. I have another laptop I'm using as a game server, it's likely I'll take time to reload that one the same way. I did however learn the importance of checking for typos when trying to connect manually to the internet at my favorite coffee shop.

So how you do this, on ubuntu is sudo vi /etc/network/interfaces. Then just add

auto wlan0
iface wlan0 inet dhcp
wpa-ssid RouterName
wpa-psk NetworkPassword

Then you just :wq out of that and sudo ifup -v wlan0. you should be able to  ping google at this point.

when I googled this there was a hot mess of answers mucking about with wpa supplican and such, that's all automagically done in the server. Don't make life harder than it is. :)