incoming blog posts!

This commit is contained in:
Wyatt Miller 2019-04-15 20:30:35 -04:00
parent 6130dca281
commit 79b46e040c
4 changed files with 44 additions and 2 deletions

View File

@ -0,0 +1,17 @@
---
layout: post
title: "Loading..."
published: true
---
In the early stages in what we call “the software”, which is what code is going on the units/Raspberry Pis, I started from scratch thus putting some puzzle pieces together, from the standard library of Python 3.6 and third party modules that I have used in the past to be more specific. I wanted to explore Rust and Go as well so I kept that in the back of mind if we ever needed it to do anything that was needed.
Firstly, I had never finished a fully fleshed out Python project before. I have various Python projects floating around on my machine at home and they never came to a production state. Now, youll find Python projects on GitHub profile page, and I admit that I have finished two of them, being my MikroTik router setup and my read-only FTP server, I have never done any Python projects with classes, attributes, formating, and some module additions crammed into my project. I was very nervous when we as a team came to this conclusion because I have tried to add all this additions before and that project never came to fruition.
Since the Raspberry Pi folk support Python to great lengths, we as a team decided that was going to be my programming language of choice. As stated above, I was nervous. Eventually, I worked on “the software” day in and day out. With the help of the other teams in the same course, including Richie Tarkowski, Noah Osterhout, and Eric Grant, I got this project to a working state and this was the “prototype” state putting in “dummy” temperatures. This was a very rudimentary state to what it is now but it works!
Rust. Theres alot to say about this language. I was never taught this language formally and I had some background this language through a podcast New Rustacean (its really cool, I suggest you go check it out) so other than that, I was blind to the language. A textbook definition of Rust is that Rust is a fast, concurrent, memory safe language. With that in mind, theres a slew of features that comes with the language. However, with features, there comes drawbacks, like steep learning curve and the “borrow checker,” which is for memory safety. With any variable in Rust, they are immutable, which means you cant change them once they are set. Another drawback is that Rust doesnt adhere to traditional object-oriented programming practices like C++, Python, Ruby or C#, if you have previously worked in a object-oriented language. These drawbacks made it hard for me to take a hold on the language and craft something with it. However, with enough grit and brute strength of the mind, I created a utility.
The utility I made with Rust was the universally unique identification generation tool. The UUID generation tool was created out of necessity because Jacob and I were having a conversation about how we are going to define each unit uniquely. I mentioned a UUID would solve that problem as it creates a random twenty-six alphanumeric string thats not reproducible. Thus, the UUID generation tool was born.
JSON files were the serializing format I chose to pass from the Raspberry Pi to the server so the Thresa, the database administrator, can parse said JSON and insert it into the database. My state of my mind through getting objects and attributes serialized into a JSON format went from focused to a complete nightmare. The Python debugger kept on saying that the time and date attributes, because we as a team decided a timestamp was necessary, it was an attribute, not a string. Of course, cursing and swearing at my computer did not solve anything. Although the type change was very simple, it felt like an eternity getting those attributes and objects into a JSON file. It was very rewarding, however.

View File

