# Sierra EM7565 on Raspberry Pi setup ## EPC EMS: https://10.12.111.37 /root/epc/HSS/bulk_subs_confg_in_hss.sh 1 IMSI e.g., ./bulk_subs_confg_in_hss.sh 1 001010123458888 ## AT command interface ### Install minicom on Pi ```bash sudo apt-get install minicom lsof ``` ### Getting network and registration status ``` bash # get general deice status, including network registration at!gstatus? # Get the registration status of the device. If the status is ‘1’, the device is registered and in home network AT+CGREG? ``` ### Attach command and attach status ``` bash # Perform a GPRS Attach at+cgatt=1 # Wait if executing in batch command file wait=3 # Check the status of attach at+cgatt? ``` ### Obtain IP assigned ``` at+cgpaddr=1 ... at+cgpaddr ``` ### Show and Select Bands ``` at!band=? ... at!band=09 ... at!band? 09, LTE ALL ``` - to exit minicom: Ctrl+A X - challenge: find device, found out only /dev/ttyUSB2 works. Should be related to our setting: using micro-usb to connect Sierra wirelss ``` # in Pi terminal sudo minicom -D /dev/ttyUSB2 ``` - then check status by ``` # basic check at # check status at!gstatus? ``` - Sierra CMD ``` The following AT commands shall be entered within minicom to perform some sanity checking: AT : expected response OK. If not, make sure the board is powered on (the VBAT led should be on) and check minicom baudrate setting (default HL baudrate should be 115200), using minicom -s AT+CPIN? : expected response READY. if not, SIM PIN may be entered using the AT+CPIN command. e.g. AT+CPIN=“1234” AT+IPR? : the operating baudrate should be returned, please use this baudrate in the remaining tutorial AT+CREG? : to check the network registration status, expected response +CREG:x,1 (registered, home network) or +CREG:x,5 (roaming) AT+CGREG? : to check the GPRS registration status, expected response +CGREG:x,1 (registered, home network) or +CGREG:x,5 (roaming) AT+CSQ : returns “RSSI”,“BER”. RSSI indicates the signal strength in dBm, a value of 99 reflects no signal detected or not known ``` ### Setup APN and PDP context ``` bash # t at+cfun=1 # set profile 3 as using IP with APN being internet at+cgdcont=3,"IP","internet" # at!scdftprof=3 at!scprof=3," ",1,0,0,0 ``` ### Cell - discover ``` # search at+cops=? # disable at+cops=2 # attach at+cops=0 ``` ### Example from reference [3] ``` ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Script-initiate_data_call.at //Procedure to setup data call ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //First check SIM is not locked and it is ready AT+CPIN? //Wait WAIT=1 //Check the signal strength. In weak signal conditions, data throughput will be low AT+CSQ //Check what network is the device on AT+COPS? //Wait for few seconds as AT+COPS command can take time WAIT=3 //Get the registration status of the device. If the status is ‘1’, the device is registered and in home network AT+CGREG? //Wait WAIT=3 //Set up PDP context. Refer to the service provider for APN info AT+CGDCONT=1,”IP”,”epc.tmobile.com” //Wait WAIT=1 //Confirm setting by reading PDP profile AT+CGDCONT? //Perform a GPRS Attach AT+CGATT=1 //Wait WAIT=3 //Check the status of attach AT+CGATT? //Activate the PDP context AT+CGACT=1,1 //Wait WAIT=3 //Get the assigned IP Address AT+CGPADDR=1 //Wait WAIT=3 //Check PDP profile. AT+CGDCONT? //Deactivate PDP Context AT+CGACT=0,1 //Wait WAIT=3 //Detach from network AT+CGATT=0 ``` ## Ref 1. [How to Use an Off-the-Shelf 4G USB Module with Raspberry Pi](https://www.hackster.io/beame-io/how-to-use-an-off-the-shelf-4g-usb-module-with-raspberry-pi-c5c30f) 2. [R-pi-wierra](http://www.embeddedpi.com/documentation/3g-4g-modems/raspberry-pi-sierra-wireless-mc8705-modem-direct-ip-setup) 3. [AT-command-example](https://m2msupport.net/m2msupport/data-call-at-commands-to-set-up-gprsedgeumtslte-data-call/)