Last week, I met with Professor Tom to discuss my final project. Having noticed that my Titan Sunflowers had grown about an INCH A DAY their first week, I thought a time-lapse of some Titan seedlings could be really interesting.
Tom gave me some links to a project that seems to be what I’m going for. I looked through those pages and ordered a number of parts–soil sensors, a no IR version of a Pi camera Tom recommended, and a few other sensors that I thought might be fun to play with once I got things up and running.
You may remember I did some work with my Raspberry Pi for my mid-term project… and, if you poke around enough, you’ll find that I actually have a RENT/La Boheme NLP Twitter bot running on a Pi I set up last semester. I had initially left the default username (with a changed password), but decided that I would reformat the SD card following Tom’s instructions on Setting Up a Raspberry Pi (more securely with a firewall, even!) It took me a couple of tries to get right, but I was able to get it done using the pre-formatted (then reformatted) SD card that came with my Raspberry Pi Kit and the steps on the page.
So, for my final project, the idea is to set up a growing setup with a tray of Titan sunflowers, planted in peat pellets, on a heated mat (that encourages growth.) I’m planning on connecting the no IR camera to the Raspberry Pi and take and save regular snapshots of the growth of the seedlings over the week the project is running. I’m also planning on connecting a few other sensors (such as the soil sensor) and display that information with (possibly on top of!) the images.
The camera will be connected to the Pi, which will be connected via WiFi to my local network. The saved files with data/info will be saved to a folder that is accessible locally on the network. From the information online, the process seems a quite straightforward.
As the camera arrived over the weekend, I decided that I would take a break from my Thesis project and give this final project a bit of a go to see how the journey would be… I don’t know why I expected a smooth ride as I began testing the waters–despite the tons of code I have available to me and despite the pages of instruction on EXACTLY this project–I kept hitting roadblocks and, eventually, getting errors.
I decided to disconnect from SSH via my Mac and attach the Pi directly to my monitor, using a separate keyboard and mouse. I downloaded the files, as per the instructions on the “A Timelapse Webcam Application“, and kept following… only to find this mysterious set of words I hadn’t seen in Console/Terminal before: “segmentation fault.”
Reading into this for a while (mind you, I’m more than an hour into trying to connect and work with the A Timelapse Webcam Application instructions), I decided that–considering 1) the importance of this, 2) my current workload, and 3) the fact that online forums were largely offering condolences to those reporting the error–I should just give up, reformat the SD card (for a fourth time… could this be the problem?) for the Pi, and buy a replacement card for overnight delivery, just in case.
In the course of a couple hours, I’ve gone from being fairly excited about this project to dreading the potential toll it will have on the quality of my other work. I haven’t even gotten a good start on it and I’m overwhelmed. I sincerely do find this subject–and its power/potential–fascinating and exciting; however, I genuinely cannot wait to have more free time (and less of a submission schedule) to play and understand this stuff (as opposed to mainly stressing over getting it to work.)
I was hoping to have an update by the time I finished writing all of this as to whether or not the reformatted SD card is giving me problems, but 45 minutes later, I’m giving up on it and letting it run in the background while I work on other things.
From today’s experience I can tell you that my project will 1) be running on a Raspberry Pi account named ‘pi’ (with a different password) and 2) start with very basic basics… you will be able to tell how much luck I had with this project by how much I’ve been able to add to the bare working minimum. (The goal is not the minimum, the goal is to get things to work… and hopefully have some time to reflect/learn… THEN build on that stable foundation.)
This class has been by far the most stressful class I’ve taken material- and structure-wise. I will never take–or recommend–a flipped format for a technical class like this again… there’re too many areas where problems can go wrong and too many ways to find out how to skin a cat on Google… not all of them great. For the amount of time I spend trying to figure things out, I feel I get so little in terms of return on investment and–because of the schedule changing weekly–there’s really no time for reflection on the material (which is where most learning happens.) I appreciate the opportunity to ask questions the following week, but I honestly have too many and not enough background to know the best ones to ask (but I still try.) Right now, I’m hoping for more than just a white background with black text displaying a list of temperatures for my final. (which I’ve yet to be able to accomplish, so….) *fingers crossed*
FOLLOW UP: I’ll admit… I noticed the card had formatted and booted up properly… So, I spent another couple hours (I’m 4 hours and 09 minutes into a quick sit) with my project. It doesn’t work. I don’t know why, so I’m emailing Professor Tom. I feel like such a sucker for sticking with such things when I don’t have the skills or resources (sure, it’s on the internet, but time and energy are resources, too) to work on such a big project.
FOLLOW UP#2: Ok. I can’t leave good (bad?) enough alone… I decided I’d walk through the steps of the Recipe one more time. It did NOT work… when I ran the server, it started. When I went to localhost:8080 for the control panel, it crashed the server.
Funny thing happened, when I looked away for a few minutes. I left the control panel open at localhost:8080 on a screen. I had restarted the node server, but didn’t stop it. When I looked over, there were pictures in the folder! It appears the issue with the server crashing has to do with when the entire page loads. Interesting… though, I wish I would have found that out on my own proactive merits. I’ll take the win though.
Where I’m at a big loss, is getting the pm2 to work. It looked like I had the issue with it being in the wrong folder (under /opt/) and despite my many, many tries, I was unable to figure it out. Finally, I added the address to get to pm2 to the PATH (after finding out where it was from ‘Whereis pm2’.) Unfortunately, I couldn’t get it to stick permanently.
I thought this might have to do with my not turning off Auto-login for my user… I didn’t turn it off at first because I was going to be at my computer until I went to bed and I didn’t want to go through the hassle of setting up another user if I was going to end up with SD card problems again. I eventually created a new user, but this didn’t help. Online, forums suggest adding the path to ‘bashrc’, but I couldn’t find that. Nor could I find .profile. I’d love to just know the answer on how to do it without having to look anymore, so if you’re reading this in April of 2021, feel free to scream the answer from the rooftops! (or email me.) I know I can use the export workaround until I close the terminal window. I actually closed all of the windows and pm2 kept running. To get it to end, I ran killall node in terminal.
Here are a couple of images from the automatic images taken with my new no IR camera. I added the IR lamps and tried them out… cool, huh???