Beautiful seeing this on top of HN. :)
That message is from me. Nice to see someone using the access for something cool.
One of the reasons I decided to add it there was to give some visibility to this "feature" of EG-25G FW to people interested enough to look at dmesg.
That's how it works.
> Is there anyway to make the modem more efficient, since its cpu is just consuming power and not adding much to the functionality of the phone?
Modem is sleeping most of the time. (at least with my driver) It's much more efficient than the main A64 SoC. Like 10mW sleep vs 100mW sleep.
> Can you think of a more efficient protocol between the modem and main cpu then the AT-based ril with constant status checks?
ModemManager/ofono are not using AT interface, I think. They are using QMI.
Anyway, you don't need constant status checks even with AT interface. You just enable status indications you want to receive and that's what you'll get without polling.
And you can setup wakeup on call/sms too.
The world is a small place indeed.
You can run DNS, a VPN, or a small web server even on a VPS with 32MB of RAM so those are pretty cool specs.
It also was our main e-mail server and web server, hosting both our own website and several customer websites. We had a second one of the same specs for a few other things and backups, but that was our main workhorse.
[EDIT: They were running Linux 1.0 and 1.2, first with NCSA httpd, then Apache; when we first got them they ran Slackware, installed from floppies; I think we ended up installing Redhat at some point before we retired them; the modems were hanging off Cyclades serial cards; and they were literally hanging - for our first 16 lines we had US Robotics Sportster modems hanging on the wall. (I'm writing this in the hope someone will tell me to get off their lawn and tell me how they did more with less, btw.) ]
My P1 would stutter while playing MP3s :-))
Intel MMX (multimedia extensions) introduced dedicated hardware to accelerate things like MP3 decoding.
MMX was pretty useless (reuses FPU registers = cant run FPU code in parallel) marketing gimmick from Intel designed to tick boxes, promoted with fake "designed for MMX" campaign https://www.mobygames.com/images/covers/l/51358-pod-windows-... spoilers: MMX enables one sound filter in the whole game, no speed difference. Ubisoft just made some extra cash by printing this on the box.
MMX was one of Intel's many Native Signal Processing (NSP) initiatives. They had plenty of ideas for making PCs dependent on Intel hardware, something Nvidia is really good at these days (physx, cuda, hairworks, gameworks). Thankfully Microsoft was quick to kill their other fancy plans https://www.theregister.co.uk/1998/11/11/microsoft_said_drop... Microsoft did the same thing to Creative with Vista killing DirectAudio, out of fear that one company was gripping positional audio monopoly on their platform.
This is a weird statement. "MP3 encode/decode requires floating point unless you implement in fixed point such that you don't need floating point." It's perfectly possible to write fixed point MP3 decoders.
Sure, MMX wasn't that great, but it was Intel's first SIMD extension, was definitely intended to help with "things like MP3 decoding," and was followed by a ton of improved extensions with similar goals.
Linux is a fully preemptive OS with a kernel designed to return from system calls quickly, without blocking all the processes in the system. No surprise it fared better.
I was so excited about it, and my mom had done some punch-card programming in university and so knew that this was going to be the future.
The Sinclair Spectrum 48k had just come out, and so we splurged and bought one.
We lived in Asia at the time, and games on cassette were difficult to get, so at 10 years old I spent hours typing in BASIC games from magazines, debugging and POKEing and PEEKing to see how things worked.
I had to kill all extra processes or else the machine (maybe the fault of the HDD) couldn't keep the buffer filled and the write operation would fail.
I made a lot of coasters, but that was my favorite time with computers (1999 or so).
Lots of fond memories of norton commander, wordperfect and the old versions of battle chess.
Good times! I wish I had understood back then how much computers were going to change the world. Luckily my parents did.
By that time I think Pentium III was close to launch or even already released.
(Can't remember the rest afterwards...)
I remember they were saving up for many months to get this for me.
When (many years later) I had a P3 (or a P4?), I would switch on my Amstrad and feel warmth in my heart, as if I was hugging an old friend.
make it CDC 6500
A fully open source firmware for GPS/LTE modem is badly needed.
It's worse - there's a second, independent computer inside your phone that you have no control over: the SIM card.
The SIM is a standalone computer with its own processor and memory which your carrier can communicate with and upload programs to run on it without your knowledge ("OTA updates", etc.)
> The eSIM (embedded SIM) is a small chip soldered directly to a board inside a device
The Wii, and PlayStations since the PS3 have had system control processors that can perform downloads, updates, and general system maintenance on a low power processors even while the majority of the system is off. In the Wii that processor was also responsible for the majority of the network stack even when accessed from the main processor. On the PS4 that processor even ran a relatively complete FreeBSD.
Democratizing these techniques would be killer.
Since we're here, I did a quick grep through today's access log. It appears that your link got me 573 visitors to that article and 56 people clicking through to the other article linked therein.
My mind is blown that anyone writes software for stacks that max out at few hundred requests per second.
Everything I've seen comparing "high level" languages says programmers work around the same efficiency whatever the language. So why isn't everything done in Go, C#, and Java where 100,000 requests/second is trivial?
Even if you don't have much load, isn't the possibiliy of a cat DDoS'ing you by sleeping on someone's F5 key at least slightly concerning?
I swear half these companies that claim their site is "being DDoS'ed!" it's just somebody just running HTTrack to archive an article they like.
I hit SHIFT-CTRL-r to watch the page reload under the network debugger so I could get a snapshot of the total size, which looks to be about 100KB, just eyeballing the sums, so at 10MB/s it should be able to serve around 100 requests/second, which is enough for most websites, even ones getting hugged.
The former worked fast and without any issues, but the latter just groaned and groaned and crashed.
During the transition, a prof asked the class which one to use and all 250 people said in unison “CCnet”.
“ Its main virtues were the stark, no-nonsense interface and the incredibly efficient (although complex) database system that made CCNet ideal for running large numbers of courses with very little by way of server computing resources.”
One of the reasons were trying to migrate is that Rails servers cost us almost an engineer salary, where our other backend is ~200/month
My AWS S3 skills weren't good enough to figure out the CDN + https. S3 static hosting without those was super simple though.
I speak as a software engineer whose blog has hit the HN frontpage multiple times, and who has optimized my blog to be static & lightweight, just like the author. In my experience, a front-page HN post (in the top 3) leads to 30-40 page hits per second. The page at https://nns.ee/blog/2021/04/01/modem-blog.html weights 44.4 kB transferred (HTML, CSS, images, fonts, etc, all compressed over HTTPS). So this is 11-15 Mbit/s of peak bandwidth, below the maximum throughput the author measured on the Pine phone modem (20.7 Mbit/s).
And the bottleneck is going to be purely network. Not CPU. Not disk. Just serving a small set of files cached in RAM by the pagecache.
$ curl --head 'https://nns.ee/blog/2021/04/01/modem-blog.html'
date: Fri, 02 Apr 2021 13:28:26 GMT
last-modified: Fri, 02 Apr 2021 09:40:40 GMT
No idea if he's caching there, though.
(FWIW, I think the darkhttpd's website uses... Apache)
% curl -I https://nns.ee/blog/status.html
date: Fri, 02 Apr 2021 14:48:48 GMT
last-modified: Fri, 02 Apr 2021 14:48:31 GMT
But also, serving static content is more or less a matter of network connection speed. You can cache everything in RAM and write data to a socket very quickly. HTTPS makes things a little wonky because you can’t just sendfile() files directly into a socket but the overhead is still pretty minimal.
setsockopt(sock, SOL_TCP, TCP_ULP, "tls", sizeof("tls"));
You pretty much never need that, but many/most sites do it somewhere anyway.
A static site running on a modem should be fine, but there is nothing saying they cant/arent using a CDN too, which would be even better.
It was just used to catch attention.
But with a CDN in front it might likely work out.
Internet --> USB --> Pinephone CPU --> (ADB forwarding) --> Pinephone modem with webserver.
That's cool, but I am slightly disappointed. I was hoping to find out that some ISPs allowed to forward ports over LTE.
Here, I don't really see the advantage over doing it on the main CPU, since it will have to forward packets anyway. And you can use the same reasoning with whatever the pinephone is connected to.
However, there's nothing stopping me from getting a data SIM from my provider (who does allow forwarding ports over LTE). I just currently don't have any spare SIM cards at hand. But that is the plan.
Although the latency will likely skyrocket, I would be very interested in measuring the energy efficiency. The main CPU could even be completely shut down.
You can even imagine calling the main CPU as backup if there are too many incoming requests, though it would be better to use a (likely available) ethernet-over-USB instead of ADB forwarding, and that scenario is unlikely if just for a static blog.
Anyway, if you do so, please make sure to publish a new blog post, post it here, and plot the power consumption during the hug. That would be some interesting data!
Thank you, sincerely!
I really wonder why modem manufacturers feel the need to encapsulate everything so much. Is it for regulatory reasons, to protect their secret sauce, or for our convenience? On the one hand it makes simple things really easy with some AT commands, on the other hand it makes debugging quite frustrating because it is a black box.
If you just unlocked everything, it would probably be better at what it does, but it would also not be possible to sell to consumers.
Those rules exist to this day but have no relevance. However I suspect there are other similar but slightly more sane rules in play since modems are now just software defined radios that can be made to do nearly anything you want given the right access - i.e you can cause a lot of trouble, even if you don't intend to.
E.g., CA requires tags for your vehicles (fair enough -- gotta charge people for the privilege of driving at all, not just incrementally through gas taxes and whatnot /s), but the law isn't that your vehicle be registered and have tags purchased; it's that valid tags must be displayed on the vehicle.
That makes enforcement super easy because an officer can just walk up and down a line of cars handing out tickets, but it also means that people can break the law for no fault of their own even after having taken the action the law was intending to promote (paying CA in this case). If you tried to renew your tags at the right time in 2020, even months before they were set to expire, you couldn't pick them up in person (covid) and wouldn't receive them in the mail till after the governor's order temporarily allowing you to drive with expired tags had expired. Moreover, at least one police department was excited to cash in on that discrepancy :)
The problem in that example is that the behavior the law is supposed to encourage (paying CA if you own a car) only partially aligns with what the law punishes (not displaying a valid tag on your car). That lack of alignment leaves room for exploitation.
That's just a small example (intentionally so -- hopefully it's simple enough so as to not be controversial), but it's a constant pattern in our legal system:
- Taser-immune meth-heads robbing people at knife point is bad, so let's make a hint of a whiff of any kind of drug anywhere near an individual for any reason a felony.
- Child pornography is bad, so let's (try to) make encryption illegal.
- Pump-and-dump scams are bad, so let's make [thousands of pages of financial legalese] illegal.
- (intentional hyperbole on this point) Low quality medical devices hurting people is bad, so let's give a private corporation the privilege to write up a set of standards, never change them no matter how far the world progresses, and charge people for the privilege of reading them to know what's legal or not.
The alternative would be using an RTOS of some sort, implementing a full network stack (with > 100Mb throughput) and a USB device, as the bare minimum. Then you also have I2S audio, GNSS, etc.
It probably makes more sense using an entire OS at some point.
BTW, this is typical Qualcomm, that makes the chipsets for these modems.
So from this perspective, it's honestly more secure probably, too, as opposed to trusting a hardware company to hire embedded software engineers to reinvent an entire stack from scratch. The latter of which are in rare supply and we all know that reinventing things is a process that often leads to vulnerabilities.
Locking down the communication to just AT commands then makes sense for similar reasons.
Rest: no. Some modem manufacturers have SDKs to get your application on the device as a feature.
I wonder if Justine's Redbean webserver, which got recently posted on HN, would support ARM in such use case. Its executable size is 460KB, it even allows Lua scripting, and benchmarks 1 million pages per second on desktop PC.
In spite of the author's insistence, I don't think Cosmopolitan is really usable on anything but x86, the QEMU thing is more a cute proof-of-concept. For very simple programs I guess...
Running QEMU on a modem would be another hack for a day :)
So your connection usually going like that: Carrier -> HW -> VxWorks -> Android-based OS -> your device.
I think the biggest challenge to getting somewhere small enough that it can be "dropped anywhere" is definitively the solar panels. If you add the qualifier "where you have permission" it gets a lot easier - I don't think you need a very large panel to be able to power something suitably basic like this.
In my head I'm thinking an air tight tupperware container with a pi zero inside, setup for meshing. It would be cool if it was fairly flat and had panels on both sides, so you could throw it on a roof top and be reasonably sure it'll land with a panel facing up to run.
I mean it's an idea I've thrown around a lot in my head since college, but in all my scenarios, I never opened it up to the public, it was just going to be used for me. If that's the case, then yeah it's doable.
Deploying updates is not that hard - you'll want a flash that's large enough for at least two partitions so you can keep a known good version around. Other than that, signing updates isn't a big deal, and tamper-proofing key storage enough for casual use isn't that hard. I wouldn't trust sending senstitive data clear-text over a network like that, but I wouldn't do that over public wifi anyway.
Latency is a bit more of a challenge if you're somewhere that'd need lots of hops, but if you are then presumably the alternative is worse, especially if you have nodes with LTE connectivity as a possible fallback.
I keep thinking the Meshtastic network is heading in that direction, maybe Disaster.Radio might have some features, and generally there seem to be a ton of projects that contain some but not all of the pieces you'd want.
I'm down to build the hardware, I just haven't a clue on the software side of things.
If you can come up with a hardware package that is resilient enough, then "all" you need on the software side is a small Linux install and a bootloader setup that will try either of at least two boot partitions. You'll want a watchdog to force a reboot to a know good install if it doesn't respond after a while. Routing is the tricky bit, but as mentioned if the number of nodes is small enough a small routing daemon to periodically exchange routing information and discovery performance fluctuations is not a big deal.
For some reason his main.css is not compressed, so that would be the first thing to optimize.
The CSS on the other hand has TONS of comments which can be gotten rid of and minimized.
Edit: ah, not. Looks like it’s reachable from my landline (which is IPv4 only) but not from my 4G connection (which has IPv6).
You can get the Linux distribution and a compilation environment for these from the manufacturer (source code). You may need to have a business account though.
Linux binaries can be used on these, we have tried code compiled in Rust, Go etc cross compiled for arm target and used on these targets, though the primary development is still in c / c++
They come with a bit dated OPENSSL, though you can compile to a newer version and use that.
SQLITE comes built in
There is support for peripheral access I2C, SPI, SDIO, I2S etc. You could possibly create a simple gaming console with LTE connectivity, since the SPI can drive a TFT and there are IOs for keypad and I2C for touch and accelerometer, gyro etc
Actual modem FW is not available, since that would be Qualcomm properietary!
In this case however it is more like a complete build environment that includes the Linux distribution, GCC and other relevant Linux libraries etc for the distribution.
The real FW for cellular modem is likely never exposed since that may run on a DSP core or an ASIC sub system
If someone's reverse engineering that modem, I'm curious what all is running on there, if it makes any connections other than what you ask for, and who it talks to, and what is said.
edit: And yes, the modem has access to the GPS data, which is passed from the modem to the main OS.
LOLSOB, I really hope this poor person isn't in the US. Or the cellphone overage charges...
I am in the US, and have unlimited 4G LTE data w/AT&T prepaid for just $65/mo. There wouldn't be any risk of overage charges in this plan, at worst it would be throttled if the network is congested.
You could totally host a small site over such a link, it would just require something like a dirt cheap VPS for the public IP address. Behind the 4G connection your server would maintain tunnels with the VPS for serving the actual content via a reverse proxy or some other circuit. Wouldn't hurt to do some caching at the VPS as well, for static content.
"just"? That's very expensive.
Not compared to contemporary broadband prices in the US...
Also the price drops if you setup autopay.
What are you comparing to? This is Starlink territory.
It's possible to just not load the modem firmware and have Pinephone as a device with two ARM SoCs both running mainline Linux and open bootloader. ;)
You'll just not be able to use EG25-G as a modem with modem FW not loaded. There are also options in between.
Pinephone may have a phone in name, but it's basically a neat little SBC with an integrated touchscreen and battery, and bunch of other peripherals, and can be used for anything you like.
Is this common? The cellular modem inside a cellphone runs its own separate Linux? Mind blowing if true. We are truly in an amazing time.
Originally I wanted to get access to the FW via one of these issues, but then I found the adb unlock, and it's way easier.
All it took me to crack their ADB protection was to extract and disassemble their atfwd_daemon from firmware update package, and look for interestingly named commands and reverse their algorithm for generating the unlock key.
You can see for yourself how "complicated" it is:
And that was it.
They also allow to run code under root downloaded from the net via special push SMS, etc. Thankfully not enabled by default. But bleh.