Hacker News new | comments | show | ask | jobs | submit login
Micropython code to implement a GSM mobile phone (github.com)
135 points by stinos on Nov 13, 2017 | hide | past | web | favorite | 19 comments

I thought it would be an actual GSM stack written in Micropython (like OsmocomBB etc.), but alas, it's only the UI and the real work of GSM is handled in a prebuilt module.

The UI reminds me of Apple's iPhone prototype: https://thenextweb.com/apple/2014/10/05/apple-skankphone-bui...

Wow, they made an iphone and an android.

Is there any "free" or DIY hardware that can run OsmocomBB or a similar stack? AFAIK OsmocomBB only runs on certain old GSM phones.

Did anybody try to build a GSM (UMTS, LTE, ...) client, say, with a FPGA and a transceiver, or with a SDR? I know high-frequency stuff is not exactly DIY, but there should be some off-the-shelf generic hardware by now that would be able to run such a stack, I would think.

"skankphone" haha

Wow those UI's are dated, granted article is from 2014 but damn, looks like something I would have made with Touch Develop

I was wondering how they’d address real-time latency. Guess they didn’t.

Very nice, I wish this were around when I was writing my A6 lib:


Hopefully the MicroPython ecosystem will expand with efforts like this one, how did you find performance? I'm always worried about memory usage with μPython.

Based on the hearsay, µp actually has much better memory usage than CPython (but obviously worse than C).

Considering it's striking a pretty nice balance between high-level features and low overhead, I'd say it might be worth it, especially if you're aiming at a very hackable phone.

This is definitely going on my "list of things to do when I have too much time".

Well, you don't need to fall back on hearsay. The code is on github. It is a good read.

Micropython is, in fact, extremely parsimonious with memory in it's native state, and you have reasonable options to get even tighter if you like, at the expense of portability.

As it is, most of Micropython's portability quirks come from trading off 100% CPython compatibility to achieve a small SRAM footprint.

Micropython byte code is not particularly fast in an absolute sense, but is very good all things considered in the context of a microcontroller. I find for really performance critical stuff a few lines of inline asm (which Micropython supports natively) often is sufficient. And for the rest, a C module is always an option.

It isn't really heresay. You can run µp on systems such as an esp8266, which you couldn't run cpython on. It does run, but lacks much of stdlib (by default).

Is Expressif firmware still required to run µp on ESP8266/32K?

Hmmmm I'm not sure. They've got an open source esp firmware, but I don't know if it works with µp or not. I generally use the Expressif firmware

so the core GSM is done by a SIM800L module. Will that work on any normal cell network? I know a certain class of cheap GSM chip only works with a 2G network, and (as I understand it) T-Mobile is the only operator of such a thing in the US, and they're trying to phase it out. Is this correct? Could someone enlighten me as to how all this works?

The SIM800L seems to be a Quad-band GSM module with GPRS.

So yes it's only 2G, but you've got the potential for SMS and maybe even 512kbps data. No idea about an audio channel (voice calls).

Whilst 2G is old, it's supprisingly battle tested and goes through walls quite well. A year ago we were told to expect the phasing out of 3G networks and to expect carriers to expand 4/5G with 2G as fallback.

Also, you gotta bear in mind, this module can be bought for £5. Getting a PCI-E 2/3/4G micro-pci card for my laptop is priced at closer to £200, so this is a great starting place. Expanding to a module that supports multi-networks either later or as an upgrade wouldn't be overly difficult - this is just a super cheap way of being able to test with real SMS, real networks and real recipients.

I understand that it's much cheaper than a 3G/4G/LTE connection, but if it's going to become non-functional in the foreseeable future, I'd like to at least be aware of that before building something on it.

At least some mobile operators are getting rid of their 3G networks and shifting focus to 4G/LTE, but keeping 2G because of how common it is.

In Australia all the GSM/2G networks have been killed off. Only 3G and up now.

Correct, the SIM800 line are 2G only which I believe is only provided in the US by T-Mobile as you mentioned. In the UK things are a little different, where the vast majority of the core mobile network providers still supply 2G networks, but I believe some of them have published plans to decommission them within the next couple of years.

In terms of 3G, 4G and LTE modems, they’re a little harder to come by quite so readily, and are a damn sight more expensive too! You can pick up an 800L for £1-1.50, for 3G it’s close to £20-30 from what I remember.

I'm unfamiliar with the baseband scene at that level. Might you know why the difference in price between 2G and 3G modules is so striking?

Well it will work on a GSM/GPRS/2G network. As you noticed, certainly in the US, those are getting rarer by the minute. AT&T shut theirs down on 01.01.2017 [1], and other providers also have plans to discontinue service in the near future.

So on these networks, this module will simply not work or you are always in roaming.

[1]: https://www.business.att.com/content/other/2G-Sunset-FAQ_201...

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact