Family Photo Chest Part 3: Tools of the Trade

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I am taking all my progress so far and discarding it. A lot has happened, yet not much at all. Let’s get started!

The past several weeks have been covered by me getting so far ahead on my Minecraft server, now called Button Mash. I managed to maintain a backlog of completed posts, but for reasons I will get into, I’ve run out, so here I am, “live” again.

This project has undergone a major overhaul in concept. Instead of a ready built solution, I will be facing material in a class I was unable to complete due to incompatibilities with the physical classroom environment; I will be building my site from scratch.

So far, it doesn’t look like it will be as bad as I thought it would be at first. I am going through the Flask Megatutorial by Miguel Grinburg [Link to first lesson]. As of this writing, I am on part 4 of 23. Yeah, I’m going to be at this for a while as I build up my skill set. Unfortunately, I doubt anyone would have fun reading half a dozen blog posts about following tutorials week after week, and I would get bored trying to keep them interesting. So, without much else I can do to keep things interesting, I think this project will be more of a monthly feature until I finish the tutorial. Don’t worry, there will be plenty of other aspects of the project to cover.

My main focus this week is covering the tutorial. I really do need to take it slowly, one lesson at a time until I finish the little “Microblog” project being built and I probably won’t ever deploy anywhere. The process of copying everything reminds me of when I learned Lua. One of the best ways to learn a language is to transcribe a complex, known working program.

The tutorial assumes you are using the command line, but I am using the Pro version of Pycharm. Incidentally, whenever the tutorial gives me step by step instructions for working with the command line, I need to stop and evaluate it for the IDE (Integrated Development Environment).

One of my earliest problems involved trying to get Microblog to work with Flask. That task was trivial, as there’s an option for it in the new project window.

Another, more difficult task was getting Microblog to run when I went to test it for one of the first times. It had two hard-coded URL’s to use, but only one was in seemingly in use. I ended up deleting a default “Hello World” file that was giving the false success. With the decoy out of the way, everything stopped working. The proper files under development were moved to where they actually belonged.

One of the things I did to make it work was a mistake. I don’t know why it worked or why it broke, but whatever I did, I addressed it properly later on, and only just recently cleaned up the mess I made when trying to revert a very early change.

All of my stubborn problems so far have been with the terminal/API differences. At one point, I misunderstood how things were supposed to be arranged. At another, I was unable to read the filesystem correctly, so I actually moved a few files where they should have been. Naturally, Microblog lost track of where they were.

Final Question: What is your favorite or most effective way to learn a programming language?

Family Photo Chest Part 2: First Milestone

Good Morning from my Robotics Lab! This is Shadow_8472, and I am coming right off writing last week’s post because I have more to report, and it made a nice stopping point where I left off. Let’s get started!

I started work on my first prototype during my Third Workshop visit mentioned last time. It’s pretty chill there, so I have time to absorb what I’ve read as I read it slowly.

Philomena is on a Git repository, so I did some reading up on it the week before by going over some basic tutorials. I don’t actually remember much, but I will recognize stuff faster when reexposed to it.

As a side note, something seems to be failing on my laptop. I don’t know what, but it isn’t always booting on the first try. It took up several minutes of my visit to the workshop as it went through its battery of tests. Interestingly enough, the charger passed, even though I know for a fact that it won’t charge the battery due to a failure with the power port.

Git repositories have a special file that displays when you visit their web page. The first several times I looked through the one for Philomena, I had no clue what to do. This time, I recognized a number of commands to run, but require something called docker and docker-compose, neither of which come preinstalled on Raspian, apparently.

In the meantime, Git offers two ways to “clone” or download software contained in repositories. Recommended is over https, which almost all websites use by default now, and the other was over SSH.

Fun diversion, I had a really hard time with PuTTY when it kept complaining about Blinkie’s RSA host key whenever the IP changed. In the end, I hear most SSH clients don’t care about the IP as long as its host key is on a list of known hosts. PuTTY, however, saves host keys to each hostname unless unavailable, as in my case, then it uses the IP.

