November 2022: Make an IoT Parking Lot Help Request Device
Also learn to make your own SQL "upsert" functionality and use Puppeteer for end-to-end testing in web apps.
Hi all,
Once more another month has flown by. At this time of year, it definitely feels like things are speeding up. I suppose with the holidays upon us and the new year just around the corner (how is it already almost 2023?!) it’s only natural, but still, the days are just slipping away.
I’ve got some very fun things to share with you in this newsletter.
To start us off, I built a new Internet of Things project: a host-free smart parking lot help request device.
We can do so much today without ever interacting with another human being, but when you do need customer assistance, it can be challenging to find help.
To solve this problem in large parking lots, I built a cellular IoT help request device using Blues Wireless hardware and software combined with SMS alerts for customers to push a button and request help when they need it. One of the best parts of this solution is that no host microcontroller is required, equaling big savings on hardware costs and battery life.
I had a lot of fun building this, and I learned a whole bunch of new things like how to solder wires together, use heat shrink and a heat gun, and see a NeoPixel LED in action.
After having to create upsert functionality for an AWS database that didn’t support them, I wrote a blog about how anyone can do it.
Although Amazon’s Redshift database is PostgreSQL-based, it doesn’t support some key functionality like UPSERT
: the ability to update already existing rows in a database and also insert new rows of data at the same time.
Some research and a lot of testing resulted in my using a temporary table to hold all the new data, and a couple of SQL queries to delete any already existing data in the main table and then insert all the data from the temporary table into the main table.
It wasn’t as complicated as I thought it would be once it was broken down into steps. Hopefully this article might come in handy for you as well.
Learn to use Puppeteer and headless Chrome for end-to-end testing your JavaScript app and so much more.
A very good conference talk inspired me to take a look at using Puppeteer for writing automated end-to-end tests, and I discovered it can do so much more than just that.
For instance, I figured out how to integrate it with a React app’s Jest testing library, use Puppeteer to take a screenshot of a page, save a PDF, test a Chrome extension, and even debug a flaky test using Chrome DevTools, which is pretty sweet.
If you’d like to give Puppeteer a shot for your own e2e tests (and more) I’d encourage you to peruse my blog post.
I hope you enjoyed this month’s edition of “Paige Codes.” Please share with your friends if you did.
See you again at the end of December,
- Paige
Not subscribed yet? No worries.
I send a free email every month or so. You can check out my archive, or sign up below: