2 Comments  →
   by Dost Muhammad Shah    2 Comments  →
SIMCOM has updated the hardware of SIM800H modules with hardware versions (S2-105HG / S2-10651) due to the fact that the power amplifier chip that these modules used (RF7176) is discontinued from production line. The Firmware also had to be changed due to modifications necessary for operation of the new power amplifier chips.

All the new modules ( with hardware versions(S2-1065N / S2-1065Q) ) will be having the new power amplifier chips namely RF7198. According to SIMCOM this change in hardware wont affect the properties and characteristics of the module.

Please note that:

  • firmware for the new hardware version of module differs from the old version of the firmware. Therefore, a new hardware version module can not be flashed with the firmware for the old hardware version module.
  • firmware image files for the old and new hardware versions will be with different names. Firmware for the old version is designated “1308B06SIM800H32_BT” while the firmware for the new version is designated “1309B06SIM800H32_BT”.

sim800H

Firmware files for SIM800H

All the firmware files can be found at the firmware collection page of this blog. If you want to contribute the files you have you can do so by uploading your files to user uploads section or by emailing me the files you have.

 

 


Leave a comment  →

What do you want?

  • If you just want to check for a connection to any network – not caring if internet is available – then most of the answers here (including the accepted), implementing isConnectedOrConnecting() will work well.
  • If you want to know if you have an internet connection (as the question title indicates) please read on

Ping for the main name servers

public boolean isOnline() {

    Runtime runtime = Runtime.getRuntime();
    try {

       Process ipProcess = runtime.exec("/system/bin/ping -c 1 8.8.8.8");
        int     exitValue = ipProcess.waitFor();
        return (exitValue == 0);

    } catch (IOException e)          { e.printStackTrace(); } 
      catch (InterruptedException e) { e.printStackTrace(); }

    return false;
}

That’s it! Yes that short, yes it is fast, no it does not need to run in background, no you don’t need root privileges.

Possible Questions

  • Is this really fast enough?Yes, very fast!
  • Is there really no reliable way to check if internet is available, other than testing something on the internet?Not as far as I know, but let me know, and I will edit my answer.
  • Couldn’t I just ping my own page, which I want to request anyways?Sure! You could even check both, if you want to differentiate between “internet connection available” and your own servers beeing reachable
  • What if the DNS is down?Google DNS (e.g. 8.8.8.8) is the largest public DNS service in the world. As of 2013 it serves 130 billion requests a day. Let ‘s just say, your app not responding would probably not be the talk of the day.
  • Which permissions are required?
    <uses-permission android:name="android.permission.INTERNET" />

    Just internet access – what surprise ^^ (BTW have you ever thought about, how some of the methods suggested here could even have a remote glue about the availability of internet, without this permission?)


Leave a comment  →
' . get_the_title() . '

USB OTG port on Allwinner SoC based boards is a very useful tool. It can be used to flash an image to the flash memory or connect to a Host PC and making the board to act as a device.

Although there are many scenarios where USB OTG is useful, at times it is more useful to have an extra USB HOST on the board. All the settings of hardware configurations of allwinner SoCs are stored in a file named ` script.bin` that is compiled from a text file called fex file.We can learn more about the fex file from Sunxi Wiki in the Fex Guide.

A FEX file defines various aspects of how the SoC works. It configures the GPIO pins and sets up DRAM, Display, etc parameters.

Each line consists of a key = value pair combination under a [sectionheader]. All three, [sectionheader], key and value are case-sensitive. For comments a semi-colon (;) is used and everything following a semi-colon is ignored. The chip does not parse a textual version of a fex file, it gets cleaned and compiled by a fex-compiler. A reverse engineerd open source version exists in the sunxi-tools repository. Also a de-compiler which takes a binary script.bin and creates a textual script.fex. Usually, script.bin can be found on the nanda boot partition on A10 devices.

Changing script.bin file without removing the microSD card

The tools for script.bin changing are located in /opt/sunxi-tools directory:

  # cd /opt/sunxi-tools
  # ./chscr.sh

This will convert script.bin file from sdcard to script.fex file and the file will be opened using nano editor. Now you can change the board modules and parameters, save the changes (“CTRL”+”X”; confirm with “Y”) and exit (“CTRL”+”X” again) from nano editor.

  # ./wrscr.sh

