Archive

ITEAD Studio has just launched another Sonoff Smart Home product with Sonoff S31 WiFi smart socket with energy monitoring. Just like Sonoff switches, light bulbs, and their other products, the device can be controlled using eWelink app for Android or iOS, and supports integration with Amazon Alexa, and Google Assistant.

It should be noted that the company only provide a US plug version for now, and so far, there’s no Wiki link, so while it’s likely based on ESP8266 or ESP8285 like their other Sonoff devices, it may not be designed to be easily hackable, although I suspect the electronics may be similar to Sonoff POW switch (TBC).

Sonoff S31 hardware specifications listed by ITEAD:

Voltage Input – 90~264V AC, 50/60HZ

Max. Current – 16A

Max. Power – 4200W (Note package above reads max load: 220V/10A)

Gang – 1x US type with ground

Connectivity – 802.11 b/g/n WiFi with support for WEP/WPA-PSK/WPA2-PSK

Misc – Power button, LEDs

Dimensions – 75.7×39.7x32mm

Weight – 135g

Temperature Range – -20 °C ~ 75 °C

Humidity – 10%-80%

The socket also includes overload protection for safety, and once you can install eWelink app for Android/iOS to control it remotely, monitor power consumption, and estimated electricity bill, set timers, and securely share with other users in the home.

The company also highlights the compact design, claiming users will be able to connect two sockets on their 2-gang boxes. If you prefer alternative open source firmware like Sonoff-Tasmota or ESPurna, you’d have to wait or do it yourself since the product is still very new.

Many people on Facebook complain about the lack of EU plug, so hopefully the company will take note and soon offer a compatible version, but in the meantime you can purchase the US version of Sonoff S31 for $16.90 plus shipping on ITEAD Studio store. [Update: Sonoff S31 can also be found for $16.90 shipped on Aliexpress]

The Chiang Mai Maker Party 4.0 is now taking place until December 9, and I went there today, as I was especially interested in the scheduled NB-IoT talk and workshop to find out what was the status about LPWA in Thailand. But there are many other activities planned, and if you happen to be in Chiang Main in the next few days, you may want to check out the schedule on the event page or Facebook.

I’m going to go though what I’ve done today to give you a better idea about the event, or even the maker movement in Thailand.

Click to Enlarge

Booth and activity area should be the same over the 4 days, but the talks, open activity, and workshop will be different each day. Today, people could learn how to solder in the activity area.The even was not really big with manufacturers/sellers like ThaiEasyElec, INEX, or Gravitech closer to the entrance…

… and slighter higher up in a different zone, companies and makers were showcasing their products or projects. I still managed to spent 5 interesting hours at the event attending to talks and checking out the various projects.

I started my day with a talk entitled “Maker Movement in South East Asia” presented by William Hooi, previously a teacher, who found One Maker Group and setup the first MakerSpace in Singapore, as well as helped introduce the Maker Faire in Singapore in 2012 onwards.

There was three parts to talk with an history of the Maker movement (worldwide), the maker movement in Singapore, and whether Making should be integrated into school curriculum.He explained at first the government who not know about makers, so it was difficult to get funding, but eventually they jump on the bandwagon, and are now puring money on maker initiative. One thing that surprised me in the talk is that before makers were hidden their hobby, for fear of being mocked by other, for one for one person doing an LED jacket, and another working on an Iron Man suit. The people around them would not understand why they would waste their time on such endeavors, but the Maker Space and Faire helped finding like minded people. Some of the micro:bit boards apparently ended in Singapore, and when I say some, I mean 100,000 units. Another thing that I learned is the concept of “digital retreat for kids” where parents send kids to make things with their hands – for example soldering -, and not use smartphone or tablets at all, since they are already so accustomed to those devices.

One I was done with the talk, I walked around, so I’ll report about some of the interesting project I came across. I may write more detailed posts for some of the items lateron.

… ASUS Tinker board to handle fall detection, and an NVIDIA Jetson board for artificial intelligence. If fall is detection an alert to send to the tablet, and the system also interfaces with Xiaomi Mi band 2.

Katunyou has also made a more compact product, still based on Tinker Board, for nursing home, or private home where an elderly may live alone. The person at the stand also organizes Raspberry Pi 3 workshops in Chiang Mai.

I found yet another product based on Raspberry Pi 3 board. SRAN is a network security device made by Global Tech that report threats from devices accessing your network using machine learning.

Click to Enlarge

Nordic Technology House showcased a magic mirror based on Raspberry Pi 3, and a webcam to detect your dance move, but their actual product shown above is a real-time indoor air monitoring system that report temperature, humidity, CO2 level, and PM 2.5 levels, and come sent alerts via LINE if thresholds are exceeded.
One booth had some drones including the larger one above spraying insecticides for the agriculture market.

Click to Enlarge

There was also a large about sewing machines, including some smarter one where you can design embroidery in a table before sewing.

There were also a few custom ESP8266 or ESP32 boards, but I forgot to take photos.

The Maker Party is also a good place to go with your want to buy some board or smart home devices.

Click to Enlarge

Beside Raspberry Pi Zero W / 3, ESP8266 boards and Asus Tinker board seem to be popular items in Thailand. I could also spot Sonoff wireless switch, and an Amazon Dot, although I could confirm only English is supported, no Thai language.

BBC Micro:bit board and accessories can also be bought at the event.

M5Stack modules, and Raspberry Pi 3 Voice Kit were also for sale.

Click to Enlarge

Books are also available for ESP32, Raspberry Pi 3, IoT, etc… in Thai language.

Click to Enlarge

But if you can’t read Thai there was also a choice of book in English about RPi, Arduino, Linux for Makers, IoT and so on. I then attended the second talk of the day: “NB-IoT” by AIS, one of the top telco company in Thailand. Speakers included Phuchong Charoensub, IoT Marketing Specialist, and Pornsak Hanvoravongchai, Device Innovation Manager, among others. They went through various part include a presentation of AIS current M2M business, what IoT will change (e.g. brings in statups and makers), some technical details about NB-IoT, and the company offering for makers.
I’ll go into more details in a separate post tomorrow, but if you want to get started the good news is that it’s now possible to pre-order a 1,990 THB Arduino Shield ($61) between December 6-9, and get it shipped on February 14, 2018. NB-IoT connectivity is free for one year, and will then cost 350 Baht (around $10) per year per device. However, there’s a cost to enable NB-IoT on LTE base stations, so AIS will only enable NB-IoT at some universities, and maker spaces, meaning for example, I would most certainly be able to use such kit from home. An AIS representative told me their no roadmap for deployment, it will depend on the business demand for such services.

If you are lucky you may even spot one or two dancing dinosaurs at the event.

ITEAD Studio recently launched a waterproof enclosure for $2.90 (now at still a decent $3.90), rated IP66, for their family of Sonoff wireless switches, so you can safely use them outdoors protected from rain and dust.

The company sent me one sample together with Sonoff RF switch supporting WiFi and 433MHz RF connectivity so that I can test the case, and write a review describing my experience.

Click to Enlarge

I’ll focus on the waterproof since this is the main focus of this review, and beside Sonoff RF, you can also use Sonoff basic, various other Sonoff boards (POW, TH10/T16), and even other development boards as we’ll seen below. I’ll be using the stock firmware with eWelink app, but if you prefer alternative firmware like ESPurna or Sonoff-Tasmota, you may want to flash it to your Sonoff now.

Click to Enlarge

The waterproog case has two parts, a rubber cord, two waterproof PG7 connectors, and four screws.

PG7 Connector – Loose (left) vs Tightened (right)

The PG7 connectors are comprised of two parts, a rubber washer, and another rubber joint that is squeezed when the top nut is tightened. That design means using round cables will probably give better waterproofness, but it also worked with my not-so-round-cable.

You can either start assembly by connecting the waterproof connectors to the case, or inserting the cables into them. I selected the latter.

Click to Enlarge

There’s very little space in the case for tools, so the first time I used my fingers to hold the inner nuts, and a tool to tighten the ones outside. Finally, it did not work that well, as once I completed the build, water would go inside through the PG7 connectors. So for my second try, I used a precision screw drivers to hold the inner nuts into place while tightening then from the outside of the case as shown above.

Click to Enlarge

We can now connect the cable to the board, and place the latter inside. It’s actually really tight in the box, and I struggled to place Sonoff RF inside the case, but this can be done. We need to press the top button on Sonoff RF to pair the device with the app, so at this stage, I made sure I could control the light with my Android smartphone and eWelink app.

All good. The last step of the assembly is the top acrylic cover. We need to place the rubber cord inside the groove around the cover, and since it’s a bit too long, we can cut it with a few millimeters extra, and push the cord in the groove to make sure there’s no opening.

Rubber cord before cutting.

Tighten the four screws, and the two outer nuts on the PG7 connectors, and perform one more test to make sure we can still control Sonoff RF.
If that’s all good, we can now disconnect our setup from the mains (important step), and insert the case in a bucket of water to check for bubbles, and whether water can enter inside. If I just fully immerse the enclosure, I have no water entering, but if I go a bit deeper, and move the case around, water will go inside. That’s OK, as IP66 only guarantees protection against dust that may harm equipment, and against low pressure water jets, so you should definitely NOT use the case under water, it’s only good against rain and humidity, and should prevent insects from entering the case too.

I’ve shown the latter tests in the video below. At the end, I spray water while the light is on, and water did not go inside at all. If the outside of the case is humid, please do not touch it while it’s connected to the mains (like I did in the video), as it’s not 100% safe to do so.

As discussed earlier, ITEAD Studio can be used with other boards, and while the company provides the exact dimensions in the Wiki, I’ve quickly check whether it could be used with other boards. Sonoff POW is a yes, without the case, and it’s really tight.

ESPino32, a rather large ESP32 board, and NanoPi Duo, are no brainer, and I could even place both at the same time in the case. Other breadboard-friendly boards should fit too, unless they are too long.

If you use the case for alternative use case, you may only need one hole, so you’d have to close the other one. I was unable to find the name of the part required to achieve that… yet.

I’d like to thanks ITEAD Studio for sending the case and device for review. You can purchase the IP66 waterproof case for $3.90 or the full kit with Sonoff RF or Sonoff Basic for respectively $11.10 or $8.75 plus shipping.

ESP8266 powered ITEAD Studio Sonoff wireless switches have been popular because they are inexpensive, highly customizable thanks to work from the community leading to open source projects such as ESPurna and Sonoff-Tasmota, and come fully packaged so you don’t need to make your own case for it.

That works well for indoor projects, but if you needed to control outdoors lights, gate, water pump, etc… you had to protect the device from humidity/rain. That may not be necessary anymore as the company is now selling Sonoff Basic with an IP66 waterproof enclosure for $7.75, or the case only for $2.90.Sonoff waterproof case:

IP66 rating is not suitable for prolonged immersion, but it should be good to protect against rain or high humidity. The box ships with two standardized PG7 waterproof connectors, and is large enough for Sonoff Basic. The enclosure can also be used for the larger Sonoff POW/TH10/TH16/DUAL or G1 switches but you’ll have to take out the board from those devices.

One potential use case is for outdoors Christmas lights, and ITEAD provides instructions just for that explaining how to install Sonoff Basic in the IP66 enclosure, and control an LED light strip. The video below demonstrates the waterproofness of the case.

I’ve already reviewed Sonoff B1 light bulb using the stock firmware combined eWelink app for Android, and as promised in the first part of the review, I’ve also tested the ESP8285 based WiFi light bulb with Sonoff-Tasmota open source firmware, and report my findings in this new post.

Before we can play with the new firmware, we need to install it, and I’ve just explained how to upgrade Sonoff devices to Sonoff-Tasmota firmware either using some soldering skills and a USB to serial board, or some network configuration skills and perform an OTA update using ITEAD Studio/eWelink original firmware update mechanism.

So for this part of the review, I’ll assume we have just freshly update the light bulb with Sonoff-Tasmota using the binary images released by the developer. First, you’ll need to find the IP address of the light bulb with your router or tools like nmap or arp, and access the web interface in your web browser with for example http://192.168.0.108. You’ll probably want to setup a fixed IP address for easier access later on. By default the firmware is set to use Sonoff Basic, but we can go to Configuration->Configure Module, to change that to Sonoff B1, and click Save.

Click to Enlarge

This will reboot the light bulb with Sonoff B1 configuration, and you should be able to turn on the light bulb by adjusting the Color or Brightness sliders, or pressing the Toggle button.

It works with some lag, one or two seconds, just like on the eWelink app. What you don’t get in the current web interface is the ability to adjust RGB values, so only the white lights can be controlled easily. More on RGB control later. You’ll also lose timer and schedule ability from the web interface, because that’s more of a task for your home automation server using either MQTT or Domoticz whose options are available in the Configuration menu as shown below.

Other menus in the configuration include reset/backup/restore configuration, logging parameters, and other parameters such as Belkin Wemo or Hue Bridge emulation. If we go back the back to the main menu, we have some more buttons beside Toggle and Configuration such as access to the console, which you can use to monitor the output log, and send various commands, including ones to control the RGB lights. For example, I could set to the light to green with the command “Color 00FF000000”, since for Sonoff B1 they use hexadecimal values for Red, Green, Blue, Warm White, and Cold White. You can also use those commands over serial, MQTT, and a web API. For the latter the command

Shell

1

http://192.168.0.116/cm?cmnd=Color%20FF00000000

will set the color to red, and return:

Shell

1

RESULT={"POWER":"ON","Dimmer":100,"Color":"FF00000000"}

Other options include Information with a complete overview of most parameters…

Click to Enlarge

Firmware Upgrade to do so either from an update server, or a local file, and Restart to reboot the device.

Click to Enlarge

Sonoff B1 with ITEAD Studio’s stock firmware and eWelink app is pretty much plug and play, and you can control multiple lights from one app, configuring the white and RGB lights, and setting timers and schedules, all right from your smartphone. The downsides are that it requires the Internet to communicate with the cloud service, the firmware and app are both fully closed source so you can’t add features or easily integrate it with your home automation system using standard protocols such as MQTT or a REST API. It does integrate with Amazon Alexa or Google Home however.

Going the open source firmware route is more a hack-flash-configure-get confused-setup-learn-and-play solution. Once you have overcome the steps to upgrade firmware to Sonoff-Tasmota, it’s not at all convenient to control your devices from the built-in web interface, especially if you have many. The firmware has really been designed to use with an home automation gateway like Domoticz, where you can manage with your lights or switches from a single web interface. So you’d have to setup your gateway, and you’ll likely get an Android app with it to do something like eWelink app, except you’ll have much more flexibility. You can get a bunch of lights to change colors in sync with your music (likely with a short delay), turn them on when motion and low light conditions are detected, or when specific persons are detected using face detection, etc.. The limit is only your imagination, and willingness to learn new skills.

I’d like to thank ITEAD Studio for sending a review sample. If you are interested, you can purchase the light bulb directly from them for $18 plus shipping. It can also be found on sites like Amazon US or Banggood.

This post was initially supposed to be part 2 of Sonoff B1 light bulb review, where I would have explained how easy it was to use OTA mechanism to update to Sonoff-Tasmota open source firmware, and shortly show about its features and capabilities. However, it took me over 10 hours to make that work, mostly due to misunderstand in the documentation, and time spent to configure routers. I also failed the first time with Sonoff B1, so I used the serial console method, and instead managed to use SonOTA method with Sonoff POW switching from stock firmware to Sonoff-Tasmota without having to solder or tear down anything.

Updating software with a USB to Serial Board

Using a USB to serial board is the most common method to switch from stock firmware to open source firmware such as ESPurna or Sonoff-Tasmota in Sonoff devices or other ESP8266 based devices. It’s quite straightforward with Sonoff switches like Sonoff TH16.

Click to Enlarge

You just need to solder a 4-pin 2.54mm pitch header, connect the board, and use esptool to flash the image. One it’s done you can simply remove the wire, leave the header in place, and put the case back in place. But with Sonoff B1 light bulb, it’s quite as easy. First there are no through holes in the board, and you need to solder up to 6 wires on small solder pads.

Click to Enlarge

The GND, Tx, Rx, and 3.3V must be soldered and connected to the USB to serial board, while GPIO0 must be shorted to enter programming mode, so I also added two more wires for GPIO0, and an extra GND pin.

Click to Enlarge

Important warning: Never connect the serial board and AC/mains at the same time. Your equipment and life may be at risk.

Now we can download the latest version of the firmware, install esptool, connect the USB to serial board to your computer – which will also provide powered to the board -, and run esptool to flash the firmware:

Most products on the market defaults to access point mode when they are first booted, but Sonoff-Tasmota’s developer have instead decided to provide pre-built image in client mode connecting to a default access point with SSID: indebuurt1 ; password: VnsqrtnrsddbrN. That’s a bit of a pain, as you need to configure another router with those credentials, before changing it to your home router. An alternative way is to build some source, and change the default AP settings, so the device can connect right away after flashing. Still, I’d wish an image that default to AP mode would be nice. It’s actually not a problem for most Sonoff devices, as you can switch to AP mode with the button (4 short presses), but Sonoff B1 does not have one.

Now imagine you have a dozen or more of Sonoff B1 light bulbs that need to be update to Sonoff-Tasmota. That would be a real pain to solder and unsolder the required wires for each bulbs. One solution is to create a jig with pogo pins for firmware update, as the one shown below specifically designed for AI Light. You just need to pop out the bulb, click the jig, flash over serial, remove the jib, refit the bulb, and you’re done.

I don’t know if one exists for Sonoff B1, but the jig above could certainly be customized to work with it.

SonOTA – Sonoff OTA Firmware Update Method

However, in an ideal world you’d prefer not to mess with the hardware at all. If only ITEAD Studio provided a way to upload custom firmware with their stock firmware that’d be ideal, but it’s not the case right now. Luckily, the OTA mechanism was reverse-engineered, and SonOTA is an (experimental) implementation that allow to flash alternative firmware to Sonoff devices without altering the hardware or needing special jigs.

The method on Sonoff-Tasmota wiki does not work on Sonoff B1 because there SSID is not advertised in pairing mode, but somebody in github had managed to update one light bulb using DNS spoofing. Since I used the first method with Sonoff B1, but only partially managed to make it work, I switched to Sonoff POW, and succesfully tested the DNS spoofing method. Several items are required, so I’ve drawn a diagram showing how those interact.

The Home Router is just the WiFi router you’d normally use to access the Internet

The smartphone with eWelink is requirement to configure WiFI on the Sonoff device, and update it to the latest stock firmware version. It can also be used to easily check access points.

“Temporary” Router with DNS spoofing will make sure xx-disp.coolkit.cc redirect to your laptop/computer running SonOTA, so it takes over when Sonoff device tries to update the firmware. It still needs to be connected to the Internet.

Sonoff device – The device we want to update

Potentially, you could combine the router, router with DNS spoofing, and WiFi laptop into one device, if you have a Debian based router, but I still separate all three in my case, since home router does not support DNS spoofing, and I failed to install SonOTA on the temporary router.

The very first step is to pair the Sonoff device with eWelink app, connect it to your home router, and update the firmware to the latest version, in my case 2.0.4.

Click to Enlarge

Now you can configure your temporary router to use DNS spoofing. I did not have any spare router with such feature, so I instead used VS-RK3399 board with Debian, and configured it as a router with hostapd, and isc-dhcp-server using those instructions. This part will heavily depend on your router, and whether you use Debian, or other Linux distributions. For reference, here are some of the main configuration files I used:

/etc/hostapd/hostapd.conf

Shell

1

2

3

4

5

6

7

8

9

interface=wlan0

driver=nl80211

ssid=VS-RK3399

channel=1

wpa=3

wpa_passphrase=1234567890

wpa_key_mgmt=WPA-PSK

wpa_pairwise=TKIP

rsn_pairwise=CCMP

/etc/network/interfaces

Shell

1

2

3

4

5

6

7

8

# interfaces(5) file used by ifup(8) and ifdown(8)

# Include files from /etc/network/interfaces.d:

source-directory/etc/network/interfaces.d

auto wlan0

iface wlan0 inet static

address10.10.0.1

netmask255.255.255.0

/etc/dhcp/dhcpd.conf

Shell

1

2

3

4

5

subnet10.10.0.0netmask255.255.255.0{

range10.10.0.210.10.0.16;

option domain-name-servers10.10.0.1,208.67.222.222;

option routers10.10.0.1;

}

The next step was to configure DNS spoofing. I first went with dnsmasq, and I could successfully confirm it worked with dig, but for whatever reason Sonoff B1/POW would still connect the ITEAD server. Finally I tried with dnsspoof, and it worked OK. Installation in Debian:

DNS spoofing took me the most time, as beside restarting service in the router itself, you have to restart the devices connected to it to reflects the changes. I also messed with /etc/hosts file in the router and laptop, but it should not be necessary, as the important is to fool the Sonoff device.

Let’s switch the WiFi laptop configuration. It should work with both Linux and Windows, but mine is running Ubuntu 16.04, so that’s what I used. Let’s create a working directory, get SonOTA code, and install all required libraries and tools.

Shell

1

2

3

4

5

6

7

mkdirsonoff

cdsonoff

git clonehttps://github.com/mirko/SonOTA.git

cdSonOTA

sudo apt install python3-pip

sudo pip3 install--upgrade pip

sudo pip3 install-rrequirements.txt

Now we’re ready for the update. Launch SonOTA script in legacy and no provision modes:

Shell

1

sudo./sonota.py--legacy--no-prov

This will first ask you to select the WiFi interface, and enter your SSID and password, and start probing for the Sonoff device:

Shell

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

Select IP address of the WiFi interface:

0:10.10.0.4

Select IP address[0]:

WiFi SSID:VS-RK3399

WiFi Password:12345667890

Using the following configuration:

Server IP Address:10.10.0.4

WiFi SSID:VS-RK3399

WiFi Password:12345667890

Starting stage2...

~~Starting web server(HTTP port:8080,HTTPS port443)

~~Waiting fordevice toconnect