In light of the sideshow PuTTY put on for me to play through, I wanted to try downloading Philomena over SSH. When I first connected from Blinkie, I got a warning about an unknown host. The key was actually pretty easy to look up and verify. I put Blinkie’s SSH public key up there, but ran into a permission wall. I used wget instead. I later confirmed my heavy suspicion that wget operated on HTTPS and found it also supports a number of similar applications.

With the file downloaded from Git, I started building the tools I need to use it. I found a nice, command-by-command article on how to install both docker and docker-compose aimed at people who are not familiar with the command line. I followed the instructions, but not to the letter: I used Nano instead of vi when I needed a .txt editor, and I chose to use sudo instead of messing round with permissions and possibly introducing a security risk I don’t fully understand.

Docker went on fairly smoothly. They even have a program to verify that everything is working. Docker-compose gave me a little trouble though when I forgot to keep adding sudo.

Situation update: I got something to work. I’m operating blind right now. All I know is that I issued a command and was able to use a browser to navigate to Blinkie’s local IP with a port mentioned a few times during setup. I found what looked like a representation of Blinkie’s file system, but I’d need to double check. One thing I do know: whatever I was looking at went offline when I stopped it from the SSH terminal.

Update 2: I’m not sure where this style of updates came into happening, but I’ll go with it. I’ve done a little more research into Docker, and it looks like a sort of virtual machine –but not quite– and I think I logged into that VM earlier. I still have much to learn.

I’ve found several video series on YouTube documenting Docker and Docker-compose. With enough luck, going through some of those will let me understand what I’m at least looking at.

Update 3: Things have developed in the month or so since I went back to my other projects. I just need to call this a section and get back next week.

Final Question: How do you usually feel when returning to a project after a lengthy hiatus?

Family Photo Chest Part 1: Project Outline

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I am beginning a new project I hopefully won’t burn out on. Let’s get started!

Twenty years ago, my father was tasked with scanning and distributing the contents of an old sea chest that used to belong to his father. Fast forward to the present day, and the project hasn’t even started. I’ve been building my skills the last couple years, and I think I can do one or two better than was originally planned.

Timeline: I’m burned out after three intense weeks on my last project. I’m two weeks ahead, and I plan on keeping that lead for now. After two weeks of this project, I want to go back and try getting the official Java on Micro Core. With any luck, this post will come out when that’s already happened.

I’ve been planning this project for a while now. Nothing to make a whole post about, but important nonetheless.

My intended finished product is as follows: Family members will be able to go to an IP address in a browser, search by a system of tags, and navigate to a specific scan’s page. Groups of pages will make scans of books easier to find, and comments on each picture will only make identifying people in each picture easier.

During my initial investigations, an acquaintance recommended Philomena, a Booru-style image board that fits the description almost perfectly. Their code is free and open source, and the license is compatible with what I want to do.

On the hardware side of things, I have a few prototypes milestones planned out.

The first milestone will be declared when I can manually upload an image and view it on the site from a separate connection. I am planning on prototyping on Blinkie, though almost any computer should do.

The second hardware milestone will be when I have the pictures stored on a RAID array for redundancy. During a visit to Third Workshop, I heard that these can be tricky to do myself, and there are cheap, reliable, preassembled units I can use.

The third hardware milestone will move the software off Blinkie and onto a new machine I want to build myself. I want to remove the innards of whatever RAID setup I end up getting and arrange them into a custom case with a different Raspberry Pi serving as the motherboard.

The main event of the project is actually scanning pictures for safe storage. I know for a fact that disorganized files are discouraging to sift through, so I want to write a script to handle scanning and uploading files. It will have functionality to define groups of pictures as they are scanned, as well as handle bulk tagging.

Skills I expect to learn in the near future: composite 3D printing with ABS, a new programming language, and a better understanding of Git and any other software I need to get Philomena running effectively. As of writing, I have already started work on next week’s post, so I may be cheating a little on that last detail.

Final Question: Do you have any decades old projects that just never seem to get any attention?

The Steam Controller: My First Impressions

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I am reviewing the Steam Controller. For anyone who cares, this post is not sponsored. Let’s get started!

