There are all kinds of toys and fun gadgets around the house for most people that might work or be broken, but either way most people wouldn’t know how do they work inside. For example take this solar powered Tibetan prayer wheel. There are many of these out there, and found one at home lying around as well. It didn’t seem to work, and thought why not take apart to take a look?
The inside of this Tibetan prayer wheels is pretty straightforward: taking off the bottom cover out come two ballast stones, and drivebox with a solar panel hanging off it. The drivebox is connected to the prayer wheel outside via a rectangular shaft to turn it.
I have signed up to support it for two main reasons: it’s a Taiwanese project (Skytraq, the company behind Navspark is in in Hsinchu city in Taiwan), and I haven’t seen anything about Beidou before.
They barely made the campaign, but it’s not for the lack of quality. There were a lot of updates during and afterwards as well as the project was developing. Those were good behind the scenes information, got to see what parts of hardware development are more troublesome than others.
The Navspark board
The rewards just shipped this week, and since for this campaign I’m a “local”, I got it pretty early. I got my Navspark GPS/Beidou (BD) version in a big envelope, together with an antenna, some pin and a jumper.
I’ve just recently travelled from Taiwan to Japan on a short trip to check out the cherry blossoms of Kyoto. While it was fun, I did realize that there are a lot of technological details I’m keeping track of, that take up significant mental bandwidth. Technology is helpful even if it takes effort to keep it running. This is a writeup of a non-exhaustive, arbitrarily ordered list of tech I used on the trip, and the way I used them.
Internet connectivity
One of the first concern is how do I get online on the go? There seem to be a bunch of companies providing mobile hotspot rental. The one I wanted to use originally is in Taiwan, and tried to arrange it too late (needs ~5 days in advance). Instead I found another company online called Japan Wireless. They can send a wireless hotspot or pre-paid 3G card to a hotel, or to an airport to be picked up. Since the hotspot I wanted to get was out of stock for the first half of the trip, I went with a 3G card and wanted to use an old Android phone to act like the hotspot.
Picking up the card at Kansai Airport was very straightforward. My Android phone worked much less. Might be getting “too old”, sometimes it couldn’t start the wireless sharing at all, though when it worked it was good for a while. It is also worth enabling “network traffic monitoring” and appropriate warning levels. The pre-paid card had 1G traffic included. Definitely does not recommend running a Play Store update while connected, apps can easily take up 30-50Mb, and 50% of your traffic allowance is gone before you can say “Ice Cream Sandwich”…
Ever since the first time I took couple of ground-breaking online courses a few years back, I try to keep some courses going all the time. Doesn’t always happen, but there’s always a lot of good stuff to choose from. This semester (if there are still semesters in continuous education), I chose to go a bit outside of my normal territory of physical sciences, engineering and IT. Instead ventured onto the territories of marketing, management, and music. It was pretty successful, I feel I have grown as a person because of that. Here are some notes and impressions from those courses.
Content Strategy for Professionals
Content Strategy for Professionals (Engaging Audiences for Your Organization) is hosted on Coursera by Northwestern University. I took it to know better about purposefully managing content, that I can put at good use at the Taipei Hackerspace, Ignite, Future Shorts, or any other project that I might be working on.
The instructor, John Lavine, was quite interesting, engaging, and gives off an aura of knowledge and authority. The first lecture was pretty good overview. From the second lecture the course went into a form of having two invited experts each week, who are pretty much doing an Explain-Like-I’m-a-5-Year-Old of their ideas and field to John Lavine. That was somehow much less interesting. Similar to a fireside chat, a lot of polite talk, we are just onlookers, but this is not a lecture. Lots of repetitions, even between different guests. I can’t really tell if I have learned anything. It might not have helped that it was “for professionals”, and they repeated multiple times that “there are no grades, no pressure…”
They have also incorporated other teaching methods. There was an e-book, which I haven’t gone into much. The hands on learning was supported by a case study, which might have been interesting, especially because the course managers arranged peer-to-peer feedback. I skipped that because I thought doing actual work instead of fictional case study might be more conductive. Apparently there was also a breakfast series, when the travelling professors invited the course attendants out at different cities around the US. Now that would have been interesting to join.
All in all, I don’t regret taking the course, and probably did the topic as well as possible given their aims. Maybe the topic was a bit shallow for me.
Critical Perspectives on Management
Critical Perspectives on Management was also on Coursera, by the IE Business School in Spain. I chose it because I have a lot of ideas about how teams should work, management should work (some of these ideas which might not have gotten me too many favours with past bosses), and thought it would be good to have some more inspiration for thought.
Here’s the trailer of the course with the instructor, Rolf Strom-Olsen.
The format of the actual lessons were recorded classes at the business school, with weekly readings, and tests.
The course went well beyond my expectation. It explored a lot of interesting topics, drawing examples and lessons from the Roman grain trade, shipyard workers, housing crisis, and much more. The overall message was “keep thinking and asking question”, which could be a duh!, but the way it was presented and discussed showed me how much uncritical of things I can be, even when I think I’m critical.
This is probably my favorite “thinking” style course besides the classic Justice with Michael Sandel. Rolf Strom-Olsen is a very good orator as well, and I would probably join any other courses that he puts up. The technology for the course was well done too. Weekly message and lessons learned along the way from the instructor; the tests are challenging and interesting; some of the readings are checked out of the business schools electronic library….
Jazz Appreciation UT.8.01x
Jazz Appreciation is on EdX, hosted by University of Texas, Austin. Chose this one because even if I’m a self-proclaimed jazz fan, I feel I barely know anything about jazz, and would love to know more.
Boy, this didn’t disappoint.
From all these courses, I feel this is the best put together. Jeffrey Hellmer, the instructor (professor and musician) has a good style, can feel his enthusiasm and knowledge every step: his comments, when he’s demonstrating one or another famous musician’s style on the piano, when pointing out things to listen to in a particular piece. The text was well prepared, and while I’m sure it was read out, it didn’t feel like it, but very engaging.
The course had a number of innovative features. As much as it can be surprising, others mentioned that this is one of the few (or only?) course so far about music that actually uses musical excerpts in the teaching. I can vouch for that it went a long way. The learning sections used Cerego, a spaced repetition app/site. It can be quite addictive for a while, though for many people it was a very big departure using “long term recall progress” instead of one time test scores for tracking the course achievement. The instructor also had an earpiece, and he started/stopped musical excerpts, so he could listed together with us, and point things out, count rhythm, emphasize musical features while we were listening with him. This kind of interactivity can go a long way!
It wasn’t all good, though. The price to pay for including music in the lecture is that copyright law apparently kicks in. The result is that all the videos were online only for 1 week, after which they were taken offline and only the transcripts were to be found – and reading those wasn’t really helpful for understanding music on the weeks when I missed it.
The great course also spawned an engaged community. My favorite is that people were compiling playlists on Grooveshark of music mentioned in the lectures. Definitely have to find those and give them a good listening. I already have a somewhat more nuanced ear when I listen to jazz and music in general, and have a bit better idea why do I like or not like particular songs or musicians.
Conclusion
It feels the online courses are definitely improving. The teachers are better, and also better prepared. The overall production value of courses seem to be higher. There are more courses to choose from to, with a larger intended audience as well. In the future, I will try to have a more balanced portfolio of online courses that I’m taking (between humanities and hard science).
It is exciting times. I hope more people start to realize, that universities are not the only option to get an education (by far).
Ever since someone donated an IP phone to the Taipei Hackerspace, I’m trying to find time to set up an internal phone network between the hackerspace members. It should be fun to make our own infrastructure. Recently did some research, and started with it. Since if I get into something then I dive deep for a while, this was an intense week. This post is to summarize where I have got in this time
Asterisk & FreePBX
A bit of searching turned up Asterisk, a PBX (“private branch exchange” aka telephone network) software. It looked interesting because it came with a story: a guy building something awesome because he doesn’t know that it was supposed to be difficult. It’s also open source from the start, with a successful company build on top of the project.
Also found, that there’s a graphical control panel called FreePBX that makes using the all-command-line-and-config-files Asterisk easier to use. Both projects had a seemingly very detailed wiki, long track record, and strong following that made it worth checking them out.
The Server
Judging from the original install instructions on the FreePBX wiki, it looked like installing Asterisk & FreePBX is a complex (or rather many-step) process. Didn’t want to litter my own computer with broken installation artefacts, so enter VirtualBox. Using a virtual machine makes it easy to wipe and restart.
There’s a dedicated, preinstalled FreePBX distro based on CentOS, but had enough of CentOS for a while. Instead I just took Ubuntu 12.04.3 as a base, and FreePBX 2.11 and Asterisk 11 from the wiki. The install instructions were clear enough, though occasionally there were small differences needing a fix. Nothing major, but had to play around. After 5-6 reinstalls with increasing experience I got the basic functionality working, calls placed between and such, but the performance and sound quality wasn’t really that good. After thinking what could I improve, decided to take the next step: get out of the virtual machine, and up the version numbers (I’m Arch Linux user with a reason, living on the bleeding edge).
Enter DigitalOcean, a hosting provider that I used for other projects before (cheap, fast with SSD, good service). Set up a machine (aka “droplet”) in their Singaporean center (since that’s probably the closest one to Taiwan). I chose the 1Gb memory instance, because from experience with VirtualBox Asterisk+FreePBX maxed out at around that with a few test accounts.
Upping the version numbers I went with FreePBX 12.0 (from git) and Asterisk 12.1.1 (from download), both are testing versions. Asterisk had an extra dependency of libjansson-dev compared to version 11, didn’t check if any of the earlier dependencies are not required anymore.
Got the whole system working (after a few droplet wipes), and played with the installation with a bit more confidence. From initial experience, Asterisk is a bit like the Linux Kernel. It’s modular, complex, focus on reliability, and the “make menuselect” is a familiar environment after years of “make menuconfig” compiling my own kernel. On the other hand, FreePBX is a bit like WordPress. It has its own auto-updater (just like updating plugins in WordPress), loads and loads of menus, focuses on configuration and tries not to let any faulty module take down the system (found quite a few buggy behaviour, so that’s a good idea). The Kernel and WordPress are two familiar environments, so felt home here too somehow.
Asterisk has a bunch of vocabulary that I’m so far barely familiar with, and lots of functionality that I haven’t had a chance to test yet. FreePBX has a lot of functionality too, and still it’s a bit difficult for me to tell where does an Asterisk function (module, resource?) end and one FreePBX function (plugin?) start. The fact is that I got to feel excited about programmable phone routing (with Lua), fax-to-pdf, hotel style wake-up calls, voicemail recording, call tracing, speaking time, simple conference talks, intercom functionality, regardless from whether it’s a module or a plugin…
Some additional server notes: voicemail requires email out for notification, I set that up with Mandrill and postfix. For such testing it might not be important, but good to secure the server at least a bit with fail2ban and ufw (Uncomplicated Firewall), and probably other things I don’t do well yet. Just sayin’.
Accounts / Extensions
Accounts on the server are the extensions on which someone (or something), a numerical value. The vocabulary and concepts are also new to me, so it took a while to understand how things supposed to interoperate. Asterisk has a bunch of different kinds of extensions, of which I have tried two main ones: SIP and IAX.
SIP
SIP stands for Session Initiation Protocol. As far as I see it is basically a messaging protocol, to set up a connection between two parties, and also provide some other services, for example presence information (Online, Away, Busy….), messaging, and what not. The actual data of the call (voice or video) is trhough RTP (Real-time Transport Protocol).
The voice data in the transmission is compressed with one of the many codecs available:
ulaw and alaw (G.711) are a pair of the standard codecs, okay quality, one of the basic one to have in any client
speex is a variable bitrate codec, haven’t used that much
gsm is lower bitrate, but lower quality too (think of crappy cell phone reception voice)
G.722 is a hi-def (HD) voice codec, really good! I think beats Skype, and on par with a good Google Hangout quality,
G.729 is a non-free codec, shows up here and there, but haven’t had a chance to try it, this is the other HD codec that I’ve seen recommended
In testing, this was some of the learning curve, how to set up clients, and also the server that they can communicate with each other. Who choses the codec (caller, callee, server)? How to prioritize the codecs in different clients? What does it look like (or sounds like) when there’s a problem in this area? How to debug and fix?
Asterisk 12 has two different SIP channels or components: their classic library (chan_sip), and a rewritten one (chan_pjsip). The latter one is a standalone library that can be used for other purposes as well. SIP usually works on UDP, while PJSIP can do UDP/TCP/WebSockets too, and feels stable and fast. Definitely would use that if I have to choose between these two. Still, it is in test phase (both in Asterisk and FreePBX), so not without headaches.
There are bunch of different clients that I tried:
On Linux:
Ekiga is nice, simple, can sign into multiple accounts in multiple networks. Presence information, well integrated into the desktop with notifications and such. Does not seem to be able to handle non-standard SIP ports (which will be an issue further down)
Linphone is really multiplatform (Linux, Win, OSX, smartphones…), but it was crashing on me quite a bit, doesn’t integrate into the desktop (no notification just sound on call), and can be confusing with the lot of settings (the control panel looks a mess). Can handle non-standard ports too.
SFLPhone is good, works pretty well, simple, and can do IAX communication besides SIP.
On Android:
Android actually has full SIP handling capabilities built in for a while now (under “internet phone”). That would be awesome, if there were more information how to set up and use, but in theory a SIP account can be fully integrated into the system.
CSIPSimple really impressed me, probably the best working client I found. Integrates with the system (calls are handled as ‘calls’ with all the icons, history, and so on), good sound quality (can use the G.722 codec) and so on.
SipDroid, VIMPhone, LinPhone…. these other clients, don’t even remember them, all of them fell short somehow
Zoiper stands out as well, not just because it’s multiplatform, but because it’s pretty much the only one I found that can do both SIP and IAX. The Android system integration is not as close as CSIPSimple, but quite okay.
One of (the many) good thing about SIP that it is well known and pretty well supported. If there’s a “softphone” (phone in software), it’s quite likely to have SIP communication capabilities.
The bad thing about SIP though that it is well known and pretty well resented by the phone service providers. Many of those providers block SIP messages on their network, or sabotage the connection in some other way. On my own cell phone / 3G provider’s network, I couldn’t connect to Asterisk. In the forums some suggested that changing the port number that Asterisk listens on for SIP connections can solve things – and indeed after moving away from 5060/5061 to somewhere else, I could connect. The celebration was short lived, though because even though the calls now can reach the destination, RTP communication (the part that actually transports voice) was still broken. I don’t want to use VPN all the time (though might need to soon), and want to keep moving parts and settings to the minimum if I want others in the Hackerspace to join this network as well, thus SIP looks like a no-go because of the phone companies (darn).
IAX
Looking around, I found another type of channel, using the IAX (Inter-Asterisk eXchange) protocol. The bad thing about it that it is much less supported, but in turn it is not blocked by the phone companies either (since they don’t know about it).
Using SFLPhone and Zoiper I could successfully talk over 3G! Still it is not all good, the devil is in the details.
It’s good that no need for custom ports
It’s bad that the IAX channel seems to be more unstable on Asterisk (or maybe I messed up my install after a while?): some extensions have trouble logging on for a while until the server is restarted; the wakeup-calls plugin misbehaved with IAX extension.
The less support also means less choice in clients. The ones I found cannot do G.722 so no HD voice anymore
Has a security setting (requirecalltoken) that not all clients support, not sure if there are any implications.
It’s also good, that Asterisk can route incoming SIP calls onto IAX extensions (i.e. the caller doesn’t have to care what technology the callee is using). On the note of routing, I could set things up such that outside calls can be routed into the system. E.g. every hackerspace could have their own Asterisk server and interoperate to call members at other spaces – sounds like a lot of work and might not worth it, but it also sounds awesome.
Summary & Future
I had a lot of fun playing with Asterisk. On the surface phone networks are familiar to everyone, but going deeper both makes things more confusing and opens my eyes how many possibilities there are for making something useful.
There are a lot of things that I thought about, but haven’t tried yet:
Programmable dialplans (“what happens when a call is received”), via Lua. Lua is an awesome language and probably a lot more large piece of software has it embedded (since that’s one of its strength)
There are a bunch of other protocols and acronyms in Asterisk, for example Secure Real-Time Protocol (SRTP) and ZRTP, that could worth figuring out for a deeper understanding and security
There’s an Asterisk on Raspberry Pi project that looks interesting (if nothing else then how do they lower the memory usage below the RPi’s <512MB?). Since Asterisk can be used with multiple servers in a network, the RPi can provide one kind of service (e.g. GSM gateway) while other servers with more resources do other stuff
Using physical phones in the network, for example traditional phone network to come into the server, and IP Phone to ring out. Maybe setting up fax endpoint (and sending it out as PDF or printing it). Basically anything that is working on the threshold between physical and digital.
Should check out how the likes of Line, Voxer, and Viber are doing VoIP on Android, do they have any interoperability?
How about Twillio, can their system be a similar PBX on a much larger scale?
The funny thing is that looks like the original IP phone that started this whole adventure does not work with Asterisk. Never mind, it will be good for another project.