***IMPORTANT!***

**AFTER the first download isCOMPLETE,with inaminute orso you should connect tothe newSSID"FinalStage"tofinish the process.

**ONLY disconnect when the new"FinalStage"SSID isvisible asan available WiFi network.

Thisserver should automatically be allocated the IP address:192.168.4.2.

Ifyou have successfully connected to"FinalStage"andthisisnotthe IP Address you were allocated,please ensure no other device has connected,andreboot your Sonoff.

..........

Delete your Sonoff device in eWelink app, and restart pairing, this time connecting it to your temporary router with DNS spoofing enabled, and shortly after the SonOTA script should start to transfer the image to the device:

Shell

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

291

292

293

294

295

296

297

298

299

300

301

302

303

304

305

306

307

308

309

310

311

312

313

314

315

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

331

332

333

334

335

336

337

338

339

340

341

342

343

344

345

346

347

348

349

350

351

352

353

354

355

356

357

358

359

360

361

362

363

364

365

366

367

368

369

370

371

372

373

374

375

376

377

378

379

380

381

382

383

384

385

386

387

388

389

390

391

392

393

394

395

396

397

398

399

***IMPORTANT!***

**AFTER the first download isCOMPLETE,with inaminute orso you should connect tothe newSSID"FinalStage"tofinish the process.

**ONLY disconnect when the new"FinalStage"SSID isvisible asan available WiFi network.

Thisserver should automatically be allocated the IP address:192.168.4.2.

Ifyou have successfully connected to"FinalStage"andthisisnotthe IP Address you were allocated,please ensure no other device has connected,andreboot your Sonoff.

**AFTER the first download isCOMPLETE,with inaminute orso you should connect tothe newSSID"FinalStage"tofinish the process.

**ONLY disconnect when the new"FinalStage"SSID isvisible asan available WiFi network.

Thisserver should automatically be allocated the IP address:192.168.4.2.

Ifyou have successfully connected to"FinalStage"andthisisnotthe IP Address you were allocated,please ensure no other device has connected,andreboot your Sonoff.

..........

Now you should be able to use your smartphone or the laptop to connect to FinalStage access point, start a browser to access http://192.168.4.2. You should see the interface below, click on scan for Wifi network, and select the one you want to replace indebuurt1 SSID, in order to connect to your “home router”.

Click to Enlarge

Click on the button Save on the bottom of that page, and after a while you should be able to access Sonoff web interface into your home network

Output log of SonOTA.py script for that last step:

Shell

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

***IMPORTANT!***

**AFTER the first download isCOMPLETE,with inaminute orso you should connect tothe newSSID"FinalStage"tofinish the process.

**ONLY disconnect when the new"FinalStage"SSID isvisible asan available WiFi network.

Thisserver should automatically be allocated the IP address:192.168.4.2.

Ifyou have successfully connected to"FinalStage"andthisisnotthe IP Address you were allocated,please ensure no other device has connected,andreboot your Sonoff.

......

The"FinalStage"SSID will disappear when the device has been fully flashed andimage_arduino.binhas been installed

The"FinalStage"SSID will disappear when the device has been fully flashed andimage_arduino.binhas been installed

Once"FinalStage"has gone away,you can stop thisprogram

No longer on"FinalStage"SSID,all done!

2017-10-0319:46:27,920(INFO)Quitting.

Success! Finally… Now you can configure Sonoff-Tasmota to use your actual device – in my case Sonoff POW – instead of Sonoff Basic. I’ll show a bit more about that while testing Sonoff B1 with Sonoff-Tasmota in an upcoming post. Whether you choose between the serial or OTA method will depend on the number of devices you have to update, and/or whether you prefer soldering or messing around with network settings. If you are after maximum efficiency for a large number of Sonoff B1 light bulbs, then a jig with pogo pins should be by far the fastest way to reflash them all.

ITEAD Studio has a popular family of home automation devices call Sonoff with WiFi switches, smart sockets, RF to WiFi bridges and so on. All WiFi devices are based on Espressif ESP8266 or ESP8285, and while the company provide a stock firmware working with eWelink app, at least two communities have formed around Sonoff and other similar devices providing two open source firmware alternatives: ESPurna and Sonoff-Tasmota.

The company has sent me Sonoff B1 smart RGB light bulb for review. Today, I’ll check out the light with eWelink app for Android, and do a teardown, before trying one of the open source firmware in the second part of the review.

Sonoff B1 Unboxing

Some Chinese products come in a blank cardboard boxes, but Sonoff’s light bulb comes with in a nice looking retail package that would look good on store’s shelves.

