From B1300 to S1300 openwrt build

I’d like to create a new openwrt build for the S1300 the same as I do with the B1300. When I try to configure the build using make menuconfig and the Target System (Qualcomm Atheros IPQ40XX), in the Target Profile I see GL.iNet B1300 but not GL.iNet S1300.

What do I need to do to product a new S1300 openwrt build?

GL.iNet source, or OpenWrt source?

Have you seen the openwrt-18.06-s1300 branch in the GL.iNet source?

0cc8080725 (glinet/openwrt-18.06-s1300) update README.md
6beeb20600 add README.md
4de89377a5 add transition image
4e841cd87f ipq40xx: add support for GL.iNet GL-S1300

Holy smokes. Where have I been? I was just using the GitHub - openwrt/openwrt: This repository is a mirror of https://git.openwrt.org/openwrt/openwrt.git It is for reference only and is not active for check-ins. We will continue to accept Pull Requests here. They will be merged via staging trees then into openwrt.git. repo to build b1300 images and assumed s1300 would be pushed to that repo too.

Thanks for the tip Jeffsf.

Using:
git clone GitHub - gl-inet/openwrt: This repository is fork from openwrt official repo, we will update the latest tag and release GL.iNet firmware based on it. source
cd source
git checkout origin/openwrt-18.06-s1300

Then building an S1300 image:
bin/targets/ipq40xx/generic/openwrt-ipq40xx-glinet_gl-s1300-squashfs-sysupgrade.bin

I get:
root@GL-S1300:/tmp# sysupgrade openwrt-ipq40xx-glinet_gl-s1300-squashfs-sysupgrade.bin
Error: mandatory section(s) missing from “openwrt-ipq40xx-glinet_gl-s1300-squashfs-sysupgrade.bin”. Abort…
Image check ‘platform_check_image’ failed.

Is my .config file wrong maybe?
Do you have a config file that will work for me?

I don’t have one of the ipq40xx-based, GL.iNet routers in my “stable”, unfortunately. sysupgrade -v might provide more insight. Also, as sysupgrade is a shell script, so sh -x /sbin/sysupgrade ... is another tool (check the path, that’s from memory).

In my experience, errors like that are often from missing metadata in the image’s configuration, either in whole or, for example, SUPPORTED_DEVICES.

It is also possible that you have QSDK-based firmware running. Though based on an old version of OpenWrt, it has many differences that QCA have included, most of which are proprietary and source is not publicly available. I haven’t looked into the original GL.iNet firmware for the S1300. If the banner (or other files in /etc/) indicates “Barrier Breaker” or “Chaos Calmer”, you are likely running a QSDK-based build. There is nothing “wrong” with QSDK; in many cases it can outperform open-source firmware.

U-Boot is another option for flashing, perhaps a bit safer than blindly trying to “force” sysupgrade.

Not to sure how often the github mirror syncs up to the openwrt git repos… best to work off the git.openwrt.org directly if you’re keeping up with things.

I’ve been working off master for another target, and have a B1300 in-house, but running the QSDK build from gl-inet. QSDK is older, but as @jeffsf mentions, you get a lot in return, like working Wave2 wifi drivers, mesh, and wan/lan offload.

ipq40xx is a fairly complex chip compared to the ar9531/9331

S1300 is quite a bit different than B1300 - RAM/NOR sizes are different, have to account for the eMMC, and the BLE/Zigbee module, and this needs to be accounted for in uboot and device tree.

@hansome pls have a check of this.

S1300 factory firmware is a QSDK build which is based on Chaos Calmer.
Currently sysupgrade is not working for flashing openwrt firmware.

Install S1300 openwrt via uboot web:

NB: need to flash transition image firstly, or it will be brick.

The transition image is s1300-factory-to-openwrt.img when you install openwrt. So first time installation you need to access uboot web twice. Afterwards, openwrt sysupgrade can be used.

  • Steps:
  1. Push reset button and plug in power, wifi led will blink, release button when middle led light on
  2. Set ip to 192.168.1.0/24 and use web browser to access http://192.168.1.1
  3. Choose file s1300-factory-to-openwrt.img and click “Update Firmware” (Steps 3 will consume about 30 seconds, then):
  4. Poweroff router
  5. Repeat step 1, 2, and when step 3 choose your compiled openwrt firmware file and update firmware (When update finished, router will reboot automatically)
  • Why need transition image

The kernel and rootfs of factory firmware is on eMMC, and openwrt firmware is on NOR flash. The transition image includes U-boot and partition table, which decides where to load kernel and rootfs. After you install openwrt image, you can switch between factory and openwrt firmware by flashing transition image. Go back to factory firmware use transition image s1300-openwrt-to-factory.img

1 Like