I first heard about the Steam Controller in detail from a YouTube video where the reviewer said it was an amazing controller after you persevere through the configuration process, something most reviewers at the time were not taking the time to do before unloading their frustrations into a review. With that said, this post will only be a report on first impressions, and not a final review.

The moment I saw this supposedly brilliant controller on 90% markdown at $5, two thoughts popped through my head: ‘I might as well see what the fuss was about a few years ago,’ and ‘They must be moving inventory with a discount that steep. (The controller itself is discontinued). After buying, I did a little more research and found that it really doesn’t seem to like running outside Steam, but there is an open-source stand-alone driver for it that sounds like it could be a project.

I don’t have a dedicated gaming budget, so when I’m considering a new game, it needs a lot of replay value or to be culturally important to me in some way.

I’ve only ever owned a GameCube and a Wii, so I’m not well acquainted with any console controllers. I have done zero research into relative prices, so if you were after how it compares to similar products directly, look elsewhere.

Shipping took way longer than I am used to with Amazon. While I waited, I researched a little and found the thing needs Steam open to run correctly. I also found an open-source, stand-alone driver. It’s primarily aimed at Linux, but fiddling with that sounds like an educational experience. I might even like to program it to respond to Morse Code when the on-screen keyboard is up.

The unboxing was a little exciting, but reinforced my expectations to not fall in love with it right away. While the box itself felt like a paper treasure chest, the loot inside did not feel like it was worth any $50. It came with a pair of batteries, a dongle, and a dongle stand. Digging in deeper, I found a cord hidden in a blue sleeve at the bottom of the box, under the “paper foam” support. I had a little chuckle when I read that. Basically, this is a classy box that politely asks you not to throw it away.

Plugging it in, the Steam Controller feels just like a rearranged mouse. Courser control is handled with a circular touchpad on the right, but it drifts. Triggers handle the mouse buttons while the scroll wheel is on the D-touchpad on the left. Don’t expect the D-touchpad to work correctly right away. I found it scrolling the direction I wanted about 64% of the time on the first try, but circling your thumb around the outside seems to work more reliably. I don’t know it it’s learning curve or driver issues. Back and forward are on the underside of the controller on buttons I have no idea what they are called. The bumpers, analog stick, and letter themed buttons each seem to have mappings to keyboard keys.

The on-screen keyboard or “soft keyboard” is accessed by pushing the analogue stick. Each of the two touchpads are then mapped to their hand’s half of the keyboard. there are all sorts of shortcut keys on the different buttons on the controller. I won’t say I’m a huge fan. It is definitely something you can get used to –I am using it for this paragraph, then I am going back– but it isn’t like any keyboard I have ever used before.

My assessment is that the soft keyboard is mainly for when you want to enter short strings of text. Again, it’s something you can get used to, but the multiple ways of doing a few actions mean it’s simultaneously harder to figure everything out, and easier to adjust to a scheme that works for you. It’s faster than an on-screen keyboard with a mouse, but slower –at least without practice– than a smartphone or tablet on-screen keyboard.

In summary, it’s a novel controller with potential, but I am in no position to pass judgement on it. I look forward to learning about hardware drivers with this unit.

Final Question: Have you ever written custom hardware drivers before?

Minecraft Server, Week 4: Progress Backup

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I’m aiming a digital nuke at my progress on this project thus far. Let’s get started!

By the time this post goes up, I hope to have finished the whole project. As I write this post, it’s a little less than a day before part 2 goes live. I feel like I’ve made the least progress in terms of building a product, but I feel like I’ve made the most in terms of learning.

To recap: Part 1 was about assembling the hardware, Part 2 was about picking and installing Micro Core, and Part 3 was about trying to install Java and some of the things I learned that segment.

My goals for this statement only involved backup and later recovery, possibly in time for a quick transition to a working server. On one trip to Third Workshop, I spent a lot of time pacing and writing things down for what I want to save. I copied those over to a directory in a hard drive and even started on a script to automate their unpacking.