Click to Enlarge

One of the side lists the specifications with an E27 base, 6W LED, WiFi support etc,, and a quick setup guide. It also mentions the light bulb can be controlled with Amazon Alexa and Google Assistant / Nest.

Click to Enlarge

The light bulb is securely packed in a polyethylene foam, and is highly unlikely to break during transport.

A user manual in Chinese & English is included together with a “Quality Control Passed” card.

Click to Enlarge

Sonoff B1 with eWelink App

I’ve already reviewed Sonoff TH16 switch with eWelink App, and Sonoff B1 works the same way. Download the app for Android, or iOS, register an account, and click the + icon to add a new device. Sonoff B1 must then be put into pairing mode, but turn it off and on, three times, after switch it could blink and dim regularly. Click next, connect to your router, and you should be done. I’ve shot a short demo in the video below.

Once in the app you can control the white light with warm to cold, and brightness settings… If you’ve watched the video above, you’ll have noticed a 1+ second delay between the selected value in the app, and the actual change in the light, so the app must use the cloud instead of direct access to the home network.

Click to Enlarge

and the RGB lights with a color wheels.

Click to Enlarge

The white lights are quite brighter, but not bright enough to light up a room. It’s more suited as a bed light for reading, or outdoor for a romantic atmosphere like you;d get in bars or restaurants, similar – yet brighter – than candles lights. RGB lights are not bright at all.

Green is the New Orange

The photo above has been taken at night, and you’ll also notice the color selected on the phone does not also quite match the color set in the app, as I was expected an Orange light, but I got some pale green light instead. It also quite difficult to select specific colors with the wheel, as I could only get variation of pink when wanted to get a red light. The only way I found was to switch between White and Color menus, and it will automatically set it to red.

It’s not quite obvious on the photo above, but you should see three dark dots on the top of the light when using the color mode. That’s normal, as we’ll see below, and is due to the shadow of the WiFi antenna. Beside White and Color menus, there are 4 pre-defined color scenes for reading, resting, etc…, as well as a time / sleep function…

Click to Enlarge

… and schedules that can be setup once, or repeated on any given day of the week.

Click to Enlarge

The share function is use to also another phone to control the light.

Sonoff B1 Teardown

I could not take out of the bulb with my bare hands, so I used a rigid plastic tool, and it came off easily.A close up on the board reveals 3 RGB LEDs and the antenna in the middle that explains why we have three dots in RGB mode. There are also two pairs of eight white LEDs respectively used for warm or cold whites.

Click to Enlarge

We can see GND, Tx, Rx, and 3.3V that can be used to upgrade firmware, as well as GPIO0 and SDA pin in the top right of the inner circle PCB. A close up on the board shows the circuit is controlled by Espressif ESP8285 SoC.

We can also loosen the top and bottom of the “heatsink” part to access the power supply that’s protected with some black plastic cover.

Click to Enlarge

Teardowns are fun, but once I put everything back together nothing worked. I also managed to the short the mains resulting in some burned parts of the cable I used for with the E27 bulb holder. Thge light seemed OK, but it would always show offline. I try to re-enter pairing mode but no luck. I then check if I would get 220V to the bulb holder with a multimeter (yes), and then whether I would get 5 or 12V – both are exposed on the PCB – and nothing there. I finally checked the power supply connections only to find out the red cable had come off…The plastic does not come out easily, so instead I cut it out to expose the pin, inserted the wire back, added some solder, and finally some hot glue to cover the joint. The 6W LED does not get hot at all, so it should not be a problem.
It worked again, and I took a picture of the lamp without the three RGB LEDs set to red.

I’d like to thank ITEAD Studio for sending a review sample. If you are interested, you can purchase the light bulb directly from them for $18 plus shipping, but it is also available on sites like Amazon US or Banggood. As mentioned in the introduction, the next step will be to flash an open source firmware. So far, I’ve been using ESPurna, but the developer has already published a review of Sonoff B1 with ESPurna, so this time around, I’ll give a try with Sonoff-Tasmota that also supports Sonoff B1.

I spent very little time with the stock firmware on the device. I don’t like the fact that an Internet connection is needed, and I am not in control. As of the time of this writing I found the Ewelink was not configurable enough to meet my needs. There is one feature that is really nice that I could easily see keeping stock firmware. It is the Alexa Skill. It worked. I am also currently reviewing Vobot Smart Alarm Clock with Alexa integration and had no trouble controlling the Sonoff devices with Alexa. But unfortunately I am lazy and want everything automatic so I can’t keep it. With the RF bridge I was unable to trigger a light from a motion sensor. In comes Arendst ‘s Sonoff-Tasmota firmware to the rescue. It gets better all the time. It is dead simple, and so configurable now. He continues to add features and devices.

