You are reading a single comment by @BogdanG and its replies. Click here to read the full conversation.
  • Hi,
    Some time ago (before espruino 1v30) I tried to port my Nokia based GSM temperature monitoring system to espruino. Just for fun because my linux based solution worked fine.
    Unfortunately it was a failure because I was not able to implement the Nokia's FBUS protocol on 8KB STM32VLDiscovery board. I simply ran out of memory...
    The other day I bought an old Sony Ericcsson T630 which has nice serial interface based on AT commands. Here you can find similar models (they may have slightly more difficult SMS encoding scheme so be warned!). These phones are really cheap - a couple of euros.
    http://pinouts.ru/CellularPhones-P-W/eri­cs_t28_pinout.shtml
    Here you can see an example how easy you can send an SMS:

    var period=20
    var ms=""
    var phone="+48999999999"
    
    function readTemp(){
        return 20	//fake read just to show the idea
    }
    
    function sendSMS(msg){
    	setTimeout(function(){Serial2.println("A­T+CMGS=\x22" + phone + "\x22")},500)
    	setTimeout(function(){Serial2.println(ms­g)},1000)
    	setTimeout(function(){Serial2.print("\x1­a")},1500)
    }
    
    function hMon(type){
        temp=readTemp()
    	sendSMS(type+":"+temp+"C")
    }
    
    function handler(c){
    	ms=ms+c
    	if (c=='\n'){
    		console.log(ms)
    		ms=""
    	}
    }
    
    Serial2.setup(9600)
    Serial2.onData(function (d) {handler(d.data)})
    setTimeout(function(){Serial2.println('A­T&F')},500)
    setTimeout(function(){Serial2.println('A­T+CMGF=1')},1000)
    
    setInterval(function(){hMon("TEMPERATURE­ IS: ")},period*1000)
    

    The code above is really rough (it's not an example of good javascript style, neither good programming). It's purpose is to show the idea of using cellphone with espruino.
    Bogdan

About

Avatar for BogdanG @BogdanG started