Back home, I found my files were missing. Lesson learned: Don’t trust Micro Core with things you want to keep unless you’ve finished setting it up. They will vanish unless protected.

I’d often have two or three topics I’d bounce around between. While looking for files to save, I went searching through the manual and found a more complete set of boot codes so a few things can live on my hard drive proper. While I’d love to do some possibly destructive testing around with the included file backup tool, I cannot risk it until I’ve finished my backup tools and mitigated the risk for when something breaks hideously.

The exact directory and file you can find your boot codes will vary depending on your bootloader. The Tiny Core Linux wiki has pages on a few of them, and if you ever need to know yours, try using the command “sudo ls -ra / | grep <loaderName>”. Sudo keeps you from getting a bunch of error messages from trying to look in a directory your default user account doesn’t have access to. The ls command forms the core upon which the rest of the command is built on. It means to list the stuff in your present working directory. Options come next with r meaning recursive, or all sub-directories, and a searches everything that’s hidden as well. The pipe symbol, |, acts like a funnel, taking the output of the ls command and feeding it into the next element, grep. Grep sorts long batches of data so it only displays lines containing <loaderName>.

I added a few more boot codes, tying several directories to the SSD. During this time, I learned a lot about what is supposed to go where. If I couldn’t find the answer to a question, I’d reach out to whatever help I could reach without making additional accounts. I almost made one for the Tiny Core forums, but I shied away when it would have involved logging in over an unsecured connection. My guess would have been that the site is so old they never bothered, but I think it’s just the admins not caring.

Progress overall was slow. It took me a day or two to figure out how to properly mount a drive and similarly “umount” it. (The n was left out in favor of a slightly shorter command to type.) It took a live chat session with a knowledgeable person to convince me I was looking at something in /mnt I now believe to be a mountpoint and not the automatically mounted drive.

With an ironically stabilizing system, I once again started development on my script. Each time I went to access it at /mnt/sdc1/restore.sh, I had to use sudo to get through an ownership blockade. Plus, with the geometry of the room, I wasn’t all too sure if one of our dogs was going to march right through the thumb drive. I also kept getting errors involving permission –and later ownership after I discovered the -p option– when trying to copy files there.

My next lesson was about how some disk formats don’t support Linux/Unix style ownership. FAT32 is apparently one of those formats that can, at best, only be faked. Since I was dealing with files owned by both Shadow_8472 and root, I’d need to empty off another thumb drive and research a format for them, or find another way to preserve permissions.

I must have reached out to three, four, maybe even five places for help. Somebody suggested I make a tar archive. I figured, “why not.” After all, I would be dealing with a tarball containing Java anyway.

Tar is an older piece of software with a bit of history. Its name stands for tape archive. Webcomic strip XKCD even ran a strip where they teased it for being so convoluted that sysadmins who have been using it for fifteen years still don’t know it by heart — and those commands were already fifteen years old when said admins started using them!

There are more than a few misconceptions surrounding tar. Just because something is archived, doesn’t mean it’s compressed. Zip files popularized that notion. Compression is basically squishing out repeated bit patterns for convenient transport. Archiving collects several files like papers ready to be bound into a single book. The two processes complement each other nicely, usually giving you a single file that takes up less space than the original files in their entirety.

I have no idea of the full power of tar. I just know that it has loads of features, but most of its users will never use them. I can’t help but wonder how many are totally obsolete, but included for lack of an update, or to maintain backwards compatibility.

Armed with these pieces of knowledge added to my collection, I wrote a pair of scripts to grab an arrangement of files I think I will need when I rebuild. I do have it setup to reinstall Nano and Opencss from the repository, but future versions, if needed, can be migrated to be part of the backup along with files that include things like encrypted passwords, boot codes, the whole Minecraft server directory, and more. It all gets copied into a temporary directory, turned into a tarball, and the temp directory removed.

