OneVariable Newsletter - 2021-12-08
2021-12-08More design, lots of waiting, and a bit of planning!
This article was originally featured on the OneVariable Applied Research newsletter. If you'd like to get early access to these reports, you can sign up for the newsletter here. Newsletter emails are sent every Wednesday.
Articles are posted on my blog one week after appearing on the newsletter.
Abstract and Results
Compared to last week, this week was all over the place!
A4 - Anachro Forth has a new name!
Early in the week, I used Advent of Code as an excuse to improve and extend A4 - the Anachro Forth compiler/runtime.
The A4 compiler now has a command line interface, and is capable of:
- Installing from crates.io, by running
cargo install a4
- Compiling source files into compressed bytecode form
- Running an interactive Read, Evaluate, Print, Loop (REPL) interpreter
- Running an A4 program from a file
Check out the A4 Readme for more details, and the Advent of Code example folder to see how it works! So far I've only implemented a solution for the first day, but I hope to come back and implement all of the 2021 Advent challenges.
A Flat-pack case for Powerbus Mini
Since this version of Powerbus doesn't have my typical Lego mounting holes, I needed to design a case for the Powerbus Mini PCBAs. Luckily, I have a great laser cutting guy here in Berlin, so I designed a case in KiCad, which will be cut out of 3mm plywood.
The green lines are the cut-outs for assembly, and the pink lines will be engraved graphics on the top of the case. Designing the cases in KiCAD (on user layers) makes things really easy to make sure all of the ports and mounting holes are properly aligned, and I can export the layers as SVGs for manufacturing.
I sent out the design earlier this week, and should have the parts in hand in time for the boards to be assembled.
The boards including the case only clock in at a tiny 64x64mm, or about 2.5 inches square!
A Prototype Expansion Card
In order to prototype the expansion cards, I also designed a quick breakout board for the expansion port on the Powerbus Mini. This card breaks out all of the signals and power available from the header, a little bit of prototyping space, as well as an I2C EEPROM for storing compiled A4 drivers, and a higher-power (1A) 3.3v LDO for powering external components.
I ordered these boards unassembled from Aisler here in Europe, and I'll be assembling them myself. I just got the shipping notification today, so they should arrive by this weekend.
I also ordered a couple of IR LEDs and IR receivers, as a couple folks suggested that an "IR blaster" might be an interesting expansion card to control fans, A/V equipment, as well as heaters and air conditioning units.
I'm looking forward to playing around with the expansion port, as I think this is the coolest feature of Powerbus: the ability to quickly make simple Plug and Play embedded devices, with all of the networking and power handled by the main board.
Lots of waiting for parts to arrive this week, but expect a ton of pictures of assembled hardware in the next newsletter!
Background Information
The original Anachro project was intended to be a hobbyist-style retro-future PC architecture. I talked about the design of this in a talk at the end of 2020 at the RustLab conference.
While I originally set out to build a PC architecture, I realized the bulk of the work was writing the communications interface, which became the Anachro Network Protocol.
The Anachro Protocol is designed as a single server and many client architecture, and is designed to be lightweight, allowing for embedded devices to act as either a server or client role (or both!). This allows the embedded system to act as a server, and treat a PC or other embedded systems equally as clients.
The Anachro protocol has a couple of different communication modes, including a "fire and forget" UDP-style mode, a "guaranteed reception" TCP-style mode, as well as an MQTT-SN inspired "publish and subscribe" mode.
It also was designed to be interface-agnostic, allowing it to run over nearly any digital interface. So far, I've implemented TCP, UART, SPI, and Wireless transports.
Up to now, Powerbus has been using "raw" RS-485 messages to communicate, but I will be adding the Anachro protocol as an application layer on top of RS-485 messages for functionality moving forward.
This will let me take advantage of some of my already implemented and tested functionality, particularly the pub/sub features, which will come in handy for device-to-device communication, without requiring every device to keep track of all other nodes on the bus.
This week I plan to get back into the Anachro Network Protocol code-base, by updating it to match the current Powerbus techniques I've been working on, writing tests and docs, and getting it up and running for the Powerbus Mini hardware!
Suggestions for Future Research
This week I also put some time into thinking about the firmware architecture of what Powerbus will need to be, once all of the parts I am building have been combined.
To do this, I've put together a representative use case, with a network of devices providing a PC interface, a control panel, lighting, motion sensors, as well as CO2 sensors. This has helped me "game out" all of the parts that I will need.
I'll be using this as a thought experiment for now, but it also describes an installation that I've discussed with a friend in the past, so it might end up being real sooner than later!
I've also started tracking all of the open tasks for Powerbus Mini in GitHub Projects, which will hopefully keep me on track for the first beta release by the end of the year. Fingers crossed!
As always, lots more to do, but progress has been coming along quickly!
Stay tuned for more, and thanks for all of your support!
Want to stay in touch between newsletters?
Click here to join the OneVariable Applied Research Matrix chat. I'll be posting day-to-day information, and sharing my thoughts as I go.
The Matrix chat is the best place to ask questions about my projects, give feedback, or inquire about using any of my research projects for your commercial (and non-commercial) applications!