I'm building a phone out of a raspberry pi compute module 4 into the back of a blackberry priv, to run a full fat linux OS
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
For anyone who’s been following along, particularly those who want to have a go at doing this themselves once it’s finished, I’m sure you’ll have noticed that at some point in the last few logs, I mentioned things getting easier from that point on. Unfortunately, I was mistaken.
Firstly, the replacement screen I found straight up just will not work with the compute module. I must have spent 5-6 hours on it, and I think there’s more I could try, but realistically, it’s over for that one, which is a real pain in the butt, because according to panelook, it’s one of the few in 5.5” that’s both available to buy as individual units, and also has touch built in. I did find another screen (another 3-4 to be precise), so I’m starting cheapest first, and I’ll update back when I get anywhere with that one (I did a ton of research though, and it uses the same driver IC + pixel format + pin arrangement as a range of TTL monitors available on adafruit, so I think I’m in with more of a chance this time).
Then there were the parts. The modem is just too damn big. Having taken it apart in hopes of finding a tiny little circuit board with lots of empty space and some roomy LED circuitry, that’s unfortunately not what I found, which is frustrating, because the damn thing is about as long as the priv, which means either a lot less space for batteries, or it’s got to be about 5-6cm thick. Not to mention, in sticking with the DAC I’m insisting on, I’m losing quite a lot of space there too, especially with the cables I’ve got to use. Also, a USB hub I decided on isn’t available without a header, which butters precisely 0 parsnips.
However, I’ve still never really been taught how to give up, and I’ve got so much to do these days, that I simply don’t have the time to sit down and figure that out, so instead, I’ve come up with a battle plan to deal with all of these new issues.
as previously mentioned, I’ve changed the screen. It’s kinda good too, because this one is a much lower resolution, which means much lower power. For anyone who insists on 4k or even 1080p, first off, why? 30” 1080p monitors are perfectly acceptable with a pixel density of approx 73ppi, and 854x480 in 5.5” is 173ppi. But also, I’d investigate one of the sharp 5.5” monitors, I think I’ve heard of the LS055R1SX03 working with the cm4/rpi4 but there’s no touch.
Then for the modem, I’ll be pivoting back to a hat (kinda). Should have seen that one coming, but you live and you learn, and the whole point of this is to both document that process, be able to explain why my pitfalls are pitfalls, and be able to provide you the reader with a definitive method + ingredients for achieving the end goal. I believe wave share has similar sim7600 4g hat (specifically the B one) which looks perfectly acceptable, and significantly smaller, downside is on the cm4, it’s still a usb dongle, and therefore comes with all the limitations of needing a USB port + cable and space requirements.
HOWEVER! I had another brain wave (apologies to everyone involved), when is a non hat not a non hat? (When it’s a hat, dune is so good).
The waveshare sim 7600g modem (B) is designed for USB usage in all other pi models than the zero, which it’s designed to stack with, maybe you can see what I’m getting at now.
After seeing the Nokia N95 that got blender on it, a lot of my preconceptions of what’s possible have kind of been blown out of the water, and I’m determined to do more with less computing power. Not to mention, the pi zero 2 w fixes a significant issue with the maximum wattage, where the cm4 can run at a max of 10w during heavy use, the pi zero 2 maxes out around 2.5w, theoretically quadrupling the battery time, while also freeing up much needed physical space.
considering I already have the cm4 + a working version of postmarket OS, I’m not falling over myself to make this change, and I think it will introduce significant functionality challenges (I was eyeing up a Nokia...
(preface: two logs in one day, aren't I productive)
I have now attempted to order this screen 4 times:
https://www.waveshare.com/6inch-hdmi-amoled.htm
Granted not from waveshare, you can't buy it from there (I even messaged customer support, and felt very silly the entire time about it). Spotpear, the company that waveshare works with (subcontracts? Buys parts off? Who knows) does have them listed, but will inform you they're discontinued after purchase. Aliexpress has it listed 3 more times, one with a shop that has since delisted it (it's called shop and then bunchanumbers), and then another two from smeiier (I tried purchasing once, and I got nothing).
It's extremely annoying, because this screen almost exactly fits the dimensions of the blackberry priv's top frame, and would sit nicely underneath the curved glass, however, it was not to be (seriously though, if anyone finds one for sale that isn't discontinued, and you actually manage to get one to show up, please send details my way).
So, that leaves me with two options, both of which have huge downsides and upsides. Either I try to fit a screen between the glass and the top frame, or I design my own top frame (and glass). Both of these have pros and cons, and again, I wouldn't be posting if I hadn't already made a decision, so I'll try to keep my reasoning concise, and I'll say now, I went for designing my own top frame (STL/Blend files will be included, I had to redo the damn thing 8 times, which I guess is about the mileage I can expect when I use a clothes tape measure to try to reverse engineer professional design with low tolerances, but c'est la vie and all that).
Pro doing your own top frame:
-Blackberries are dying out. I know it's already a dead platform, but they're well past the dip into obscurity (by like 2-3 years I think), and slowly peaking upwards into collectible territory, which means they're rarer and expensiver. I'm glad I could get the priv I got (working before I got my grubby mitts on it too), not to mention the replacement parts, but I don't count on them being available in the planned life-cycle of this phone (50-70 years+). Having your own STL files available to print off new parts as and when makes things a lot easier
-Current screen availability makes choosing for the current frame a nightmare. Either I'd be picking something vastly smaller than the existing screen, or experimenting with/damaging past warranty expensive flexible screens. By doing my own flat top frame, I expand available real estate from 65mm x 138mm to 72mm x 137mm, with room to increase (I printed the bevels a bit wider than I had to). It might not sound like much, but at the dimensions we're dealing with (betwixt 5 and 6.1" diagonal screens), the extra with is what stands between a 1mm bevel, and a 1.5cm bevel, and a £50 screen or a £300 screen.
-It's fun. This project is very much a showcase of everything I'm mediocre at, and more importantly, a chance to improve. Having never owned a 3D printer before, going back over my blender knowledge, and doing it in a more functional way dusts the cobwebs off those braincells. For anyone having a go at their own version of this, I'd recommend you don't download the STL files, go for the blends and make your own version. Curve the edges. Adapt it to your screen
-diy screen layering. I'm sure this will come up later as an issue I've seriously overlooked, but for now, I'm in such a great position to laugh (hubristically so) at smartphone manufacturers choosing ultra-thin glass lenses for their screens. As far as I know, capacitive touch works through about up to a centimetre, maybe slightly less. According to this, just 0.5mm more would make phones "unbreakable". I'm more than happy to go for glass a few millimetres thick (like 2-3 maybe), so we'll see how that plays out, although I've just had a quote for £60...
Pro re-using the priv's top frame:
-You don't need to do so...
I promised it'd be days not weeks last time, and I think legally that's still technically true (your honour), but for anyone that needs an excuse, I had a nasty headcold for a few days midweek, so there.
Now that that's dealt with and we're all happy, here's how to get the keyboard working!
You will need:
-To read through this: https://hackaday.io/project/164232-thumb-keyboard (read through all of the project logs, oldest first, it's an amazing comprehensive breakdown of the entire process, with photos and parts and just about everything you'll need)
-the code in here (I'll github it later dw): https://pastebin.com/jzaQqKbf
-like 100 2 pin momentary buttons (maybe 4 pin is better, but I used 2, I've probably shot myself in the foot there a little)
-a few breadboards
-some wire (really any will do, I used a bunch of old stuff I had from another project a while a go. Not one I came up with mind, I just needed a mixer for cheap)
-a soldering iron
-your priv's keypad.
-two pi picos (one with headers soldered, one without)
-electrical tape
-a single/double AA battery holder
-a box of LEDs
-a bunch of female to female dupont cables
-mu editor installed
-pimoroni trackball
Step 1:
Once you've familiarised yourself with the entire process of making a keyboard, thanks to David Boucher, you're going to want to consider a couple more things (and I will update this with photos later). Firstly, you need the button layout to sit underneath the priv's keymat. To achieve this, I did a rough layout through the breadboard, bent one pin on each switch, and then started soldering so they would stick without wobbling. If you wanted to be really need, you could use some sort of glue too, may I recommend super. Secondly, you'll have to consider whether or not you want to have lighting. Now, I absolutely do, I love typing in the dark, but I also love being able to see which key I'm going to press, so factor in room for your lighting on the board there too (and how you're going to make it play nice with the pico, I'd recommend looking into neopixel lights)
Step 2:
Solder your rows and columns. Be very careful with these because you're not going to have a ton of space to avoid shorting them together. I'd recommend soldering the rows together, and overlaying with electrical/insulation tape, then doing your columns afterwards. I'd then check your soldering by attaching the rows to one end of the battery holder, an LED to the other end, and then attaching all the columns to that part of the LED. It's a pretty quick way to debug your solder, which if you're trying to underlay the priv's keymat with, you will absolutely make mistakes, double so if you're using your dad's old soldering iron with no temp control, and a poorly fitting tip that you crimped on with some pliers.
Step 3:
Look up the instructions to load circuitpy on your pi pico (the one with the headers), and get blink working. It's turned into a bit of a superstition for me, but frankly, I've gotten through a silly amount of boards doing this project, including an actual release of the magic smoke from an arduino uno r4 minima (it's still working too), so just check the actual process of making the pico do things is working. You're gonna want to use Mu for this too. I did try using Thonny, but I didn't get all that far, where Mu was much more plug and play. It's not a nice editor by all accounts, but considering I am not a microcontroller expert, it's been a friend in time of need.
Step 4:
Now that you've got your pico working with blink (very cool), connect up your trackball to the pico (connect 3-5v to 3v3, sda to gp20, scl to gp21, and gnd to the gnd above the 3v3 pin. We can leave int for now). To do this, I would solder on some of your wire, and then make the ends long enough to connect up to the duponts (whatever you do, just make sure they're making contact, this is the most expensive component in this step).
Copy...
Every good project deserves its Eureka moment, and it's safe to say I've had mine.
I am not an electrical engineer. I'm not an embedded engineer, and as far as software engineering goes, I have many shortfalls (for example, the fact that I haven't touched python since a program I made for an artist friend of mine a few years ago). But I've gone and whipped up a keyboard mouse device.
I want to type up a more detailed log later, detailing exactly how I did it, and showing you the reader, not just how to make this specific device, but how to make something adjacent, or adapted; so for example, where you'd be looking for potential issues. After all, as someone who's had to learn this from basically scratch, I'm in a fantastic position to be showing people the pitfalls that I've spent so long rolling around in.
However, it's my log, and I'll cry if I want to, but I may as well be somewhat productive about it, so here's how I went about solving my biggest challenge on the project.
To build your average keyboard, you're going to need:
-a whole bunch of buttons
-some pcb
-some wire
-some solder
-a controller of some variety
-an awareness of the ports you're using
-some electrical tape
-some milk (for when you drop your soldering iron and pick it up by the hot end)
-maybe 3-4 tutorials
For this project, the first main problem was mostly trivial. Pull off the keymat, figure out how much wiggle it has, and see if I can press different buttons through it (yes, I can, marvellous). My next problem was software. After all, I have no way (or money) to print custom PCBs, so I'm working fully store bought, this means that anything I make has to both run on whatever I build it on, work properly with the wiring of the keyboard, and be able to talk to the poor device it's plugged into. After much to-ing and fro-ing, I worked off of four main pieces of information:
-https://hackaday.io/project/164232-thumb-keyboard David Boucher's thumb keyboard. It's just about the best tutorial around, and just about the easiest mini keyboard to put together (i.e. still difficult, but easier than some others)
-https://dronebotworkshop.com/pi-pico-circuitpython/ a nice handy guide on getting you started with most of what you'll need to make your device
-this video
-https://www.hackster.io/TomoDesigns/the-super-easy-pico-keyboard-989e7d#toc-step-15--the-code-16 this is where I actually found how to use the above video in circuit python
Through the magical power of all of this guidance, I was able to produce something that works maybe about half as well as any individual of them, and has an eighth the utility (so far)
I will be releasing (and explaining the code) once it's much neater and adds some functionality, but this log is for explaining my process.
Of course, it wouldn't be a me project if I didn't go one further, and another key issue I felt I needed to solve, is the pointer device. Anyone who's anyone knows offhand that since the blackberry passport, blackberry devices have had built in trackpads on their keyboards (disregarding being hamstrung based on region locking, the one I ripped to shreds was stuck as a scrollpad). Now, perhaps there's not quite so much utility in these phones having trackpads. Especially not large ones. However, picture yourself trying to use linux on a 5" touchscreen, and suddenly, at least for me, some sort of manual, non-touchscreen pointing device may be useful, at least for those of us who haven't quite yet transcended gui such as myself.
I had 4 solutions.
1) reverse engineer blackberry's approach
I actually had I think 3 ways I could do this one. Capacitive trackpads are surprisingly intuitive, and come in a range of decades that they look like.
For example, for a 70s looking approach: https://www.hackster.io/gatoninja236/capacitive-touch-sensing-grid-f98144, I would love to see anyone include one of these sandwiched between buttons and a keymat. They seem easy enough to do, requiring...
I'll try to keep this section well formatted, because it's half going to serve as the bill of materials, but I'll add my research in, because if you're doing your own variant of this where something that's a dependency for me isn't for you, it may be worth having that information.
Main board: Raspberry Pi Compute Module 4, 8gb RAM, 16gb eMMC, with a waveshare nano (B) carrier board
I had a ton of back and forth on this, and in reality, there's no out and out bad option, but each board I could find comes with problems.
My main contenders were:
Raspberry Pi 5
Raspberry Pi Compute Module 4
Khadas Edge V
Repurposing an emulator console board
Some Orange/Banana pi board
Onion Omega 2 LTE
I went with a compute module 4 with 8gb ram. You could use an eMMC version or not, you should be able to add your own storage later. It's not too power hungry, but it's not all that powerful either. It gives you a full 4 lane mipi dsi port, and it's one of the smaller boards from the selection. It's also extremely compatible with aftermarket parts/hats, so it really is a middle of the road option that I picked mostly to minimise cost and issues, in the face of having a device with all the bells and whistles - after all, my bells and whistles are going to be HID devices and mech-eng.
The raspberry Pi 5 unfortunately requires a 25 watt power supply, so for portable devices, you're limited to either using an absolutely huge battery, with extra power needed for peripherals, or having maybe 2-3 hours of use time. That's fine for a heavier gaming rig like a steam deck, where you're only going to have a little time to sit down and play, but for a device you need for utility, that's not going to work.
The Khadas Edge V was actually a pretty good option. The manufacturer's power board did seem a bit limiting, but if I can power over USB, that's mostly problem solved. What held me back was lack of support and community, as with orange and banana pi boards. Immediately, you lock yourself out of a huge chunk of any market that offers arduino and raspberry pi compatible hats and expansion boards. Similarly, as Jeff Geerling notes, the OS updates are thin on the ground, where the pi foundation supports their old boards, and is continually releasing updates. I know there was an orange or banana pi compute module in the shape of a CM4 that was particularly appealing to me, but again, this project is possibly my largest to date, the wheels need greasing if I'm going to finish this ever, and to labour the metaphor, them's some rusty wheels.
As for an emulator (or other) board, those actually did have me thinking for a while. They're high powered enough for games, but specifically designed for handheld use. The catch, is that I'd already decided on a form factor, which is a blessing in narrowing down my options, but a curse as far as locking me out of options like this goes. Perhaps something for someone else to consider? Either way, while I'm not scared of motherboard trimming I promise, it does seem wasteful having to slice off perfectly good buttons for fundamentally no real reason.
The Onion Omega 2 is actually begging to have a phone built around it with its built in LTE module. Something for someone else however, because for all its selling points, it's extremely underpowered with 128 MB memory, and 32 MB storage among other issues. Once you start meddling with memory, the convenience of a single board computer is somewhat undermined, so something for someone else to try expanding on I think.
Worth a mention are the raspberry pi zero 2 based devices. A raspberry pi zero 2 is a fantastic option for low power usage, and if you can make concessions on other processing intensive parts of your project (screen resolution/graphical interface, some other utility), something like the tinydeck or lillygo t-deck might be worth investigating. I would also recommend looking up the sharpikeebo, BlakRpi, and any other such project. Lastly, there's the SQFMI Beepy, but that...
At some point, what I want in a phone started diverging from what was available. First to go was the headphone jack. Then replaceable batteries, hard keyboards, moving parts, interesting cameras (no amount of cameras will ever be cooler or more usable to me than the samsung s3 zoom), expandable storage, and even styluses. Not to mention the bloatware, and plethora of unknown goings on the average smartphone has. Why does my calculator need to access my contacts? Why do I have to ask to not be tracked? How come I'm looking at new tech and feeling absolutely nothing? Where did the slide mechanism go, and who decides what's "transitory".
There are three solutions to these issues.
1) revert to feature phones.
Feature phones, or unkindly, "dumb" phones don't need the tracking, the internet connection, or any of the arbitrary nonsense smartphones require out of the box. They still have headphone jacks (some of them), replaceable batteries, and generally, they actually still work, minus the updates that seem to be sneaking in every other night. Some of them look very unusual too, so I'm sure I could find one that satisfies my need for something a little different (and slidey). They also don't always have cameras, expandable storage, or much functionality beyond just being a phone in many cases. I admire every single person who's gone down this route. There's some fantastic offerings, immaculately well maintained in many a bedroom drawer available to anyone who wants this, but it's not for me. I want a computer that goes in my pocket.
2) grin and bear it.
Smartphones have stopped being exciting and new, and started to be borderline necessary to participate in society. QR codes pop up just about anywhere. Tap to pay works on the trains and busses. Something something homework schools (I have absolutely no clue, but it's conceivable). Yeah the battery life is never what we want, and there hasn't really been anything exciting or new since maybe QI charging, the folding touch screen (which I do not like), or when 5g got normal-ish, but for the most part, these devices work, they're not slow, and they do pretty much everything most people want. I'm not most people, nor am I satisfied with "most", especially when actually it's maybe half.
3) DIY
There's something appealing about living on the fringes of society. Half participating, but mostly doing my own thing. Granted the extent of that is making my own phone and looking a tiny bit kookier than some people, but it makes me happy and fills up my weekends- if only the same could be said of my bank account. It does mean however that I can tailor a device to my own needs; bring back the functionality that has been deemed "transitory" or unnecessary.
I wouldn't be posting on hackaday if I was going for 1 or 2, so here is the criteria for any device I want to make:
-Great audio
I hate bluetooth earbuds, I will not use them, I will not buy them, and I think they're a step backwards in technological development. We were relatively done with bluetooth outside of game controllers in the mid to late 2000s and early 2010s before Apple saw potential for money making in both removing a feature, and selling the solution. Prior to that, wireless headphones were seen as a gimmick, and rightly so. I don't want to have to charge a device that should be passive. I don't want to rely on a soundcard smaller than a penny. Furthermore, before the removal of the headphone jack, companies were doing their darndest to half ass the sound as it was. It's recognised in the audio community that iPods pre-2012 use better soundcards, same with the phones. I refuse to cowtow to the kind of industry nonsense that's directly contributed to my ears being less pampered, and as such, I will use an amazing sound card, preferably with extra jacks too, just in case I want to use it on my home sound systems, and partially just to be able to show off ("oooooh does your phone not have a line...
Read more »
Create an account to leave a comment. Already have an account? Log In.
Become a member to follow this project and never miss any updates