During development of the backup and restore scripts, I stashed a copy or two on Blinky for safekeeping. I would have used one of my Windows machines, but it was just easier and had the same result to use scp to move the files over ssh between two Linux machines. I also noticed PuTTY having some interesting results when using the cat command to concatenate the contents of a file to the terminal. Normally, it keeps track of who you are logged in as to where and what directory you’re looking at right now. It would seem Raspian keeps track of that for you while Micro Core does not. I also found that using cat to show a binary that isn’t in text form could end up sending a command to PuTTY to change the window title, and even corrupt the header on the command line.

And that about brings things up to date. I changed permissions on the scripts so I have to run them as sudo, but while doing so, I accidentally removed one of them. I just so happened to have a backup courtesy of Nano… somehow. I ended up restoring from the Blinky backup, as it was more recent.

My next step is an irreversible one. I need to drop the nuke and start over with what I’ve saved. With any luck, the next post will be the full rebuild, ending with Minecraft running on Micro Core.

This (half)week’s idea sounded simple enough. Just copy the most important files away from the mess I created when I tried to install Java. One required skill snowballed into another, and before it, I had learned a whole slew of skills needed to slither along in the command line.

Final Question: I’ve been dealing with a lot of old computers lately. How old is the computer or other device you’re using right now?

Programming a Discord Bot Part 3 (of 4 for sure)

Good Morning from my Robotics Lab! This is Shadow 8472, and today, I am excited because I recently got a working prototype on my “preemptive” ban bot. Let’s get started!

First of all, I won’t claim to understand most of the stuff I’m working with, just that it isn’t as closely related to security as my last side project. If someone working all day every day could have done this project as easily as walking through a room, I would be crawling through a hole just barely my size. I’ve had a lot of help drilling that tunnel, and now widening it looks like it will be a whole lot faster.

A lot of what I did was trying to understand how Discord thinks, not quite fully getting it, getting help, and only understanding it until I needed another reminder. The long story is that I couldn’t repeat most of the details from memory. Guess what I’m basically doing right now.

I’ve been using PyCharm on my laptop as my IDE. On one of my previous trips to the workshop, Headcrash showed me how to use the debugger, but the neuances didn’t really stick. Before I went in this week, Damaged, the person who’s been helping me over Discord, helped me get through multiple hurdles, some of which should be obvious, others not so much. I was working up until right before sundown Friday, when I stopped for Sabbath.

The next night, I spent not two minutes before bed so I’d actually work on it in the morning, and got the early prototype working: I had someone on my a ban list who had never even been invited. Of course, I made a backup.

The next phase involved disarming the ban function’s “warhead” with a long comment and having it pull the target’s ID from the audit log. The function to loop over the audit log is even pretty user friendly at first glance. It was at this time I reached for a tool I wasn’t familiar with: the debugger.

A debugger is no doubt a valuable tool to know once you know how to use it. I came to a point where I had been introduced to it, but when I tried to use it, I tripped up on a small detail and took it in to the workshop. No sooner had I recreated my error and started explaining my problem than I poked around a little and figured out the answer on my own; the debugger has its own tab. I still learned a lot about how exactly this debugger works and how its interface is different than the ones I played with in the past.

At present, I have an untested/unproven candidate for my final bot before setting it loose on the real server. Right now, it can be told a bad mod’s ID and target logged unban events made by that account. When I’m done, I plan on having it tell me the names and numbers of all the people who were maliciously kicked.

Final Question: The filter for the audit log was not as user friendly as I had hopped., but not as bad as I feared (with the power of the debugger to view all active variable names and values at key points in the program). Have you ever come across a problem where the solution was on the path to that problem?

Programming a Discord Bot Part 2 (of 3? hopefully)

Good Morning from my Robotics Lab! This is Shadow_8472, and today I can taste victory on this mini-project, but as you can tell from the title, it shall be denied for this week. Let’s get started!

Last week, I talked about getting the PiCharm IDE running, and how it’s only as useful as the person maintaining it; as long as someone in the room knows what’s going on, things can get repaired when they break.

This week was another one where I went around building up my knowledge without feeling like I made any tangible headway. I keep telling people, “If I knew exactly what I was doing, I’d be done in two minutes,” and I still stand by that statement. Most of programming is figuring out how you want things to work overall, how your component parts were designed to work, and how the incomplete product actually works, then reconciling all three.

