Shop OBEX P1 Docs P2 Docs Learn Events
connecting Propeller to the world with Cellular — Parallax Forums

connecting Propeller to the world with Cellular

Brian CarpenterBrian Carpenter Posts: 728
edited 2016-09-12 02:15 in Propeller 1
I have been developing my project by using the propeller and the Motorola c168i cellphone as described by jay Licklider a few years back. I have come upon two problems. the first is that it runs on the ATT 2G network that ATT is doing away with at the end of the year. Secondly, and most importantly, I sent to deploy the project today. While my LTE Verizon phone has great service, my ATT phone has none.
What are you guys using for a 3G solution? What networks are you guys running them on?

thanks

Comments

  • I've used Adafruit's Fona with Ting's 2G service but I haven't used 3G myself.

    Adafruit now sells a 3G Fona. I think there are less expensive versions but Adafruit is really good about providing documentation and code examples.
  • that's the one I was looking at. do you think the coding for the 3g is the same as the 2g module? I will place my order now
  • how do I know if my phone issue is 2G vs 3G or if it is a carrier issue. I Live in mesa, AZ and my ATT phone works great (other than the obvious announcement that ATT will no longer have 2g after dec 31 2016) I looked at what I though was a coverage map and it looked to be covered. I will look again,
  • are all carriers dumping 2G?
  • Here's a Tachyon Module for the FONA from AdaFruit, you can parse out the syntax for sending, I haven't written the parsing for the RX from the FONA yet, just dumping to display.
    TACHYON
    [~
    \
    \  FONA Celullar Routines
    \  A small module that sends SMS texts messages on AdaFruit's FONA GMS Module using a TING Account Card 
    
    \ --------------------------------------------------------------------------------------------------------------------------
    \   USAGE
    \     FONA.GO    --- use this to init the module, start the RX form FONA module Task, hardcoded COG 7
    \     FONA.STOP  --- stop the task with this
    \     FONA.READ  --- use this to read the FONA module return buffer to console, call by main module keypoll... 
    \     FONA.SEND ( " text message to send" " 1234561111" -- ) send SMS message, results can be read with FONA.READ 
    \                                                            to the console or revectored 
    \ --------------------------------------------------------------------------------------------------------------------------
    
    \  dp  20151227-1900 V0.1
    \  dp  20151228-1200 V0.2  got sms sending and reading
    \  dp  20151229-2200 V0.3  rewrote commands using strings, paramaterized SEND 
    \  dp  20160906-1700 v0.4  added commands, tried to compile and run with Juno but no joy,  stable on 2.4 hum?  
    \  dp  20160907-1300 v0.5  debugging routines, work in progress
    \  dp  20160907-2030 v0.6  small module to integrate with gardencontrol
    \  dp  20160909-0930 v0.7  added start stop routines:  gofona stopfona to control the RX task FONA.TASK
    \  dp  20160909-0930 v0.8  minor bug fix
    \  dp  20160910-2330 v1.0  rewrote controlling words in object syntax and documented usage, fixed FONA.READ dropped nulls
    
    
    FORGET FONA.fth
    
    pub FONA.fth   PRINT" FONA Test V1.0 dp  20160910-2330 " ;
    
    --- setup, pins
    #9600 SERBAUD                           --- nice and slow 
    #P2 == TX                               --- my pin, device RX
    #P20 == RX                              --- my pin, device TX
    --- vars
    LONG ?fona                              --- task flag
    
    --- serial task rx stuff 
    WORD rxrd,rxwr                          --- create receive buffer, indexes
    #64 == rxsize
    rxsize BYTES buf232                     
    10 LONGS stack232 
    
    \ Buffer data from the RS232 port - nothing else
    pub FONA.TASK
        stack232 SP! !SP                     \ init data stack to 0, assign stack to this task
        #9600 SERBAUD                        \ how fast are we going
        rxrd W~ rxwr W~ buf232 rxsize ERASE  \ clear rxrd, rxwr and erase buf232
        BEGIN                                \ run loop until ?fona false
           RX SERIN  
           rxwr W@                          \ get serial byte, fetch rxwr buf232 index( -- 0 datadr )
           rxsize 1- AND buf232 + C!        \ compute buf232 addr and write data to buffer
           rxwr W++                         \ increment buffer pointer
        ?fona @ UNTIL 
    ;
    
    \ You can read the buffered data with this
    pub GET232 ( -- ch|0 )
         rxrd W@ rxsize 1- AND rxwr W@ rxsize 1- AND <>   \ compute if the buffer is empty
         IF
           rxrd W@ rxsize 1- AND buf232 + C@
           rxrd W++
         ELSE 0
         THEN
    ;
    	
    --- redirect routine
    pub celpout  ( char -- )
      TX SEROUT
    ;
    
    --- redirect output to fona
    pub CELP ' celpout uemit W! 
    ;  
    
    pub cmrdchr  ( char -- )   --- read sms message by index char
    --- AT+CMGR
      CELP
      --- send msg cmd
      " AT+CMGR=" PRINT$ 
      EMIT CR
      CON
    ;
    
    
    \ Read Fona TX to the console
    pub FONA.READ ( -- )                         --- read the fona and output
        GET232                                   --- display
        DUP 0= IF DROP  ELSE EMIT THEN           --- don't tie up console with nulls
    ;
    
    pub CRST
      CELP
      " ATZ" PRINT$ CR
      CON
    ;
    
    pub CBAT ( -- bat_status)          --- show battery status  1|0 charging , % bat, millivolts  0, 67, 3890
      CELP
      " AT+CBC"  PRINT$ CR
      CON
    ;
    
    pub CECH ( ON|OFF -- ) --- set echo
      CELP
      IF "1" ELSE  "0" THEN
      " ATE" PRINT$ EMIT CR
      CON
    ;
    
    pub CNUM   ( -- )   --- request device number
       CELP
      " AT+CNUM" PRINT$ CR
      CON
    ;
    
    pub CPWR   ( -- )   --- request device number
      CELP
      " AT+CPOWD=1"  PRINT$ CR
      CON
    ;
    
    pub CTXT (  -- )   --- set sms command mode to text 
      CELP
      --- set text mode 
      " AT+CMGF=1" PRINT$  CR
      100 ms
      CON
    ;
    
    pub CPDU (  -- )   --- set sms command mode to pdu
      CELP
      --- set pdu mode 
      " AT+CMGF=0" PRINT$  CR
      100 ms
      CON
    ;
    
    pub CDELA ( -- ) --- delete all messages
     CPDU --- set into pdu mode
     CELP 
     " AT+CMGDA=6"  PRINT$ CR
     CON
    ;
    
    pub FONA.SEND ( " message" " number" -- )   --- send sms message
      CTXT   --- set into text mode
      --- Write Command 1) If text mode (+CMGF=1): +CMGS=<da>[, <toda>] <CR>text is entered <ctrl-Z/ESC> 
      CELP                                          --- revector TX pin
      " AT+CMGS=" PRINT$                            --- send msg cmd
      34 EMIT PRINT$  34 EMIT                       --- send the destination address  
      CR
      #500 ms                                       --- wait for reply
      PRINT$                                        --- send the message
      ^Z EMIT   CR                                  --- end message
      CON                                           --- back to CONsole
    ;
    
    ---   This routine starts the system
    pub FONA.GO
       OFF ?fona !                               --- set task flag to run
      ." Starting FONA Module " CR
      ' FONA.TASK  7 RUN                         --- start the rs232 task
       #500 ms
       CR ." Reset FONA: " 
       CRST
       #500 ms                                   --- delay
       CR ." Echo Off: " 
       OFF CECH                                  --- command echo off fona
       10 ms
       CR ." Text Mode: " CTXT                   --- set into text mode
    ;
    
    pub FONA.STOP 
      ." Stopping FONA Module" CR
      ON ?fona !   --- set task flag to stop
    ;
    
    ]~
    END
    
    
    
    
  • PaulRowntreePaulRowntree Posts: 150
    edited 2016-09-12 02:23
    Lady Ada makes a note that they are not drop-in compatible, but they are working on Arduino libs for the new board.
    Please note! We've had a lot of requests for a 3G cell module and we're happy to oblige but this module has many small differences 
    between it and the FONA 800 and 808, so it is not a drop-in replacement! In particular the data functionality is not as easy to use. 
    We are adapting our FONA library to support the 3G chipset and right now we have SMS, calling, and basic functionality working 
    but it will be a while until we get full GPRS TCP/IP and HTTP support. 
    Also, the GPS is not as fast and low-power as the one on the FONA 808. 
    We recommend this module for people who are able to handle a more advanced experience.
    
  • Looking at some coverage maps for this location (303 N Beeline HWY payson,az 85541) it appears that both Verizon and ATT require 3G phones for this area
  • Duane DegnDuane Degn Posts: 10,588
    edited 2016-09-12 04:06
    I don't know anymore than what others have posted concerning the differences between the 2G Fona and the 3G Fona.

    In preparing to port Adafruit's Fona Arduino library to Spin, I wrote a program to monitor the communication between the Arduino and the Fona. This program is titled "MonitorFona.spin." Here's a link to the GitHub repository. If you want to use the program, download the archive "MonitorFona - Archive [Date 2015.06.06 Time 19.46].zip."

    I had a hard time deciphering the datasheet of the cell phone module used in the Fona. Monitoring the communication between the Arduino and the Fona helped me to see exactly which characters were being used in the various commands and requests.

    I think the program could be used to eavesdrop on any two devices using asynchronous serial communication including the 3G Fona.

    Edit: I just noticed I included an example of the output from the program. The file "CapturedData150606a.txt" contains this example output.

    Here's a portion of the output where I had entered the character "b" to request battery information. (This request was entered in the Arduino's terminal window.)
    FromTerm>b<$0D><$0A>
    ToTerm>b<$0D><$0A>
    Ard>AT+CBC<$0D><$0A>
    FONA><$0D><$0A>+CBC: 0,90,4126
    <$0D><$0A>
    <$0D><$0A>OK
    <$0D><$0A>
    ToTerm>VBat = 4126 mV<$0D><$0A>
    

    The "FromTerm" and "ToTerm" identifiers correspond with the communication lines between the Arduino and the PC. The "ToTerm" output would show up in the Arduino's terminal window. I used the program Parallax Serial Terminal.exe to display the output from the Propeller.

    Of course the program isn't very useful if you don't have an Arduino.

  • max72max72 Posts: 1,155
    I used Sim 900 to handle SMS messages.
    It worked fairly well.
    Thre are many break out boards. Only delicate thing is power supply (you have very high current peaks, but it's a common problem).
    There also is a recent thread on SIM900 and data connection )I have never been able to handle data reliably, so I relied on SMS only)

    http://forums.parallax.com/discussion/149716/sim-900-gsm-module-interface-object-wip
    http://forums.parallax.com/discussion/164580/issue-gprs-sim-900

    Massimo
  • The only draw back is that if you use ting, M2M, etc. its like having another cellular account to manage and pay for. In the past you could buy a pre paid sim with minutes already on it. But not anymore.
  • I have an application that is currently using dialup modems. Does anybody here know if a FONA can be dialed into with an old-school 56K modem? I'm looking to replace the dialup modems in the remote equipment one at a time but the central equipment needs to stick with the dialup stuff a bit longer.
Sign In or Register to comment.