Archive

Posts Tagged ‘wifi’

NXP Modular IoT Gateway Supports Thread, Zigbee, NFC, Bluetooth and WiFi Connectivity

November 30th, 2016 1 comment

NXP has just announced a modular IoT gateway solution for large node networks (>= 250 nodes) based on Volansys i.MX6UL system-on-module, supporting wireless communications protocols such as Thread, ZigBee, NFC through add-on modules, on top of Wi-Fi and Bluetooth 4.1.

nxp-modular-iot-gatewayNXP Modular IoT Gateway specifications:

  • SoM – Volansys i.MX6UL 200-pin SO-DIMM module with:
    • SoC – NXP i.MX 6UL ARM Cortex A7 processor @ 528 MHz
    • System Memory – 256MB to 1GB DDR3L  RAM
    • Storage – 1GB to 4GB NAND flash, optional 4GB to 16GB eMMC flash, EEPROM for device info
    • PMIC, Mbit Ethernet PHY
  • Wireless Connectivity Expansion Modules:
    • PN7120 explorer board for NFC
    • Kinetis KW41 module for Thread support
    • JN5169 module for Zigbee support
    • 2x MikroBUS headers
  • Baseboard connectors / features:
    • Storage – 1x micro SD slot
    • Connectivity – 1x 10/100M Ethernet port, Murata WiFi 802.11 b/g/n & Bluetooth 4.1 + EDR module with external antenna connector
    • USB – 2x USB 2.0 host port, 1x micro USB OTG ports,
    • Debugging – 1x micro-USB port for debugging, JTAG connector
    • Misc – RTC, LEDs, user switch (for power on/off and NFC), and reset pinhole
  • Power Supply – 5V/3A
  • Dimensions & Weight – TBD
  • Certifications – FCC/CE/IC

nxp-iot-gateway-board

So you can select your own i.MX6UL module with the amount of memory and storage needed, and add wireless modules as needed to match your requirements. Volansys is also planning for LoRaWAN and Sigfox modules in the future. Beside the hardware, the gateway and modules all come with various software stack and documentation: A Yocto Linux BSP with drivers, an MQTT client library, a Thread Linux host software SDK, Thread and Zigbee device controller, registration with the cloud, and more. The companies also provide an Android app to manage the gateway, and firmware for Thread Kinetis KW4x end device. Alternative operating systems supported include OpenWRT and Brillo.

nxp-modular-iot-gateway-block-diagram

NXP Modular IoT Gateway is available now for $269 with the default configuration, and you’ll find more details with documentation and datasheets as well as a purchase link on NXP Modular Gateway product page and Volansys website.

Via HackerBoards

Getting Started with Pine64 PADI IoT Stamp – Part 2: Serial Console, GCC SDK, Flashing & Debugging Code

November 28th, 2016 5 comments

PADI IoT Stamp module powered by Realtek RTL8710AF ARM Cortex M3 WiFi SoC is a potential competitor to Espressif ESP8266 modules.  Pine64, the manufacturer of the module, sent me their kit with a $2 IoT stamp, a breakout board, a USB to TTL debug board and a J-Link debug board. In the first part of the review I’ve shown the hardware and how to assemble PADI IoT stamp kit. In the second part I’m going to write a tutorial / getting start guide showing how to control the board with AT commands, build the firmware with GCC SDK, and finally demonstrate how to flash and debug the firmware with the J-Link debugger.

The Quick Start Guide indicates you need to connect the USB to TTL debug board to UART2 instead of UART1 as I did on the very similar B&T RTL-00 RTL8710AF module, and set connection settings to 38400 8N1. This did not work for me, and I had indeed to connect the USB to TTL board to UART0 instead (GB0 & GB1 pins).

Click to Enlarge

Click to Enlarge

I’ll be using a Ubuntu 16.04 (Linux) computer for this quick start guide, but you can work with Windows and Mac OS X too, as tools as available for all three operating systems. So in my case I configure minicom to 38400 8N1 using /dev/ttyUSB0 device, and the boot log is almost the same as B&T RTL-00 with the same ROM version and toolchain:

There are however some changes, and for example the firmware used on PADI IoT Stamp has slightly more heap available. The guide also mentions ATS? should show all command available, but it’s not working for me:

Typing “help” as I did with RTL-00 module does not work either, and that does not look since documentation appears to be wrong again, but that’s not a big deal since we have all AT commands listed in that document. I could configure it as “IoTSTAMP” access point:

and enable the HTTP server with ATSW AT command:

It rebooted the IoT stamp with the same WiFi setting, and I could connect to its demo web page for configuration.

Click to Enlarge

Click to Enlarge

Since everything is so similar to B&T RTL-00 I’ll just point out to the post “Getting Started with B&T RTL-00 RTL8710 Module – Serial Console, AT Commands, and ESP8266 Pin-to-Pin Compatibility” for more tests with different AT commands. I still tried to turn on and off the a GPIO pin using the ATSG command since it’s something I did not do with RTL-00:

The first line pull GC0 pin to high level (3.3V), while the second command brings it down to low level (0V). Details about ATSG command:

I did not connect an LED, but instead measured the value with multimeter and could confirm the voltage level was right in both cases.

B&T provided an SDK which required a an unlicensed / pirated version of IAR ARM Workbench, but Pine64/Realtek have released a GCC SDK that do you require you to use pirated software. You can download sdk-ameba-rtl8710af-v3.5a_without_NDA_GCC_V1.0.0 (198 MB) directly from Pine64 website. After unzipped the SDK you can enter sdk-ameba-rtl8710af-v3.5a_without_NDA_GCC_V1.0.0 directory, and open readme.txt to have a look at RTL8710 GCC SDK structure:

Since I only aim to write a getting started guide I won’t go through all of it, but we can see the low level source code & binary, some documentation, an example project, and some tools include Android and iOS apps, OTA download server and more.

Nevertheless the readme.txt tells us to first read “UM0096 Realtek Ameba-1 build environment setup – gcc.pdf” in order to setup our development environment. The instructions are available with Windows and Linux, but again I’m only test them using Ubuntu 16.04. They’ll be very similar since you’ll rely on cygwin in Windows, and if you run the latest Windows 10 you should be able to install Windows subsystem for Linux, and use the Linux instructions.

First you have to make sure some tools and libraries are installed:

then we can build the sample project:

If everything goes well the log should end showing “Image manipulating” as follows:

We can find the application in application/Debug/bin directory:

There’s also an ota.bin image which might be usable using OTA firmware update documentation, but for this guide I want to use the J-Link debugger that the company sent me instead. The GCC SDK is not for PADI IoT stamp, but instead for Realtek Ameba Arduino board, and you’ll be asked to connect the board through one of the micro USB port. That won’t work with IoT stamp since there’s no USB port at all, and instead you’ll need to go and back forth between multiple documentation, and connect the board as per the JTAG/SWD connections diagram shown below.

padi-iot-stamp-jlink-swd-connectionThat document also mentions that:

Required external power VCC 3.3V, JTAG/SWD didn’t supply power to the PADI IoT Stamp, VCC connection from PADI IoT Stamp is used by JTAG/SWD as voltage reference only.

At first, I did not see that, and used it without external power supply, but since I was not successful with the J-Link debugger (for another reason), so I ended up inserting PADI IoT stamp into a breadboard and added Ywrobot power board to provide an external 3.3V power source.

Click to Enlarge

Click to Enlarge

I also soldered a 22uF capacitor, since I’ve read it’s not optional, as it may affect WiFi connection due to power issue. Once I complete the wiring, I connected the debugger to my computer:

There are two sets of instructions in UM96 document to download and flash the code: OpenOCD/CMSIS-DAP and JLink, so since I had a J-Link debugger, I went with that latter. First you have to download J-Link Software and Documentation pack and for my system I selected ” Linux, DEB Installer, 64-bit V6.12″. After accepting the EULA, I got JLink_Linux_V612_x86_64.deb file which I installed as follows:

Now we can start JLink GBD server for a Cortex-M3 as explained in the document:

So the JLink debugger is detected, but failed to connect to the target. Apart from the last error, everything looks exactly as in the documentation. That’s when I started to add an external power boar, solder the capacitor, and double check my connection. But finally after many trials and errors, I realized that I had to use a SWD connection (SWCLK/SWDIO signals) instead of JTAG…

Now keep the GDB server running, open a new terminal windows in the same directory (where you’ve built the code), and run make flash to download and flash the code to the board:

There will be a lot of message as above, and the GDB Server windows will show its own set of messages:

Now if you want to debug your code, you can run make debug to start the gdb console:

At this point, you’ll just need to use gdb command out of the scope of this post, but you can find tutorials online, for example this. You can also run make ramdebug in order to write ram_all.bin to RAM then enter gdb debug.

So that’s only the debug part, but if you want to create your own application, you’ll need to study the source code, and there are plenty of examples to help you in project/realtek_ameba1_va0_example/example_sources folder:

Note that this is only useful is you want to use PADI IoT stamp as a standalone module, and if you connect it to another board (e.g. Arduino) you can control it through the AT command set.

So while PADI IoT stamp is a usable platform with its GCC SDK, currently documentation is not always correct, and development should be reserved to experienced developers, as it’s not exactly as straightforward as Arduino, Lua or other firmware often used in ESP8266. Arduino will most likely never supported on IoT stamp due to memory constraints, but mbed support should come to the module in the first part of next year, which will make everything much easier.

If you want to go further, you can read the documentation on PADI IoT stamp resource page and the GCC SDK, checkout rebane’s openocd example, and/or read a forum post about controlling IoT stamp through Pine A64 board using Python.

If you want to play with your own, you can get PADI IoT stamp for $1.99, the breakout board kit for $0.5, the USB to serial debug board for $1.99, and the JLink (SWD) debugger is $7.99 on Pine64 online store. Please note that the two debug boards are standard components, so you may use your own, if you already have such hardware.

Sevenhugs Smart Remote is a Universal Direction Aware WiFi, Bluetooth and IR Remote Control (Crowdfunding)

November 25th, 2016 2 comments

You may have all sort of remote control devices around your home from the traditional IR remote control for your TV, air conditioner, audio system etc.., as well remote control apps for WiFi or Bluetooth objects such as smart light bulbs or water pumps running on your smartphone. Sevenhugs Smart Remote promises to replace them all, and all you have to do is to point the remote control to your devices, or setup virtual actions to your door or window to order a Uber drive or check the weather.
sevenhugs-remote-control

Sevenhugs Smart Remote specifications:

  • MCU – ARM Cortex-M4 @ 200 MHz
  • System Memory – 32 MB RAM
  • LCD – 3.43″ touch screen IPS display; Dragontrail damage ans scratch resistant cover glass, anti-fingerprint & anti-glare
  • Wireless Connectivity – IR transceiver, 802.11 b/g/n WiFi and Bluetooth 4.1 LE connectivity
  • USB – USB C port for charging
  • Sensors – Indoor positioning sensor, accelerometer, gyroscope, compass, ambient light sensor
  • Misc – Small speaker
  • Dimensions – 135 x 41 x 9.7 mm

The remote comes with a charging base including a lost & found button to make the remote control ring in case you can’t locate it, as well as three room sensors to place close to the object/service your want to control, for example one close to your TV, the other on your door, and the last one next to your window. You’ll still need a smartphone running Android or iOS to install an app to configure the remote control for your devices, and currently 25,000 devices using Wi-Fi, Bluetooth or Infrared are supported with more being added daily.
smart-remote-room-sensorsOnce this simple setup is complete, simply point to remote to the device or service you want to control, and the screen interface will adapt to the objects pointed with for example volume control for an audio system, and weather forecast when pointing to a window. If you have several objects in a zone for example a TV with set-top box and AV receiver, you can use the carousel on the remote control to switch between each of them. This also means you can control other WiFi devices from any room in your home.

The company will also release a Lua SDK based in C/C++, first allowing to add new devices to be released in June 2017 but with an early release already available in github, and then allowing much more control over the remote such as developing custom gesture, screens, and menus. The Level 2 part of the SDK is scheduled for release at the end of 2017.

The remote control has been launched in Kickstarter, and have been very successful so far having raised over $700,000. Most early bird rewards are gone, but you can still pledge $149 to get  Smart Remote Kit including the charging base and 3 room sensors. Shipping is free to the US and western Europe, but for other countries it will cost you $20 to $35 extra, and delivery is scheduled for July 2017. More details may be found on Sevenhugs Smart Remote microsite.

Make-WiFi-Fast Project Massively Improves WiFi Performance of Busy WiFi Routers

November 16th, 2016 7 comments