I spent most of my time studying how the async/await model of computing works. Before this week’s project chapter, I knew about multithreading and hyperthreading. All three are models for working on more than one thing at once in a CPU, and each has advantages and challenges. Imagine a computer thread as a guy at a workstation. Multithreading would be adding another guy at another workstation. Hyperthreading would be convincing two guys to share parts of the workstation they both aren’t using at the same time. “Coroutines” would be the first guy stepping aside from the workstation while he waits for more work to do and lets the next guy have a turn.

Other than that, I explored Redbot, some sort of bot to program for Discord. I ended up giving up on it for this project because it was a little expensive on the learning curve for me right now, and I’m not entirely sure it will suit my needs for now.

In the meantime, I’ve made the slightest of “outreach progress,” (yes, I just made that up to talk about when you aren’t ready for something, but try it anyway). I don’t know what’s going on, but hopefully I will know soon.

On the whole, a lot of my projects remind me of a few stories from doing trail work in Pathfinders, a youth club run by my church. One of our annual events involves working on trails at a local State park. While flattening the trail, everyone runs into rocks. Usually, they can just be relocated to somewhere nearby for drainage purposes, but every year, it seems, someone finds a rock in the way that just keeps going until it takes four or five teens to properly move it around once loose. Most of my projects feel like one of these boulders.

On the sad end of the spectrum, I was irresponsible with Blinky’s case. I ended up crushing it. Hopefully, I will get around to seeing to its repair.

Final Question: Windows recently updated. Among a bunch of stuff I didn’t bother reading, I spotted a Dark Mode feature I’m taking advantage of. Do you prefer to keep using the standard, bright theme, or will you be switching over to the dark theme?

Infrastructure Update

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I am going over a few changes to my immediate setup. Let’s get Started!

I’m afraid I have some sad news to start with. I’ve been shuttling BlinkiePie around in my backpack, and it’s finally caught up with me. Some time, some how, I wasn’t careful enough, and the case broke. Some time in the near future, it will likely be getting a dose of super glue, but I’m afraid the base will need to be reprinted. If it does, I will be modifying the case so the screw holes actually line up. If I’m feeling especially adventurous, I may even make it accept multiple models of Pi’s.

I otherwise had a few adventures this week. Neighbors were having work done on their house, and I needed to go out and about. I took Blinkie with me, and tethered it to my phone, as well as my laptop. PuTTY wasn’t fully happy. I spent a long time chasing down the supposedly different server key fingerprint, but I didn’t actually find for 100% sure. Since this is a security issue, I’m not going to share my best guess I’m about 90% sure on.

On Friday, I was expecting to spend a couple hours working on my project while my mother was working at the church, but my laptop politely asked to update like I told it to. I didn’t pay close enough attention, and I found myself stuck there for four hours so I could press F1 about three times during the massive update. I’m thankful I stayed, otherwise I was within a minute of having to leave it over Sabbath, and there are always a lot of people in the church office on Saturday morning.

I won’t say I like the update, but I won’t say it isn’t all bad. On the plus side, Windows now has a system-wide dark mode, a feature I personally find appealing. On the minus side, my laptop’s fairly old, and each new line of code it must run to keep up is that many operations not servicing the programs I want to run.

Speaking of programs to run, I went into the workshop and set up for working on Blinkie over SSH and the command line, but I was advised to install an IDE (Integrated Development Environment). I was even there an hour, and Headcrash, the guy running the place, replicated my present progress while we were talking. He talked me into installing PyCharm.

I came up with the comparison that the difference between IDE’s and command line work is the difference between a graphing calculator and a pencil. The pencil is simple, easy to pick up, and important to understand how to operate before using an IDE. IDE’s on the other hand, take care of a lot of things for you. It blasts you with so much information you don’t know what to look at at first. And the scariest part is setting the thing up. There’s a lot of help out there for my “pencil,” but there’s a lot more to break with an IDE. It felt like I was slipping into a commercial airliner cockpit with only a driver’s license. I’m just glad I had someone there to figure out what was happening when something misaligned.