I’ve compiled GitHub - openwrt/openwrt: This repository is a mirror of https://git.openwrt.org/openwrt/openwrt.git It is for reference only and is not active for check-ins. We will continue to accept Pull Requests here. They will be merged via staging trees then into openwrt.git. image for the GL-S1300 with this commit https://github.com/openwrt/openwrt/pull/2914

How can i test BLE and Zigbee?
Is this valid GitHub - gl-inet/ble2mqtt: BLE 2 MQTT bridge on GL.iNet IoT gateway?

Thanks.

It is still valid. Also we will release zigbee tool soon.

opkg install bletool does not works

root@OpenWrt:/# opkg update
Downloading http://downloads.openwrt.org/snapshots/targets/ipq40xx/generic/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading http://downloads.openwrt.org/snapshots/targets/ipq40xx/generic/packages/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a7_neon-vfpv4/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a7_neon-vfpv4/base/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a7_neon-vfpv4/freifunk/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_freifunk
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a7_neon-vfpv4/freifunk/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a7_neon-vfpv4/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a7_neon-vfpv4/luci/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a7_neon-vfpv4/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a7_neon-vfpv4/packages/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a7_neon-vfpv4/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a7_neon-vfpv4/routing/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a7_neon-vfpv4/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a7_neon-vfpv4/telephony/Packages.sig
Signature check passed.
root@OpenWrt:/# opkg install bletool
Unknown package 'bletool'.
Collected errors:
 * opkg_install_cmd: Cannot install package bletool.
root@OpenWrt:/#

Remember, i’ve compiled from openwrt instead from glinet.

I want to test BLE and Zigbee, i’ve 6 GL-S1300 with BLE & Zigbee modules

It is “gl-bletool”.

Sorry for bad docs.

I think i will need to compile GitHub - gl-inet/bletool myself.

@hansome, you say in your pull request that has tested UART1 for BLE, SPI for zigbee. Is there a standard way to test? instructions here [OpenWrt Wiki] USB Bluetooth support does not works, hciconfig is empty

Thanks

Compiling bletool for openwrt will report dependency error on gl-util package, that dependency could be removed later. I compile bletool and gl-util for openwrt, please check attachment.
openwrt-bletool-ipk.zip (64.0 KB)

Install by command:

opkg update
opkg install /tmp/gl-util_3.0.149-1_arm_cortex-a7_neon-vfpv4.ipk
opkg install /tmp/gl-bletool_3.2.2_arm_cortex-a7_neon-vfpv4.ipk
reboot

Please note, the first time installing gl-bletool you need reboot. For the following reason:
Before installing gl-bletool, you can check /etc/inittab, which sets /dev/ttyMSM1 as a debug console.
As procd will not release /dev/ttyMSM1 util next boot cycle. So it’s a conflict as /dev/ttyMSM1 is the UART interface talking to BLE module.

hciconfig doesn’t work, as bletool/README.md at master · gl-inet/bletool · GitHub tell,
"Different from BlueZ which includes the full Bluetooth protocol stack in the host system, bletool is a light weight tool to operate hostless BLE modules which has fully built-in protocol stack. "

Thanks for the explanation, will test tomorrow.

Hi @hansome, I’ve tried your instructions but I cannot install it.

I’ve a clean image generated from openwrt-18.06 here GitHub - Makedit/openwrt at openwrt-18.06

This are the errors

root@openwrt:/tmp# opkg install openwrt-bletool-ipk/gl-util_3.0.149-1_arm_cortex-a7_neon-vfpv4.ipk
Installing gl-util (3.0.149-1) to root...
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for gl-util:
 *      libuci20130104
 *      libjson-c4
 *      libiwinfo20200105
 *      libcurl4
 *      libubox20191228
 *      libubus20191227
 * opkg_install_cmd: Cannot install package gl-util.
root@openwrt:/tmp# opkg list | grep libuci
libuci - 2019-05-17-f199b961-1 - C library for the Unified Configuration Interface (UCI)
libuci-lua - 2019-05-17-f199b961-1 - Lua plugin for UCI
root@openwrt:/tmp# opkg install openwrt-bletool-ipk/gl-bletool_3.2.2_arm_cortex-a7_neon-vfpv4.ipk
Installing gl-bletool (3.2.2) to root...
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for gl-bletool:
 *      libubox20191228
 *      libubus20191227
 *      libjson-c4
 *      gl-util
 * opkg_install_cmd: Cannot install package gl-bletool.
root@openwrt:/tmp#

It works with master branch, thanks.

I’m trying to compile on openwrt-18.06 branch, i need this, but plan to update in future.

Hi, uploaded openwrt 1806 version.openwrt-1806-bletool-ipk.zip (61.9 KB)

It works, thanks.

gatttool also does not works. Is this due to the fact that the bluetooth module is connected by serial instead of usb hci device?

Yes, gatttool belongs to bluez-utils.