Thursday, October 6, 2022

RIBBBIT media VOD

 RIBBBIT media Video On Demand!



Well, what is the point of this?!  

As a long-time cord-cutter, I've made some use of streaming services (mostly YouTube, but also Netflix and Amazon Prime), but I've often been frustrated by available solutions for streaming my own media at home.  Part of what frustrates me about the commercial VOD services is that I'm at the mercy of what their library managers decide will be available to me.  Let's say I want to watch "The Towering Inferno".  Well, if none of the services I'm subscribed to currently think that is worth having online, I'm out of luck.  Well, if I own the DVD, why not just watch it on that?  DVDs are great for getting "ownership" of the media into my possession, but once I have it, I'm very restricted in how I can consume it (to say nothing of maintaining and regularly interacting with a library).   Yes, "ripping" DVDs offers some solace, but now there are data storage issues, and how do you catalog and index such a library? For years, I simply hung an NFS share out there, and watched via VLC on a PC or laptop.  That has obvious limitations.  That DID scratch my itch for a time, but I wanted something more library-ish with indexing and searching and so on.  One obvious (but exhausting to maintain) way to achieve this would be a forest of symbolic links on that NFS share... but another way would be to use an RDBMS to maintain all those relationships, and simply query against that to get the filename of interest.  That has the potential to be much easier to maintain (and expand).

What's it made of?

Since HTML5 includes (among other things) handling for video playback, I figured it couldn't be TOO hard to implement a simple video player page.  I was right.

I've been working on re-ripping and/or transcoding my video library from MPEG2 to MPEG4.  As of this writing, I have over 2,500 TV Episodes and 350 movies in MP4 format (all ripped from DVDs I own) and logged in the DB, many with metadata (such as runtime, people and companies involved, synopsis, and so on).

The system consists of:

  • a static HTML page, which loads 2 JavaScript files, and sets up the layout of the page, 
  • a Python file which serves both as a Flask REST API and a CLI for interacting with the database, and 
  • a MariaDB database.  

All told, the HTML, JavaScript, Python, and SQL DDL currently fit in under 6000 lines of code (including comments and whitespace).  Some refactoring will likely bring that down a bit.



As of now, the ability to edit DB info for individual "artifacts" within the web page exists.  The CLI is for doing things like bulk-creation of artifacts from file lists, creating tags, assigning individual "episodes" to a "series", and so on.  On the bright side, the back-end code to achieve these things exists in the Python file, but I haven't gotten around to hanging a web UI on any of it yet.



Also, there is no authentication on the web side... You are J. Random User.  The back end keeps no stats on you, and currently places no restrictions on whether you can update DB information for any particular artifact.  Obviously, this is not intended for public use.  It's intended for a person (or family) to interact with their own video library.

Call to action(?)

Is this something that interests you?  Would you be interested in seeing this go up on a publicly accessible repo?  Comment!


Thursday, June 30, 2022

Netgear SSO? That's a hard no. pfSense to the rescue!

 Some time ago... a couple years, now... my trusty old cheap Netgear router breathed its last, and I bought a new one.  The new one had this pain in the ass "Single Sign On" thing that made you set up an account with Netgear in order to log in to the router.  Hard pass on that.  It's possible to log-in locally, but it's extra steps that piss me off.  I've been ruminating on switching to pfSense for my routing/firewall needs, and just getting one or more cheap Wireless Access Points to handle the WiFi.  I have enough hardware just lying around that I could have done pfSense on a dedicated x86 machine, but the power, space, and noise were things I was not crazy about dealing with.  I'd thought about installing it on a VM on my Threadripper VM Host, but the networking would be a problem without additional hardware.  I finally got a 4x1G ethernet card for my VM Host, and stood up and pfSense VM.  

The config process was not bad, per se, but it was a little opaque in spots.  I have a separate Raspberry Pi running dnsmasq, handling local DNS, DHCP, and DNS forwarding, whereas nearly all of these modern router appliances have built-in, and a pretty enthusiastic about acting as your DHCP and DNS server.  Chalk it up to paranoia, if you like, but I prefer the "component stereo" model here, if for nothing else, it allows be to keep at least some of my more complex config stuff up and running if something like a router quits.  Getting DNS forwarding through pfSense was a little bit confusing at first, but I got it worked out.