This week felt like a lot of learning curve walls.

Final Questions: Have you ever used a graphing calculator (outside school)? Do you have any other suggestions for comparison?

Programming a Pi to Deter Cats: Part 8

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I am droning on with my Raspberry Pi Cat Camera project.

Any sufficiently unguarded water cup is indistinguishable from a cat bowl. I had the unfortunate experience of going through that today. I gave it to the dogs. A completed sentry would not have helped in this case, but it serves as a little reminder. Of course, as soon as I get this thing working, I’d say its expected life expectancy is about a week or two. However long it takes before my cat stops the unwanted behavior.

I had a little bit of a tangent this week. It turns out it is very easy to get distracted when you have a special effects setup. The background I had last week, a constantly updating weighted average, was very entertaining in its own right. I could jump in front of the camera and fade in as if I were a ghost. I jump away, and my image fades out. If I held still, the picture would get sharper.

I ended up researching how to VNC into my Pi from my desktop so I don’t have to keep switching out the HDMI cord plugged into the back of my main monitor. It has actually been fairly uneventful so far. My password manager takes a while to register a new password, so I paused work on that angle of the project before I could set up a virtual desktop. The reason I want that is because the Pi checks if it is “headless” or without any video outputs when it boots. If there aren’t any, it goes into minimum resolution mode, presumably to conserve on CPU power. I have sense been careful to plug it in only after a monitor is connected.

I also went to the workshop again this week and promptly learned why I should always clean up after experiments; I had tried commenting out the line to convert to grayscale, and forgot to correct it. I also learned that the differing lighting conditions defeated the semi-fine tuned settings I had for my rudimentary motion spotter, and the ghost trails were back. We also did a big one on the old code while trying to simplify the code. One major change later, and I find things going half nuclear. I was given homework: Git Hub and code cleanup.

And by code cleanup, I mean extract the bits of code still in use after this great restructure and make it work again. I just need to be sure to chmod my new file. I’ll also be using native cv2 functions for finding the background and whatnot.

By next week, I hope to be able to remote into my Pi with full screen resolution, and get back to where I was but with native cv2 functions.

Final Question: How long will it take before the cat learns, and will I ever need to redeploy?

Programming a Pi to Deter Cats: Part 5

Good Morning from my Robotics Lab! This is Shadow_8472, and I feel good about my progress this week. Let’s get Started!

Last week, I had successfully confirmed OpenCV was installed on my Raspberry Pi. The first thing to do this week was to start coding just as soon as I figure out a way to save a program file within the virtual environment, right?

Not quite. I thought a virtual environment was kind of like a virtual machine, where it has a whole little computer running within your computer, only with a few less restrictions. I still think that, but it turns out it works just fine if I run a file within the virtual environment from the Desktop or anywhere else.

I also learned exactly what a bash script is. So, I had OpenCV working in a script, and I changed permissions so I could run a .py file from the command line, but when i went to run it, I got an error about import not being supported. It turns out I forgot to run the Python interpreter with my program as an argument. That detail got me into the workshop I sometimes mention.

I actually got my base coding test harness from the YouTube Channel CodingEntrepreneurs. (Link to their first OpenCV Python video) While I was at the workshop, I learned a bunch of tangential stuff like when to pack your Python power cord, I polished off my knowledge on how to make sure a substitute power supply is acceptable, and when it’s a good idea to go back to the tutorial instead of arbitrarily placing a missing closing parenthesis.

In the end, I feel like I had a very successful session, but since then I’ve been building a framework for my program as a whole. Hopefully, by next week, I will have a program that will look at a series of pictures, tell if the background in each of three zones (cupboard, counters, and cabinets) is occluded (blocked) by a moving object (a cat or human), and sound the alarm if it sees something in the counters’ zone. As a bonus, it can save a picture of the culprit for if/when I try my coding skills at training a neural net to tell if my cat is being naughty.

Final Question: When was the last time you caught yourself considering over complicating a plan?