2020-05-21 (Th) HouseRobotInterference

I hoped to start a stream that prandomly read out words, and I think I could do that, but I didn't want to keep a Windows machine tied up forever. A Raspberry Pi is more power-efficient, and it wouldn't need as much space as a laptop or mini-tower. I don't know what that would do for compatibility when it came to streaming a screen capture.

There would be issues switching to a Linux-based platform, but I figured it was worth a day to explore, and I had a Raspberry Pi 4 B that wasn't doing anything. Luckily, the standard browser on Raspbian was Chromium, so I reinstalled the text-to-speech plugin, but it didn't work, so I tried Read Aloud again, and it worked. Not only did the plugin function, but in this case, I could access it entirely with keyboard commands.

As expected, the spreadsheet operated the same in the Chromium browser as it did when I used it on a Windows machine and Chrome. There was an appreciable lag when I compared the performance of my mid-range consumer-grade laptop to a <$50 SoC credit card computer, but I expected that. The next thing I needed was a macro to copy, paste, and speak the prandom words, but this is where things got messy. I have used AutoHotkey for most of my macro programming, and there is no support for Linux. I searched and found a few unenthusiastic recommendations, but I decided the best course was to use an Arduino with keyboard emulation. Admittedly, this was not the most elegant solution, and it would require a bit more power, but I could add a physical switch to stop everything.

I happen to have a decorative PCB that was an Arduino Leonardo at its heart, and since this project might be a little visible, it seemed like my best chance to use it. My temporary workstation was a full-size keyboard and mouse, an old 4:3 monitor taking up most of the table, and my laptop running on battery power. All the processing power was inside my primary computer, which received the smallest bit of real estate.

To prevent runaway processes, I added a physical switch behind the microcontroller board, so it would only run when active. Perhaps I'll add a prettier button someday.
Functional, not glamourous

Keyboard emulation with Arduino was nothing new for me, which is why I was so eager to pursue that route. Most of the commands were the same between Windows and Linux, so I could test the sequence without unplugging the microcontroller. As I learned from countless other macros, it is best to add snippets at a time, instead of writing everything the first time.

The biggest problem was pressing the MENU button ≣ because it was not a key Arduino openly supported. After some hunting on the Arduino forums, I found that I could emulate it by sending the code 0xED. After that, the issues were delays between keystrokes, so I didn't overrun the little computer's ability. The delay between words was a little longer, but that was the price of a cheaper processor.

(0:19) Recording of word generation on RasPi 4 B

The rest of the posts for this project have been arranged by date.
First time here?

Completed projects from year 1
Completed projects from year 2
Completed projects from year 3
Completed projects from year 4
Completed projects from year 5
Completed projects from year 6
Completed projects from year 7

Disclaimer for http://24hourengineer.blogspot.com and 24HourEngineer.com

This disclaimer must be intact and whole. This disclaimer must be included if a project is distributed.

All information on this blog, or linked by this blog, is not to be taken as advice or solicitation. Anyone attempting to replicate, in whole or in part, is responsible for the outcome and procedure. Any loss of functionality, money, property, or similar, is the responsibility of those involved in the replication.

All digital communication regarding the email address 24hourengineer@gmail.com becomes the intellectual property of Brian McEvoy. Any information contained within these messages may be distributed or retained at the discretion of Brian McEvoy. Any email sent to this address, or any email account owned by  Brian McEvoy, cannot be used to claim property or assets.

Comments to the blog may be utilized or erased at the discretion of the owner. No one posting may claim property or assets based on their post.

This blog, including pictures and text, is copyright to Brian McEvoy.

2020-05-21

Comments