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 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
 
After rather more experience with the Waveshare, I thought I would provide an update.
It does work quite well. However, it is very greedy on power when it is active - I think it really does need 2 amps some of the time, so even with large capacitors it still needs a 2A+ supply. If the supply power drops, even for an instant, the module resets and can end up never connecting to the network.
Its big plus is that it has a wide range of input voltage. I'm actually using 12V with no problems.
The output is Picaxe compatible, again with no problems.
It will handle incoming and outgoing SMS (but not MMS), and outgoing "voice" calls (or, at least, ring the number) and answer incoming calls (although there is no audio so it is not much use apart from identifying which number has called).
The "ring indicator" which is supposed to be configurable to identify incoming text or voice calls doesn't seem to work properly.

I have also recently been trying out the Pimoroni Clipper LTE 4G Breakout board, which uses the SIMCom A7683E.
It is much cheaper than the Waveshare module (£14.64 plus delivery)
There are far fewer I/O connections (6 rather than 24) and so far fewer facilities.
It is far less greedy on power (max 1A) but, again, needs to have the full power available at all times to avoid resetting.
It has a narrow input voltage range (3.7V to 6V), and the I/O voltage appears to require 3.3V +/- 0.3V, although this is still compatible with Picaxe logic levels. I used a voltage divider on the input to drop the Picaxe 5V to around 3.3V (330R+680R)
The Waveshare has "power" and "network connection" lights, neither of which is present on the Clipper board. However, both can be added (use the NETLIGHT output pin to power the network light, which flashes slow (for 2G) or fast (for 4G).
The basic module comes without an aerial, but I found that a 2.4GHz aerial from a defunct NRF24L01 worked perfectly well, at least for my present location.
Most of the "AT" commands that work for the Waveshare also work for the Pimoroni. A few of the more esoteric ones appear not to be supported. However, because the manuals are only available to those who register with SIMCom (and you need a company website to register), I don't know which ones have been removed (or, indeed, if there are any extras).
SMS and "voice" work in exactly the same way as the Waveshare and it is therefore - for most purposes that I have in mind - a perfectly satisfactory (and cheaper) alternative.
 
Back
Top