Port forwarding turned out to be easy once I figured out that refreshing DHCP leases had to be done on target boxes for return traffic to go back through the router.  I'm smart.

OpenVPN server setup on pfSense has not brought me joy, yet, but it could, still.  I remain hopeful.  Part of the problem, I think, is that my network is on another RFC-1918 network -- that is, I need to traverse another "local" network to get to the Internet.

I ran into a couple hiccups when I tried to get one of the WAPs I bought working.  They're TP-Link AC1200 (TL-WA1201) devices, and they were cheap.  I bought 3, because why not.  The "quick setup" didn't seem to stick, entirely... so I had to kind of work through "not quick setup", and it seemed to take a few tries at that, with resets in between for it to really come up and do its job.  So far, an hour into its service life, the first TP-Link TL-WA1201 seems to be doing the right things.

So, now, my private network is fronted by a VM running pfSense through a dedicated 4x1GB ethernet card, and WiFi is running of a TP-Link WAP, and with any luck, I'll never have to deal with Netgear's stupid SSO nonsense again.

The next bit of excitement for the home network is a 48-port switch.  I know, how can I possibly justify a 48-port switch?!  Well... I'm not going to pretend that I have 48 wired Ethernet machines up and running all the time, but I do have 6 machines in my rack, and 20 or so machines strewn about, and I have little "desktop switches" all over the place... I'm hoping to get away from that.  Of course, that will mean doing more home-runs, but I'm hoping it will make for less confusing networking.

Monday, June 20, 2022

The RIBBBITN3RDing BitPump


The RIBBBITN3RDing BitPump


The RIBBBITN3RDing BitPump r0.1


A little bit of background 

I've been trying quite a few new things with my RIBBBIT65 designs, and I'm running into issues which aren't making a lot of sense.  I've also been having some trouble isolating issues (e.g. "known good" components or circuits don't work *here*... and it turns out "known good" wasn't)  I wanted to have a way that I could repeatably, and quickly, put a bunch of R65 Bus signal configurations ... snapshots, if you will... on the bus to confirm the thing is behaving the way I expect.  Rather than coding something up in 6502 Assembly for every different testing scenario - and, in the process, intoroducing the possibilty that the CORE board I'm using has a problem, I thought it would be better to do something like my TTL Busy Boxes, but on steroids.  The Busy Boxes are just boards with switches and/ or lights that let you do some multiple of 8 worth of switching and/or indicating.  The first one I designed has an 8-position DIP switch, 8 mini-tac switches, and a 10-segment LED bar graph.  That's great for, say, the data bus.  There's still the address bus (16 bits) and all the control signals.  Well, controlling 32 (or more) signals via DIP switches and/or Mini-Tac switches through 20 or 30 cycles (to test an ACIA or a VIA) just seemed like a nightmare.  ...if only there was a way to repeatably send out pre-defined bit patterns over regular time intervals...


The BitPump

The RIBBBITN3RDing BitPump is intended to be an easily reconfigurable digital signal generator which can provide the bit patterns necessary for in-circuit testing of subsystems which interface with 8-bit microcomputers.  


The BitPump, configured for use with the RIBBBIT65 provides:

  • an 8-bit bidirectional Data Bus
  • a 16-bit output-only Address Bus
  • 4 jumpered CPU Control signals (VPB, RWB, MLB, SYNC)
  • Jumpered Pull-ups for 5 CPU Control Inputs (SOB,RDY,BE,NMIB,IRWB,RSTB)
  • 8 bits of completely manual switching, both latching and momentary on each bit, with indicator LEDs
  • 1 "bus clock" driven by a separate IO pin from the bit pattern

The BitPump uses a RaspberryPi Pico (or simlar) to drive a set of four serial-to-parallel shift registers.  

The lower 8 bits (which in the original configuration are wired to the data bus) are bidirectional, and the data direction is controlled by the same "control bit" which drives the R65's RWB (Read, Not-Write) line.  In "Read" mode, the data lines from the bus are displayed on the LEDs.

Since the BitPump is driven by a RaspberryPi Pico (or equivalent), the user has the ability to easily re-program the device to send whatever bit patterns are desired at whatever speed is desired (within the confines of 74HCTXX switching speeds and the capabilities of the sytem under test).


Uses of the BitPump