this will convert script.fex to script.bin and the script.bin file will be written to sdcard.

  reboot

Reboot the board and the new settings would be enabled.

Changing script.bin file by removing the microSD card

The biggest part of the board configuration might be edited, changed or improved in a file called script.bin

The script.bin file can usually be found in the main directory of a microSD card prepared with official Debian image. The folder containing the script can be inspected under both Windows, Linux or Mac.

You can’t directly edit binary file so you would need to convert it to text format (it is called fex in this case), then edit the parameters via a text editor and finally switch it back to binary format.

IMPORTANT! ADJUSTING SCRIPT.BIN WITH IMPROPER VALUES MIGHT BREAK YOUR DEBIAN IMAGE AND IT IS ALWAYS RECOMMENDED TO KEEP A BACK-UP OF YOUR DEFAULT SCRIPT.BIN

To convert back and forth the script.bin you might use different tools. You can find Windows tools here: SUNXI TOOLS FOR WINDOWS . For Linux convertors please check the sunxi tools here: SUNXI TOOLS

Editing Fex File for USB OTG

Now open the Fex file and locate the USB section.

;——————————————————————————- 
;[usbc0]:  The configuration of controller 0 
;usb_used: Enable bit. If USB is enabled or not. 1: enable; 0: disable. 
;usb_port_type: Type of USB port. 0:device only;1:host only;2:OTG 
;usb_detect_type: Detect type. 0: Not detect; 1: detect vbus/id; 2: Detect id/dpdm
;——————————————————————————- 
;——————————————————————————- 

;——————————————————————————-
[usbc0]
usb_used = 1 
usb_port_type = 0 
usb_detect_type = 0 
usb_id_gpio = port:PH04<0><1><default><default> 
usb_det_vbus_gpio = “axp_ctrl” 
usb_drv_vbus_gpio = port:PB09<1><0><default><0> 
;usb_restrict_gpio = port:PH00<1><0><default><0> 
usb_host_init_state = 0 
usb_restric_flag = 0 
usb_restric_voltage = 3550000 
usb_restric_capacity= 5

We just need to change usb_port_type from 0 to 1 to make it a USB host.

Converting fex to script.bin:

The following commands are executed at sunxi-tools directory:

$./fex2bin script.fex >script.bin
$sudo cp script.bin /boot/script.bin
$sudo umount /boot
Now restart the board and you can use USB OTG as USB host.

Leave a comment  →

The Allwinner A10 is a family of single-core SoC devices designed by Allwinner Technology from Zhuhai, China. Currently the family consists of the A10, A13, A10s and A12. The SoCs incorporate the ARM Cortex-A8 as their main processor and the Mali 400 as the GPU.

The Allwinner A10 is known for its ability to boot Linux distributions such as Debian, Ubuntu, Fedora, and other ARM architecture-capable distributions from an SD card, in addition to the Android OS usually installed on the flash memory of the device.

Here I am sharing the footprint for Allwinner A10 Soc chip taken from Olimex design.

Capture

 


4 Comments  →
   by Dost Muhammad Shah    4 Comments  →
' . get_the_title() . '

In this post I am writing how to send a GET request using GSM Module with AT commands. It should work with any module and has been tested to work with Sim800 series  (SIM800C-DS , SIM800ASIM800H, SIM800L, SIM800C, SIM800 etc) and Sim900 series (SIM900, SIM900A, SIM900D, SIM900B) of modules from simcom.

You have to bring up GPRS connection before this obviously , which is not covered here in this post.

 

HERE ARE THE STEPS TO MAKE GET REQUEST

Initiate the HTTP service

AT+HTTPINIT
> OK

Set the HTTP session.

AT+HTTPPARA=”CID”,1
> OK

Set the HTPP URL

at+httppara=”URL”,”google.com”

Start the session<

AT+HTTPACTION=0
> OK

> +HTTPACTION:0,601,0

The above AT response code (601) for HTTP session start indicates that there is a network error. Then make sure that the PDP context is setup properly.

IF the HTTP session is successful, it should return code of ’200′,

AT+HTTPACTION=0
> OK
> +HTTPACTION:0,200,4

Above HTTP GET request is sucessful and it returned 4 bytes.
To read the data of the HTTP server,

AT+HTTPREAD
> +HTTPREAD:4
> test
> OK

To terminate the HTTP service,

AT+HTTPTERM
> OK