WiFi is a great way to add connectivity to a large group of people, but once everybody tries to connect at the same time, the network often becomes unusable due to very high latency, a problem that can occur on servers on the ISP side too, and that’s usually caused by excessive buffering, Bufferbloat. The Bufferbloat project aims to resolve this issue with both routers using CoDel and fq_codel algorithms, as well as WiFi  via Make-WiFi-Fast project.

Dave Täht gave a presentation of his work on Make-WiFi-Fast project entitled “Fixing WiFi Latency… Finally“showing how latency was reduced from seconds to milliseconds. It’s quite technical, but two slides of the presentation clearly shows the progress made.

Click to Enlarge

Click to Enlarge

The first chart shows 100 stations connecting to a website using unpatched code with the top of the chart showing the bandwidth per node in MBits/s, while the lower part showing latency in ms. We can see that about 5 stations can download data at up to 100 Mbps, but 95 stations need to wait, many give up, and after two minutes some other stations start to download again. Average bandwidth is 20 Mbits/s and not exactly evenly distributed among stations. Latency is about 15 seconds based on that chart.

Click to Enlarge

Click to Enlarge

The second chart shows the same test with make-wifi-fast patch to the Linux kernel, mainly improving queue handling. Both chart shows many more stations are served with an average of 1 Mbits/s, and latency is slashed to about 150 ms, meaning the vast majority of users get a much better user experience with that “airtime fairness” solution

I understand the tool used to test network connectivity and generate data for the charts above is flent, the FLExible Network Tester. The video below discusses benchmark, make-wifi-fast, and TCP BBR using the presentation slides shared above.

There’s also an article on LWN.net discussing about this very topic. Make-wifi-fast project patchsets are queued for  Linux 4.9 and 4.10 already, and yet-to-be submitted patchsets for LEDE (OpenWrt fork) can be found here.

Thanks to Zoobab for the tip.

Allwinner H2 Linux & Android SDK, and Allwinner XR819 WiFi Driver Released

November 10th, 2016 23 comments

Orange Pi Zero is an interesting little ARM Linux board thanks to its low price, but also because it features a new Allwinner H2 / H2+ quad core Cortex A7 processor very similar to Allwinner H3 minus the 4K video decoding part, as well as Allwinner XR819 WiFi module, which I have not seen on any other boards so far.

allwinner-h2-linux-android

But hardware without software is pretty much useless, so developers will be happy to find out that Allwinner H2 SDK with Linux (lichee) and Android has been released or leaked, and it also includes the Allwinner XR819 WiFi driver.

You’ll find the SDK on Zoobab server with three main directory / files:

  • Android folder – Android 4.4.2 SDK
  • lichee folder – Linux 3.4.39 source code. However you’d probably better use Linux 3.4.113 currently released by sunxi-linux, or Linux mainline. The latter does have some limitations, and may or may not be suitable for your project.
  • H2-V1.2.tar.bz2 – The tar file with both Android and lichee folder in case you want to download the full SDK on your computer

If another hardware comes with Allwinner XR819 WiFi module and you just need the Linux driver, you’ll find it in linux-3.4/drivers/net/wireless/xradio directory.

tkaiser managed to enable XR819 on armbian after disabling dhd driver:

8Devices Rambutan Qualcomm Atheros QCA9557 / QCA9550 GbE & WiFi Modules and Development Kit Run OpenWrt

November 10th, 2016 2 comments

8Devices, a Lithuanian company specialized in the development and manufacturing of electronic equipment, is known for their Carambola and Carambola2 WiFi modules powered by Ralink and Qualcomm Atheros WiSoCs. The company has now introduced a new dual band WiFi module called Rambutan that comes in commercial and industrial temperature range through respectively Qualcomm Atheros QCA9557 & QCA9550 SoCs.

8devices-rambutan