I'm planning to use the BitPump to see what's going on with my Mini-ITX design.  There's definitely something rotten in Denmark.... hopefully I'll be able to use the BitPump's lower speed, and "known good" bit patterns to isolate the problem(s).  Similar story on the "CORE Daugher Support" board, which is basically supposed to provide a serial console, IO selects, pull-ups and a few other things to the CORE Daughter board I designed for the ITX MoBo, to just make it minimally interactive and runnable.  I plan to troubleshoot both these boards using bit pattern sets delivered by the BitPump.

After that , I plan to use the BitPump to test out different ways of running the 40x4 character LCDs I have.

I can also use it for direct testing of IO and memory chips, since the "data bus" is bidirectional.

What can you use it for?  I dunno.  You could build one and try it out.


Possible updates to the BitPump

One thing I think might be nice is a knob to control the "clock speed".  This could be done easily with a pot and one of the PWM inputs on the Pico.

Another thing that might be nice is a manually controlled "RUN/STOP/STEP" thing that could be done with a couple digital inputs on the Pico.

Do you have any ideas?

Thursday, April 7, 2022

PCB Prototyping - A Reflection

PCB Prototyping - A Reflection


My most recent orders with JLCPCB and OSHPark got me thinking:

  1. That's a curious price difference between the ITX motherboard and the older SystemIO board 
  2. I haven't quoted the same board with both shops.  Hmm.

ITX (yes, I know it says "ATX") board order from JLCPCB.
Also, the latest iteration of the SystemIO board for comparison.

Quote for ITX board (using the same Gerber files as the JLCPCB order) from OSHPark

OSHPark vs. JLCPCB pricing.  It's stark.  The R65 ITX board is 14 times more expensive @ OSHPark for only 60% of the product.  Per-board it's 23 times more expensive.  Call me crazy, but I don't see that as a trivial difference.  I'm sure if I was ordering at quantity from OSHPark, the per-piece price would be substantially lower, but I don't see them getting close to the "prototyping quantity" price from JLCPCB. 

I'm not trying to shit on OSHPark.  I'm glad they exist, and I'm glad they get business.  Seriously.  Their default PCB prototyping offering is decent, it's a little more featureful than offshore vendors, and for small quantities of small boards, the pricing is higher but not prohibitive.  I don't know about longevity of the boards... or greater-than-2-layer boards... quality of adhesives and so on.  

I have to say, though, that the packaging for shipping I've seen from OSHPark has been abysmal.  It's a heavy paper envelope.  Boards rattling around, unrestrained and unprotected.  I've had solder mask abraded away in shipping.  JLCPCB has shipped every board I've ordered, regardless of size, vacuum-packed in thick shrink bubble wrap with desiccant, packed in a box.  

Real-world turn times from China using DHL (the default shipping option) are on par with OSHPark -- a little more than a week.

I'm not getting any payment or barter or sponsorship or anything from JLCPCB.  I've just been very impressed with their quality, efficiency, and price.

You're certainly free to make the choices that work for you... and I know OSHPark has some community cachet and word-of-mouth defaultness like Kleenex/Xerox in the electronics hobby area... but I couldn't iterate like I have up to this point at OSHPark prices.  

Wednesday, March 30, 2022

RIBBBIT65 on Mini-ITX: The Pre-Dawn Chill

RIBBBIT65 on Mini-ITX: The Pre-Dawn Chill

Good news, everyone! I've taught the toaster to feel love!

Also, the design of r0.1 of the Mini-ITX version of the RIBBBIT65 is frozen!  After six months and at least a dozen "clear all tracks" re-works, switching the WDC chips from PDIPs to PLCCs to QFPs, changing all the TTLs and passives to SMT and a myriad other second-guessings and but-what-ifs, first light is in sight.

The board's ID block

The board has 1 ACIA (the serial console, as socketed PLCC), 3 VIAs (2 general pupose, and one "internal" for the LCD character display - as QFPs), and support chips to cover power, reset, PROM select, and IO select.  There are 5 DB9 serial ports and 2 DB25 connectors providing access to the general pupose VIAs.  ACIAs (with MAX232s) are available on "Serial Twin" daughter boards, and the system "core" is provided by a mezzanine board.

PROM and IO select signals, as well as IRQ lines for integrated peripherals are available on headers.

The top of the board, favoring the rear IO
The board is powered by a standard 24-pin ATX-style connector, and has an ATX-style pin header to support power and reset switches, and a power LED.