RF Bridge

You may have seen my previous article building a 433toMQTTto433 bridge to use cheap 433mhz devices. I never did build a case for it, and it’s a little bit of an eyesore. When I found out about a nicely packaged one, I was excited to check it out. Like I stated previously, it didn’t work as I anticipated and was glad when I found out Arendst got one as well. He has a good wiki with on the github page and all the needed information to flash and configure so I won’t go into it. It flashed uneventfully. I was a little scared by the design that it was only going to be able to receive 16 individual codes and pass onto MQTT but that is not the case. It passes everything it receives. You can only send 16 different codes right now which need to be saved ahead of time. So after monitoring the MQTT server I ran into first hurdle. I was getting this example json value.

And actually I found after much frustration that “Data” is a nested json value. This took a while for me to figure out. After that it was relatively easy to parse in Home Assistant and move my automations over from the previous bridge.

YAML

1

2

3

4

5

6

7

8

9

10

11

- alias: Living Room Tamper

hide_entity: true

trigger:

platform: mqtt

topic: tele/sonoffrfbridge/RESULT

condition:

condition: template

value_template: '{{trigger.payload_json.RfReceived.Data=="982817"}}'

action:

service: homeassistant.toggle

entity_id: light.living_room

and

YAML

1

2

3

4

5

6

7

- platform: mqtt

name: "Living Room Motion"

payload_on: "98281B"

payload_off: "9971736"

sensor_class: motion

state_topic: "tele/sonoffrfbridge/RESULT"

value_template: '{{value_json.RfReceived.Data}}'

From the previous article payload off is a made up value and is only used internally to turn the sensor off after a minute.

Just a couple gripes about the rf bridge which are superficial. There is a noticeable increased delay over the homemade bridge from the time it senses a trigger until the light comes on. It is only about half a second but a noticeable difference. And my wife pointed quickly that the led indicating it is on is very bright. I might remove it or install a varistor to tone it down. The receiver does not appear to be as good or might just be that it is in a case or my positioning. I am still able to cover my house but the trigger on my mailbox across the street doesn’t trigger. It was hit or miss on the old one but never triggers now.

FYI I am still running off the same batteries I initially installed in the 433mhz motion sensors over 6 months ago.

Sonoff 4ch Pro

I tested it with stock Ewelink software and all tests done before worked. I quickly installed the alternative firmware from above, and again no loss in functionality. I was still able to pair and clear the 433 MHz remotes. It is weird that it does not indicate with a light that it is in pairing mode as of right now but when you press the button the light blinks when it is learned. The inching, self locking and interlock continued to work as well via switches. I can definitely see this being used for lighting, or if you needed to control multiple items in close proximity. Maybe simple access control. Possibilities are endless. On the product page, it shows wiring with motors as well which looks cool. If I find a unique or interesting project I will share.

The 4 button transmitter is very powerful. It transmits further than any of my other 433mhz devices.

Sonoff POW

Click to Enlarge

A buddy of mine gave me a Sonoff POW to play with. The Sonoff POW is very similar to the Sonoff Basic, but has the ability to measure power usage. I didn’t bother testing the stock software. I went straight to Arendst software. I didn’t have anything to measure power before and this is a welcome addition to my tools arsenal. I don’t need super accurate readings just a good idea what the draw is. I installed a light rated at 75w to test and got the results below. If a more accurate load is available you can calibrate the POW and instructions are in the Wiki.

OTA Firmware

Who wants to drag all their devices back to the PC and flash new firmware? I finally checked it out. It is really simple to do.

First uncomment BE_MINIMAL then export compiled Binary. After a while you will have a bin file in your sketch folder.

Click to Enlarge

After uploading comment BE_MINIMAL, upload again. The 2 steps procedure is because he is running out of space with all the features. He is trying to reduce the code down, and hopefully make this a single step in the future. If you have a web server there are instructions to automate this.

Conclusion

I would like to thank Itead Studio for sending the Sonoff RF Bridge, 4ch Pro and 4 button 433 MHz transmitter. They keep expanding their Sonoff line and make them hacker friendly. I would also like to thank Arendst for his tireless work on Sonoff-Tasmota firmware. If you are just looking to control your lights via Alexa, and don’t mind requiring the Internet to be available the stock firmware might work for you.