Node.js + Sim900 = SMS Messageboard | LBSFilm

Node.js + Sim900 = SMS Messageboard

March 19th, 2016 by Lukas Bachschwell

Dieser Inhalt ist auch auf Deutsch verfügbar
 

Some years ago I was at a party where I saw a SMS message board the first time.

Two beamers to each side of the stage displayed messages people could write to a specific phone number. The board said something like “mady by fritz”. It sparked my interesst and the next day I spent searching for “fritz” and his messageboard, but I never found anything usefull, exept for extremly expensive offers of companys renting such messageboards. So I went to alibaba and ordered two sim900 boards.

The sim900 is a really nice and incredibly cheap module, but if you order it from china it’s very likley that it comes with an asian firmware. A friend of mine who already got it running sent me the flasher tool and the european firmware. Since I connected the board using an Arduino serial converter and the software is windows only I had to set up the drivers baudrate in windows control panel additionally to the flasher tools baudrate to get it running.

Then I started building the node.js app. I choose node because I wanted to play with it, and it turns out to be incredibly entertaining. Compared to Php or even normal programming in C++ coding a serverside app in javascript felt like being a little kid playing in the mud =D

I used serialport to talk to the sim900, lowdash to cache the messages on the server, socket.io to push them to the clientbrowsers and emojize to render out the emojis in  css sprites (to make them look the same on windows and osx).

For the emojis I also had to set the sim900’s character encoding to UCS2 (UTF-16). Otherwise if you use GSM it will fallback to UCS2 every time you send it an emoji. So now everything is in UCS2 and I wrote a function that splits the encoded message and parse the characters.

 

The full project is on Github.

To install it run “npm install” and set your phone number, the pin and your serial port in the config.json

 

My simmodule:

sim900


Dieser Inhalt ist auch auf Deutsch verfügbar



  1. This module is better: https://www.npmjs.com/package/sim900
    Very easy, has getAllSMS method and is ES6 (with promieses).

    1. Haha thanks for that, I’m gonna build that into my board as soon as I can =D

Leave a Reply