@ -0,0 +1,17 @@
---
layout: post
title: "Status report of PiBake!"
published: true
---
This sprint was the one of the shorter of the five sprints, so I cant really talk about much here except what Im going to talk about, obviously.
I setup all of the infrastructure that the team was going to use, directly or indirectly. This infrastructure included the GitHub organization, Travis CI, our continuous integration service, our production server and the SSL encryption on said server, the MySQL database for Thresa and the web frontend to MySQL, phpMyAdmin, and the system users on the server. Thus, I got thrown into the QA position.
We got a temperature reader! We had a daughter board of sorts that came with the Raspberry Pi called GrovePi. The GrovePi attaches to the Pi via GPIO, taking all 40 pins of the GPIO. Then, once you have your GrovePi attached, you can then attach multiple sensors to it. In our case, we would attach the temperature sensor to it, as you might imagine. I searched the Internet for an example of how you would grab temperatures off the sensors. This where things get a little sticky, to put it bluntly.
Once I first put some example code into “the software,” Chris and I got together and ran the software, sensor and GrovePi attached. This turned into a day sub-project to nearly a month sub-project because whenever I ran “the software,” “the software” gave me a negative one (-1)/IOErrors or TypeError which was very strange. Then, I found GrovePis GitHub page and I found some example code that was written by GrovePi so I tossed that into “the software.” Same error. Tried a different port and changed “the software” accordingly. Same error. I asked our instructor, John Velis, if he had another sensor and a whole other GrovePi entirely. He gave the extra GrovePi to me and then I was golden. Or so I thought.
With trouble happening to Chris and I, I asked Chris if I could bring the Pi, the two GrovePis and other hardware that is needed to my house to mess with this. The same thing was happening to the other GrovePi, different ports and all. As a last ditch resort, I asked the Dexter Laboratories forums to see if they could give an answer. I can tell you they were a bit clueless on what was going on so I didnt get answer from them either. By this time, I was pulling my hair out. I didnt know what to do at this point but buy a whole other piece of hardware. Chris and I will be figuring out what hardware we need next sprint. Thus, well see how it goes.
Besides that, however, this was my first attempt at creating a Python package, which was interesting and with creating a Python package, Travis CI allows a user to deploy to PyPI, which is Pythons package index, which all packages can be installed with pip. Pip is a little command line utility that lets you install Python packages into a local environment and should be installed on anything that has Python installed because without it, manually installing packages would a nightmare. I messed around with Travis CI and PyPI a bit to see how deployment works. I also learned that that Travis CI required a YAML file in my reposo learned how to craft a YAML file from scratch. YAML is kind of like Python in that YAML uses indentation instead of curly braces to make YAML work, which is pretty cool. To be completely honest, I like forced indentation because it forces you to make your code look pretty and human readable.

View File

@ -4,4 +4,12 @@ title: "Racing to the finish line!"
published: true
---
This sprint, it was "heads down and squashing bugs" kind of sprint. We, as a team, have a lot accomplished but we not quite done yet, with our importing to our database still needing to happen and some fishing touches have to be added as well. Let's get into it, shall we?
This sprint, oh boy! It was "heads down and squashing bugs" kind of sprint. We, as a team, have a lot accomplished but we not quite done yet, with our importing to our database still needing to happen and some fishing touches have to be added as well. Let's get into it, shall we?
My adventure from picking hardware that will (possibly, it was a 'keep your fingers' kind of moment) work on our hardware that we have already i.e. Raspberry Pi was already pretty tough, I thought. Here I was, just hoping and praying that we will choose the right piece of hardware for the job as our defunct piece of hardware, the GrovePi, didn't work as intended. But Chris, he came in clutch with piecing it all together and fitting the unit into a nice little case as he said he wanted it in a presentable unit. Hats off to Chris for pulling that off! Intentionally, I thought would have to try different code examples until we find the right piece of hardware (because different pieces of hardware require different code) and to my surprise, we finally got some real temperatures! I was pretty excited to see that "piece of the puzzle" come together.
Josiah and Jacob also came in with the website they have been working so hard on. I got the honor and privilege of seeing it today while in a private conversation with Jacob. Apparently, `cron`, the time scheduler on Linux, doesn't automatically fire off a script the pulls down the `master` branch from GitHub at noon every day. I also tried to set Travis CI to deploy automatically when a push is made to the `master` branch but that didn't work either because of the infernal SSH keys. I'll have to find a way to deploy cause I want to be easy on the web guys because they don't know any command line stuff in the first place and it'll take many days to help them learn the command line in the first place. It's not like I'm doing this out of the kindness of my heart or something. Just kidding, you guys are doing great!
Thresa and I are working on a script that will import JSON into the database. We hit a snag in the importing side of things as you have to manually import the UUID in the `Pi` table before you can import the JSON data into the `TempData` table so we are sorting through that right now. That's the last "piece of the puzzle" until we have fully automated project build.
That's all I have as we can see the light at the end of tunnel. Pretty excited to show off what we have thus far. Go check out [the PiBake website](https://thepibake.com) if you haven't already, it's looking pretty damn great.

View File

@ -12,7 +12,7 @@
<div class="header">
<div class="header-title">
<h1>Wyatt J. Miller</h1>
<p>version 1.2.4 "Velvet Thunder"</p>
<p>version 1.2.6 "Velvet Thunder"</p>
</div>
<nav class="nav nav-pills nav-justified">
<a class="nav-item nav-link" href="/">Home</a>