Rambutan and Rambutan-I modules specifications:

  • SoC
    • Rambutan – Qualcomm Atheros QCA9557 MIPS processor @ 720 MHz
    • Rambutan-I – Qualcomm Atheros QCA9550 MIPS processor @ 720 MHz
  • System Memory – 128 MB DDR2
  • Storage – 128 MB Flash
  • Connectivity
    • WiFi – 802.11 a/b/g/n, 2.4 or 5 GHz, 2×2 MIMO, 300 Mbps data rate, 21 dB per chain output power; 2x u.FL connectors
    • Ethernet – Atheros AR8032 10/100M Ethernet PHY
  • 68x half holes with
    • 2 x USB 2.0 host port
    • 2 x serial port
    • 1x 100 Base-T Ethernet port;  1000 Base-T Ethernet port  (SGMII interface)
    • I2S, SPI, I2C, GPIO, PCIe, MDIO
  • Power Supply – +3.3V DC; max power consumption: 3.7 W
  • Dimensions – 46.9 x 31.8 mm
  • Temperature Range – Rambutan: 0 – 65° C; Rambutan-I: -40 – 85° C

Beside the wider temperature range, Rambutan-I features QCA9550 SoC with the following advantages over QCA9557:

  • 5 and 10 MHz channelization supported in a 4.9 GHz frequency band only
  • Loopback mode to assist FIPS AES certification
  • High Tx power accuracy at lower power level
  • Small packet size (96 Bytes) in AES encryption at full packet rate
  • 8 bits spectral analysis resolution
Rambutan Pinout Diagram

Rambutan Pinout Diagram

The modules run OpenWrt with the source code to be provided on 8devices’ github account, while support is handled through their forums. The company also offers Rambutan development kit with a baseboard for the module with some interesting features and expansion for this kind of board:

  • Ethernet – 1x 1000 Base-T Ethernet port, 1×100 Base-T Ethernet port
  • USB – 1x USB Type-A socket, 1x Mini USB Type-A socket for serial console and power
  • Expansion:
    • 2x 20-pin 2.54 mm pitch through holes for I/Os such as GPIOs, USB, UART, SPI, JTAG, …
    • Mini PCIe socket
  • Misc –  reset and user buttons, DIP switch for bootstrap options, 2x integrated antennas
  • Power Supply – 5V via mini USB port
  • Dimensions – 125 x 77 mm (estimated)
Rambutan DVK (Click to Enlarge)

Rambutan DVK (Click to Enlarge)

Rambuta can be purchased now for $35, Rambutan-I for $49, and Rambutan development kit for $79. You’ll find more information, include a product brief, a datasheet, and the development board’s schematics on 8devices Rambutan’s product page.

Sonoff POW and Sonoff TH16 WiFi Relays Review – Part 1: The Hardware

November 4th, 2016 19 comments

Sonoff TH16 is a WiFi 16A relay that can take external sensors via a 2.5mm jack, while Sonoff Pow is a WiFi relay capable of measuring power consumption. Both have been designed by ITEAD Studio, and feature Espressif ESP8266 WiSoC. The company sent me both items for review, and I’ll start by checking out the hardware a little more closely than what is possible during the product announcement.

Click to Enlarge

Click to Enlarge

I received Sonoff TH16 together with Sonoff AM2301 temperature and humidity sensor, which I’ll use to use to control an outdoor water pump and gather temperature and humidity data, as well as two Sonoff POW relays,which I plan to use to measure power consumption in my office, both from the power outlets and my aircon. All three WiFi relays support 3500 Watts, and 85 to 250V input.

sonoff-qr-codeThe packages have three QR codes for eWeLink iOS app, the Android app (coolkit.apk), and the user’s manual in English and Chinese.

Both Sonff TH16 and POW are using the exact same case, but the hole for the sensor jack is not used in Sonoff POW.

Click to Enlarge

Click to Enlarge

There’s a cover to protect the mains cables tightened with a single screw. Input and Output live terminal are on both sides of the relays, will the ground/earth (E) and neutral (N) can be accessed from the middle terminals.

The company promotes their devices as hackable, but still decided to include a sticker that breaks if you try to open the case. If you bought the device from China, the warranty probably does not matter considering the low price of the device, but if you bought locally and intend to use the warranty in case something breaks, it may be voided if you open the case to flash your own firmware.

sonoff-warranty-sticker

Opening the case is very easy. First remove the terminal cover by loosening the screw, and then use a sharp and rigid plastic tool to separate both part of the case. I’ve started with Sonoff POW.

Click to Enlarge

Click to Enlarge

You’ll find the 4-pin for serial access in order to flash and/or debug your own firmware, the mauin button, two LED, a 16A relay, the 6 input and output terminals, and I’ve glad to see a fuse for safety. Talking about safety, ITEAD has not applied for UL, ETV, or TUV safety certifications (yet), but at least they now have CE certification for all their most recent Sonoff modules.

