GSM modules

Captain Haddock

Senior Member
Has anyone done anything lately with GSM modules and picaxe?
I did a search but gsm is too short a search phrase and google only came up with a thread from 2013 so wondered if anyone had got any further or is it too big a project for picaxe?
I'd quite like to make something for remote monitoring of battery volts and temperature but no idea where to start, it would be in a non wifi area so that option is out.
 
I'm surprised that you are considering developing something that would rely on GSM. In my part of the world (Australia), the last GSM network was shut down over five years ago.
 
I'm doing something with the Waveshare SIM7600G-H. It works on 5G, which is why I chose it (2G does seem to be on the way out here) and is fine for sending or receving texts. It does not (as far as I can make out) handle audio, although it can call a number. It's still rather in a development phase, but this is more or less how I've been communicating with it from a Picaxe 40x2:
Code:
#picaxe 40x2
#no_data
#no_table
#terminal 76800

symbol NetLight = B.0
symbol NetLightpin = pinB.0
symbol RingIndicator = B.1
symbol RingIndicatorpin = pinB.1

#macro SendSIM(X)
hserout 0,(X,13,10)
pause 1000
sertxd(13,10,X)
gosub PrintHser
#endmacro


setfreq em64
pause 8000


hsersetup B115200_64,%00001


pause 8000
sertxd(13,10,"Starting")

do
    pause 16000
    gosub CheckNetwork
    if b0 > 1 then exit
loop
    

BeginAgain:
SendSIM("AT")
SendSIM("ATE1")
SendSIM("AT+CGMI")
SendSIM("AT+CGSN")
SendSIM("AT+CSUB")
SendSIM("AT+CGMR")
SendSIM("AT+IPREX?")
SendSIM("AT+CSQ")
SendSIM("AT+COPS?")
SendSIM("AT+CSUB")
SendSIM("AT+CPSI?")
SendSIM("AT+CFGRI=?")
SendSIM("AT+CFGRI?")
SendSIM("AT+CMGF=1")
SendSIM("AT+CPMS=?")
SendSIM("AT+CPMS?")
SendSIM("AT+CNMI=?")
SendSIM("AT+CNMI?")
SendSIM("AT+CGFUNC=?")
SendSIM("AT+CGFUNC?")

b12 = 0
hserout 0,("AT+CMGL=",34,"ALL",34,13,10)
gosub PrintHser1


SendSIM("AT+CFGRI=?")

SendSIM("AT+CFGRI?")


end

PrintHser:
b12 = 12
PrintHser1:
w4 = 0
w5 = 0
ptr = 0
RepeatPrintHser:
do while ptr < hserptr
    b8 = b9
    b9 = b10
    b10 = b11
    b11 = @ptr
    sertxd(@ptrinc)
loop
if b8 = "O" and b9 = "K" and b10 = 13 and b11 = 10 then EndPrintHser
pause 8000
if ptr < hserptr then RepeatPrintHser
if b12 = 0 then EndPrintHser
b12 = b12 - 1
sertxd(".")
goto RepeatPrintHser
EndPrintHser:
hserptr = 0
return

CheckNetwork:
' return status of NETLIGHT pin
' ON searching; call connected
' 200ms pulses = 4G
' 800ms pulses = 2G/3G
' OFF - nothing happening
' NETLIGHT pin is active low
' returns b0 = 0 OFF; b0 = 1 SEARCHING; b0 = 2 2G/3G; b0 = 4 4G
    b0 = 1 - NetLightpin                            ' initial value (0=OFF, 1=active)
    count NetLight,64000,w1
    if w1 > 0 then                            ' pulsing
        b0 = 2
        if w1 > 5 then                        ' fast, so 4G
            b0 = 4
        endif
    endif
    sertxd(13,10,"Network status = ",#b0," Count = ",#w1)
return
 
Back
Top