After a decade plus (or longer) using HostGator they doubled my monthly costs with no notification, messed up my account in management tool so I couldn’t see invoices (convenient …). This is a “test post” on the new server to test out things! I can’t say how easy and fast it was to make the move and highly recommend https://www.geekstorage.com!
I recently had a need to write some code for the Kaltura API and the libraries have had a lot of changes since the last time I used them. One thing I found curious was (at least for Java) all API calls are queued making the operation asynchronous. It’s interesting to me that other languages don’t default to this. This may be desirable in some scenarios; however, if you are wanting to take any conditional action, you iI recently had a need to write some code for the Kaltura API, and the libraries have had a lot of changes since the last time I used them. One thing I found curious was that (at least for Java), all API calls are queued, making the operations all asynchronous. It’s interesting to me that other languages don’t default to this. This may be desirable in some scenarios; however, if you are wanting to take any conditional action, you ideally want to wait for the operation to complete. For example, if you want to iterate through the categories and then, depending on the data, take other actions to generate a report, you’re forced to store all the content in memory before processing it. Perhaps you’d prefer to generate your API session ID by logging in rather than using your admin secret, which is highly recommended. The C# examples show all the code using the execute() method with an onComplete method that sets a boolean. The following line after the call does a loop on the boolean with 100 ms of sleep. I’m not sure if the C# API has a queue method; if it does, it seems the developer portal-generated code is wrong and the polling is not required. While I couldn’t find any examples of serial execution of requests in Java, the executor class does have an “execute” method. You just need to massage the code generated by the API tool a bit. It does block until API calls are complete and then returns.
Here is an example of login:
LoginByLoginIdUserBuilder requestBuilder = UserService.loginByLoginId(loginId, password, partnerId, expiry, privileges, otp)
.setCompletion(new OnCompletion<Response<String>>() {
@Override
public void onComplete(Response<String> result) {
System.out.println(result);
}
});
APIOkRequestsExecutor.getExecutor().queue(requestBuilder.build(client));
// proceed to other API interactions
Obviously you need addition controls here (like C# samples) to know when the request is actually complete prior to doing other API actions. You can rewrite this call to block on completion. This simplifies your code if you have nested logic that iterates through a list of items (each which generate an API call).
I think the usage pattern is a lot easier, and the code is much more straightforward.
Unfortunately, it seems the code examples, most of the client API, and documentation for the Kaltura developer portal are all code-generated. This allows them to spend less time supporting them, but honestly, I think using the REST endpoints is easier due to the lack of human-readable documents and proper code examples that are tested.
For many creating a virtual pinball machine is one part woodworking, two parts electronics and wiring, and three parts installing/configuring/ troubleshooting software from several different contributors. One of the core components you’ll want in your setup is the Visual Pinball application. I’ve had great luck with the software, except for one issue with it knowing which monitor to use for which “part” of the “virtual” pinball machine. A common question I saw posted online is: “Why is my Visual Pinball playfield on the backglass or DMD monitor?” or “Why is my backglass not on the monitor I specified?” I noticed it was common because I did a lot of searching for the solution. I’ve attempted to detail some of the options I tried below. If you’ve tried everything with no luck, make sure to read the “Fix the Backglass” and “My Display Fix Script” sections below, as I think they will do the trick!
Fix the Backglass – The Easy Part
Many people aren’t aware that the backglass position problem is pretty easy to fix now. The latest backglass software version lets you put in a pixel position. So, if you have a 4K playfield, simply put the value @3840 to line 5 of your screenres.txt and you’ll never have to deal with that again! Since you put your monitors in a specific order, the coordinate system is much better than using a “display id” that will probably change.
What’s in a Display Number?
Visual Pinball determines a display “number” that’s not the same as the number you see in the control panel settings. If the number it finds for your display changes, VP still uses that number even though the proper monitor to use is now a different number after reboot. The tricks are all about trying to get Visual Pinball to use proper display or getting the number to not change.
Clean up the Registry
One option to try is to delete all the registry keys for your displays. Many people, when building a pinball cabinet, “try out” a few monitors, or upgrade video cards, etc. along the way. This leaves a lot of garbage in the registry. Heck, I had almost 30 entries but only 3 displays (multiple video cards and monitor trials gave me the mess). You can clean it up by deleting all the keys below (backup first, make sure you know how to use regedit). If this is the cause of your trouble, it might fix it, but it didn’t for me.
Oh, who wants to do this? Nobody, but if it will make it “just work” you might be happy with this approach. The idea is to make sure all your displays are on BEFORE the PC is turned on. This makes a lot of sense if you’ve seen a fast PC boot it might be at the login process before all your monitors are ready for a signal. I’m pretty sure every time a boot up the login screen starts on a different monitor before settling on my primary display. Some people swear by this method, but it didn’t work for me. I didn’t really want it to work, I’m using a smart power strip and just want one magic on button!
Use NailBuster utility to set Display at startup
Another trick is a utility that looks at what display is currently setup at coordinates 1,1 and set the registry entry used by Virtual Pinball to match. This was the first solution that seemed to work, but not 100% of the time. You can give it a try and see if works 100% for you.
Use the “primary” flag at the startup of Visual Pinball (try this!)
I initially saw a flag browsing the repo for monitor setup and then, after trying it as “/primary”, found a post on Facebook from Nailbuster on the feature being part of 10.7 and to use “-Primary”. I changed the registry for vpx to use the “wrong” monitor and it worked. Even with vpx settings pointing to my DMD, it uses my main primary monitor properly! However, there are some caveats: this requires 10.7 and only works for Visual Pinball. Further testing with reboots showed sometimes even with vpx working with “right” monitor using this flag at startup actually forced my playfield to the wrong display. I think it’s worth a try to see if it helps (especially given the person who created it).
What works 100% of the time for me?
We could title this section “Your mileage may vary”. I took a brief look at the github repo (emphasis on brief – my observations are just a guess). It seems to be using Win32 calls to GetMonitorInfo and MonitorFromWindow to create a list, and using the display number according to the order of that list. It doesn’t check that information (and update it) at runtime, so if the ordering of items changes, it uses the same display number despite the change. When this happens, if you look at video preferences in VPX, you’ll see it puts an asterisk in the UI next to the “right” one.
Since my problem occurred every dozen or so starts, I tried a few scripts to list the displays to see if I could find one that always matched the ordering (and numbers) that matched the order Virtual Pinball used. What I found was that if you used the output from the Direct X Diagnostic tool, it always gave me the same order.
My Display Fix Script
I created a batch script that uses command line options to output the Direct X diagnostic tool, find the display listings, pick a display based on a unique resolution or display frequency, and update the registry entry Visual Pinball uses to match. Since most cabinet builds have a 4K display or a high refresh rate display, that can be used to identify which screen should be the “playfield”. This script could also be updated for use with Future Pinball (have some lines still testing in script). If all your displays are the same I’ve added support for that too, just read the readme in the zip file.
I created a zip file with a few scripts to pick from. I know a lot of builders aren’t PC experts, so I created some variations of the script with specific parameters so you can just drag and drop without setting command line parameters. You figured out that slot cutter on the router for that fancy t-molding. Let’s make this easy. Just copy the one you want (pick4kdisplay.bat for most) to your startup folder and reboot. You should see a command window pop-up after reboot pause for 5 seconds, then update the right settings. You don’t want to launch other things until this is done so if you have a delay in PinballY or Popper bump it up by several seconds (but you may not need this if takes you several seconds to pick a game!). Click here to download my zip of the batch scripts.
I recently created a network proxy for the FlashPrint software, which makes remote printing via Wi-Fi possible with the PowerSpec printer. While debugging that setup, I was able to observe the exact protocol and undocumented gcode commands used to send a file to the printer for printing. FlashForge doesn’t “stream” a print like many support with a tool like Octopi. Instead, a set of gcode commands are sent to the printer and then saved to the printer’s memory. Finally, then print begins. Since I can’t use Octopi with the FlashForge proprietary gcode, I needed something else.
Automation Option
The first goal was to enable automation for using another slicer. I created a set of Python functions to send a file to the printer. From there, I had what I needed to setup an Automater script on my Mac. This script monitors files in a directory and when one appears, it invokes the script with the filename. The trigger is files or folders added to /documents/start3dprint. The action is to run the shell script, passing my printer’s IP, port, and filename. This has worked well to start printing directly from Simplify3D
Print Monitoring
I also wanted an easy way to keep a window up in the corner of screen with print status. For this I created a simple Python GUI to connect to printer for monitoring and/or send a file. This can be used in conjunction with the automation to monitor print progress. I was able to compile it into a windows executable and Mac .dmg file. I was surprised how well the UI toolkit and compilation worked.
I hope after some more testing I’ll feel comfortable releasing it to others to try.
Did it take a pandemic to slow things down a little and find time to polish off the Pac-man project? Nah, I’m sure it is a coincidence. The final part of the build was getting the control panels designed with custom vinyl graphics and mounted the way I wanted (easy to remove). The very last thingI had trouble deciding on this small panel if I wanted to keep the “player 1” and “player 2” buttons on the one side or split them. I decided to just design a graphic that could do either and ordered it. The custom design is really modeled after the original, but with some tweaks to allow for extra buttons. The number of buttons was the last thing I wondered about. Even if you look at all the potential games out there, very few use more than two buttons—and most of what I wanted to play was two or less—so of course I picked three! It’s been a long journey from buying the two original arcade boards and a large CRT monitor to the final solution of a Raspberry Pi with an LCD panel. I’m pretty happy with the results. Below is a summary of the build and some of the “fun items.”
Easy to remove top, no swing out hinge.
Custom design but very close to the original (read as “figured it out as I went”).
All furniture grade plywood stained and finished with wipe-on poly
LCD bezel is paired with faux screen curvature and scan lines to emulate a CRT.
Custom system image for Raspberry 3b, compiled and configured components I wanted. Using Mame emulator and hyperspin front end.
All buttons/joysticks wired into iPac2 interface allowing simultaneous play.
Custom graphics on control panels (thanks to help from my youngest son who is pictured in another build picture when was far younger!)
3D Design and Printed Items
Slim hidden volume control knob
Base plate joystick restrictor to switch 4/8 way from below panel
Custom glass clips
Interior clips and mounts
Speaker covers
It was a lot of fun. It probably didn’t need to take more than a year or two, but I collected things little by little and went down a lot of rabbit holes. If I had just done a replica and ordered most of the parts (like those darn control panels), it would have been easy, but it’s nice to have something you created on your own. Now I just need COVID to go away so I can have friends over to do head-to-head pac-man! Next project will probably be a Defender cabinet or a Virtual Pinball
I recently had a milestone birthday and took a vacation day to do something fun. Nobody was home all day, so I could work without interruption. I hit Menards to grab a sheet of nice plywood and get the basic pieces for the final machine started.
For the top, I used two sheets of plywood glued together to create a 1″ top, which is the standard height. This is needed for the traditional t-molding but also for the proper height for the clips, which need 1″ at the top plus the height of the glass. This plywood was going to be covered by the top graphic, molding, etc., so it wasn’t a nice grade-just something that was very flat so the two pieces would stay together well. I used wood screws after gluing to ensure a good bond (which I removed prior to cutting out the hole for the monitor and the contours for the design).
The top was a challenge to cut out. I traced the glass onto the wood and used a circular saw to make a nice “square” and then used jigsaw to make the curve and interior cuts. I wasn’t real happy with my initial cuts as the jigsaw blade isn’t really great for 1″ no matter how slow you go. I used some rasps/files to get it to get it “good enough”. Most of the edges and top is covered by graphics and molding.
For the base, it’s essentially a box. Normally I’d just wood glue, nail, and clamp, but since I’d be adding t-molding I couldn’t use nails, so I used corner blocks, which helped keep everything square and I could nail in those to the face board and miss the edges.
I used a strap to let everything set and tested the router on some scrap for t-molding. Given how wide the bit is for this, you really need a variable speed router to do this safely (and use the lower speeds). For whatever reason, this step seemed like a hard one. I spent a lot of time thinking about it, I’m sure I spent a lot more time thinking than doing. I’ll be generous to myself and say it was all that thinking that paid off, but in reality, I think the routing part just wasn’t that hard.
It wasn’t a “lot” of time to do all this, as often in life it’s about making the time to get something done! I’m pretty happy with how this turned out overall and look forward to the next steps. Hopefully, the next steps aren’t going to require another milestone birthday.
If you’ve purchased a PowerSpec “ultra” printer from Microcenter (or bought one of the other rebranded models), you’re probably disappointed in the slicer options. It comes with an old version of FlashPrint, PowerPrint, that is no longer updated. Hopefully, you’ve figured out that the latest versions of FlashPrint from FlashForge work perfectly fine with your PowerSpec printer by creating great gcode files you can print from your SD card. But what about Wi-Fi?
Unfortunately, all of the network printing features are broken as the software is looking for a hard-coded string in the firmware at connection time. In the spirit of “right to repair,” I’ve created a simple network proxy that sits between the FlashPrint software and your PowerSpec printer to fix that problem and let you monitor and print from the software just like you could in PowerPrint.
Using the Script
To use this, you’ll need to install Python on your computer. If you have a Mac, it’s probably already installed. Just download the file below and run it from a command prompt/terminal like:
python flashprintproxy.py <PRINTERIP>
If you don’t know what your printer’s IP address is, just go to your printer, make sure it’s turned on, and go to Tools/Settings/Wifi to get your IP address. You can also hard code it in the python file if you prefer.
Once you’ve done this, you can go to the printer settings in FlashPrint and put in 127.0.0.1 with port 8899. That’s the address where the Python script is working to connect to your printer and handle things. You can easily stop the script after your print is sent to the printer, or keep it running to see the status of your print.
Next up, I plan to create some scripts for sending prints to the printer without FlashPrint for easy automation from any slicer.
Your mileage may vary. I offer the below with no warranty! The code is yours to try and change as you desire.
If you work at your desk all day without getting up and moving around regularly, you’re not doing your body any favors! In the last couple years, I’ve tried moving around more while on conference calls and sitting in different locations (which is really easy at home, but in our new collaboration spaces at work it’s super easy too). Last year, while in the office, I used one of the sit/stand desks. I was surprised that after using it for an hour in stand position, I was still standing without a desire to sit (from my feet or my brain). I felt more focused standing, and when my feet and back told me it was time for the chair, I did it long enough to feel rested and did more standing. I didn’t like that the sit/stand desk had no keyboard tray, but it did go pretty low, so it wasn’t an ergonomic disaster-just not quite optimal.
The next day, I started researching buying a desk for home and found it’s pretty easy to spend between $600-900. I’m a person that always likes to make things my own, whether that involves customizing them or building them. I started looking for options to build a desk from a frame, and it turns out a few companies offer their desks without the top for people like me. I searched quite a bit to find a desk that could handle a decent weight, had good reviews online, and more than a 90-day warranty. After a lot of searching, I found a deal on Amazon. It was the… It was on sale for $279 and had an extra 20% cash back. I ordered it Friday and it appeared Sunday morning! I wasn’t ready with a top, so I cut a bit off a piece of plywood in my leftover stack in the garage to use in the meantime.
IKEA Top with four coats of wipe-on poly
For the top, I wanted to go big. My current desk in my home office was a standard computer desk, about 4 feet wide and 20 or so inches deep. Most the ones online offered a 30×60 size which sounded amazing. I wanted a nice clean look – something with some nice grain patterns, not dark. I found my local IKEA store sold an unfinished solid wood butcher block top. I put three coats of poly on it to make the wood colors pop without a glassy finish. It was simple to mount (like < 30 minutes) and then I just had to attach the controls to the front of the desk. I found a great standing pad that I stick under the desk when standing and it’s worked out great. I found generally I like to stand 2-4 times a day for 45-60 minutes. I think that’s a great compromise for an information worker and I think the look turned out great.
Since the picture above, I 3D printed some cable management guides, mounted the power supply, and printed an under mount hook for my over the ear headphones (I call them the focus-phones)
Here are the parts I went with if you want to follow my path. The total for everything was under $400.
OctoPrint is an amazing little app with a simple web interface that controls your 3D printer. It has the ability to manage your gcode files or even take STL files and “slice” them into gcode files (which I’d never use since I like to visualize the layering in a tool first). OctoPi is a Raspberry Pi distribution of the tool that runs on the Pi. I had an older Raspberry Pi B that was perfect to throw at my need to remote control/monitor my longer 3D prints.
View of interface on iPhone
Disclaimer: I know the Raspberry Pi camera using the camera interface is “the way to go”. But an older camera you have (or $5 Playstation Eye camera) is worth a try right? No way, CPU will be too high, you won’t have enough USB ports, system will run too hot, will cause printing to pause … or will it?
The way OctoPrint integrates with a camera is by pulling into its page a video stream from mjpg_streamer (a web server running on a different port). This tool takes content from your web camera and creates a web video stream. This software is distributed with the OctoPi build, no extra install required. Building the stream is a much more efficient if your camera is newer and has support for MJPG – otherwise you’re using YUYV encoding and the Pi has to do a lot of extra work. Nevertheless you can make this work. I use the following options to run the streamer:
The important parameters above is the “-f 1” which says do one frame per second (I’m not looking for high quality video – I just want to see if print has lifted and get a feel of progress). The “-q 50″ controls quality of the result compression.
You can update settings in /boot/octopi.txt so these are used by default. This can be done by ssh to your machine or shut the machine down and edit the file on your computer after putting in the SD card.
camera_usb_options=”-f 1 -q 75 -y”
The advantage of changing the settings in the boot config file is every time you unplug the camera the process dies, and when it starts it will use this setting (there is a background process called “webcam” that handles this).
I tried changing the resolution and surprisingly didn’t find a change in CPU usage so opted to keep it. As far as CPU, the system is running high at 85% and most of that usage is from the mjpg_streamer process.
Command to check temperature: vcgencmd measure_temp
So yes, it runs the CPU pretty high (80%+) and the temperatures run a few degrees higher (but at 54’C well below limits), and the initial OctoPrint interface loads a bit slower. If you don’t want to spend money on a $30 Pi camera or a more expensive USB camera I think you can make it work.
I’ll admit, when I bought the Monoprice Mini Select 3D printer, I knew almost nothing about 3D printing. That won’t get you very far after you unbox the printer. There are some basics you need to learn to get good prints.
Once you have a 3D model in a print file format like STL you still need to put it in a program to tweak for your printer settings that has a slicer that creates a file usable by your printer. Beyond that, many prints require extra work to determine the thickness of walls that will look nice, supports for prints that have large overhangs, and more. It’s not rocket science; you just need to learn how the process works.
Thankfully, this printer has a lot of online help from owners on G+, Facebook, and especially YouTube.
Here’s a print session for a Pi Zero W case I found on thingiverse.com.
Tuning PID for Better Temp Control
Apparently, the out of the box temperatures for printing for this printer can fluctuate a lot. Most control systems use a PID controller to constantly measure the target values and use specific values for this (specified by the letters PID in the acronym). The good news is that you can tweak this printer’s values to get better results. I did this before my first print. Resources below:
While you can probably put these commands in a.gcode file and print them, I used this software to set the values. http://www.pronterface.com/
Printing Hints I’ve Discovered
Skip using the SD card and printing from the printer menu. Sometimes prints hang if you don’t upgrade the firmware (wanted to stay out of the box initially). Print from a computer with Pronterface (above) or even better, use Octopi (what I do now). Don’t use Cura on Mac to print; it just pauses every 10 seconds.
Use a good “slicer” application to create your print files. I do like Cura, and it’s available on Mac and Windows. If longer items can fit sideways, they’ll print faster. Have an item too large for the bed? You might be able to rotate it slightly to fit diagonally.
Print the first layer SLOW-half speed-on anything long or with quick angle changes.
Watch the printer. It can go bad. Octopi supports a camera!
Prints don’t stick without some help. Use a “raft” with your print if it doesn’t cover much surface area, and generally always use a light layer of glue stick on the tape on the bed.
The Octopi interface is great and works from any device anywhere. Why be tethered when you can watch remotely?
My Impressions
While I got some great prints with a little tweaking, I’m a bit concerned that this printer could be a black hole of my time doing mods. Apparently, Monoprice has a new model coming out in a few weeks that has many of these community mods built in, and most importantly, a replaceable hotend. I can already tell I’ll need to reroute the cables under the print bed (not attached correctly), install a stabilizer, and a couple other items. I may take advantage of Monoprice’s 30 day satisfaction guarantee and wait for the upgraded version to save me some time (and money in the long run).