Click to Enlarge

Click to Enlarge

We’ll find ESP8266 SoC on the bottom of the board with a PCB antenna as far away as possible from active components to avoid interferences, thick solder for high voltage traces, and some holes in the PCB along high voltage traces likely for safety reasons.

Unsurprisingly, Sonoff TH16 looks almost exactly the same expect for the added 2.5mm jack for the sensor modules.

Click to Enlarge

Click to Enlarge

The company also seemed to have designed the board to let people add a 9-pin connector to access more I/Os, but for some reasons all holes are filled with solder instead.

Click to Enlarge

Click to Enlarge

sonoff-terminals

A close up on AM2301 reveals the main specifications of the sensors with 0 to 99.9% relative humidity range, and -40 to 80 C temperature range.
aosong-am2301That’s all for the hardware presentation. The next steps will be to install and configure Sonoff modules with the stock firmware and apps.

If I go ahead with my idea of connecting two Sonoff POW in my office the setup will look like the one below.

Click to Enlarge

Click to Enlarge

The one on the left will measure power consumption from the two outlets where all my equipment is connected, I’ll leave the center cable alone (the light), and the one installed on the right would measure my aircon power consumption. Once I cut the cables, and connect one part to Sonoff POW, the rest of the cable will be too short, so I had to get cut two short cables and re-cable the gang box, and the circuit breaker for the aircon. I would have wished they had arrange the terminals to make it easier to instead the modules within an existing circuit.

All four items can be purchased on ITEAD Studio website with Sonoff TH16 and AM2301 selling for respectively $8.60 and $4.0 on Sonoff TH page, while Sonoff POW goes for $10.50. Shipping is not included, but normally only adds a few dollars if you select registered airmail shipping, instead of EMS or DHL Express.

[Update: Part 2 of the review is up @ “Getting Started Guide for Sonoff TH16 ESP8266 Relay and Sensor using the Stock Firmware and eWelink Android App

Part 3 of the review is available @ How-to Build and Flash ESPurna Open Source Firmware to Sonoff POW Wireless Switch

]

Orange Pi Zero Allwinner H2+ Board with WiFi and Ethernet is Up for Sale for $7 and Up

November 2nd, 2016 70 comments

Orange Pi Zero development board powered by Allwinner H2+ quad core Cortex A7 processor with 256 to 512MB RAM, Ethernet, and USB ports is now available for sale on Aliexpress for just $6.99, which shipping adding $3.39 in my case bringing the total to $10.38.

orange-pi-zero-board

Orange Pi Zero specifications:

  • SoC – Allwinner H2(+) quad core Cortex A7 processor @ 1.2 GHz with Mali-400MP2 GPU @ 600 MHz
  • System Memory – 256 to 512 MB DDR3-1866 SDRAM
  • Storage – micro SD card slot
  • Connectivity – 10/100M Ethernet + 802.11 b/g/n WiFi (Allwinner XR819 WiFi module) with u.FL antenna connector and external antenna
  • USB – 1x USB 2.0 host ports, 1x micro USB OTG port
  • Expansion headers – Unpopulated 26-pin “Raspberry Pi B+” header + 13-pin header with headphone, 2x USB 2.0, TV out, microphone and IR receiver signals
  • Debugging – Unpopulated 3-pin header for serial console
  • Misc – 2x LEDs
  • Power Supply – 5V via micro USB port or optional PoE
  • Dimensions – 52 x 46 mm
  • Weight – 26 grams

Based on the hardware features and likely good availability it’s a serious contender to Raspberry Pi Zero (and Nano Pi NEO) for headless applications, and provided Allwinner H2+ is close enough to Allwinner H3 software support should be fairly good, as I expect armbian support very soon. Allwinner XR819 is a completely new WiFi module, at least to me, so there may be driver issues, but if it is working in the firmware image provided by Orange Pi (none so far), it should be possible to add this to other Linux images too. [Update: Orange Pi Zero schematics are now available]

orange-pi-zero-descriptionThe Aliexpress page explains the default version has 256MB RAM, but it’s not really clear whether / how we can buy the 512MB version. [Update: The 512MB version now available on Aliexpress for $8.99 + shipping]

Thanks to OvCa77 for the tip.