The top of the board, favoring the front edge
If everything goes according to plan, I should be able to just drop this board into one of a handful of Mini-ITX cases I have around, and cook.

The "core mezzanine board" has already been designed, fabbed, and assembled, and I'm pretty sure it's good to go.  The "serial twins" cards have been fabbed, and I've assembled one of them, so that's a plus.
"Core mezzanine board" with EEPROM address decoding

"Serial Twins" card with 2 MAX232s and PLCC sockets for 2 W65C51s 


...so, now, it's off to review proofs, fix any issues, and then off to manufacturing!


The back of the board, favoring the rear IO


I'm planning on streaming the assembly of this board, as this will likely be quite the educational experience for me, and hopefully you can learn something too, or at least be entertained by my hamfisted efforts!  Check out the RIBBBITN3RDing YouTube channel - subscribe and click the notify bell if you'd like to catch the streams live.  Eventually, I plan to edit the assembly down to a single video with boring bots cut out and tedious soldering sped up... but that will likely take a while.



Tuesday, January 4, 2022

RIBBBIT65 On Mini-ITX: The Before Times

 RIBBBIT65 On Mini-ITX: The Before Times


I've been ruminating and mulling on the possibility of implementing the RIBBBIT65 in a Mini-ITX form factor.  My goal for this is to fit the "CORE" and SystemIO functionality in a Mini-ITX footprint, make use of rear panel IO and front panel lights and switches, and be supplied by a standard ATX power supply connector.

My first pass at the design study was arranging paper cutouts on a cardboard Mini-ITX sized blank.  I quickly discovered that I could not fit the myriad functions I wanted on a Mini-ITX board using PDIP ICs.  This was the impetus for trying to implement the address decoding using an EEPROM.  I then toyed with a few variations on the theme of mezzanine boards... putting the CORE and primary peripherals on the motherboard, and "secondary" peripherals on the mez... putting the main peripherals on the main board, and the CORE on a mez... I settled on putting the CORE on a mezzanine, in large part, because its conversation with the IO is isolated to 8 address lines, 8 data lines, and an AD line.  Sure, you need clock, RW, IRQ and so on... but... that simplifies routing immensely on the motherboard.  It also permits me to use the CORE mezzanine in other applications if I want/need.

Goals

My first goal was trying to make a CORE mezzanine board.  I figured making that fit on something I could stack on a Mini-ITX board would be something of an accomplishment.  It would also give me something solid and tangible I could design against.


PotatoCam view of r0.1 of the CORE mezzanine card
for the RIBBBIT65 Mini-ITX 

KiCAD 3D render of in-progress r0.1 of the
RIBBBIT65 Mini-ITX Motherboard

Above is my second layout of the RIBBBIT65 Mini-ITX, and I think this might be the best I can do under the circumstances.  I don't know if this version of the RIBBBIT65 Mini-ITX is ever going to go to manufacturing. There's just so many compromises. I wanted to at least do a PCB layout to get a sense of the issues I was facing. I may send it out to manufacturing just to validate the integration... work out any bugs before I switch to PLCCs and SMT, but I really think PLCCs for the WDC chips and SMT for the passives and jellybean logic is going to have to be the way forward for the Mini-ITX form factor if I'm going to fit everything I want on there.

The journey continues...


Sunday, December 26, 2021

Tools!

Tools!

Getting started in hobby electronics is a lot easier today than it was 30 years ago.  Back then, you were lucky if you had a decent electronics shop within an hour's drive, and even then, the on-hand stock of parts and tools was likely a mere sprinkling of what was really out there.  If you weren't already in the business, or fortunate enough to live near a tech-heavy area like Boston or Silicon Valley you had to depend on magazine ads and scant occasional word of mouth to have any idea what lay beyond one's own confining horizon.

Today, we're spoiled for choice.   The Open Source movement has breathed new life into "technology as a hobby".   The Internet has brought both the world of commerce, and of information right to your desk. Advances in semiconductor manufacturing, miniaturization, and yields have brought about unprecedented declines in cost-per-transistor and increases in transistors-per-square-millimeter.  Economies of scale have made what, back in the day, we would have called "electronics surplus" an industry unto itself.

Here are some of the tools I use while working on the RIBBBIT65 (none of these are affiliate or sponsored links):

Register The Click

 Remember when computers acted like computers? Remember when you could tell a computer, "when this condition exists, do these things, t...