Monday, April 20, 2015

First IoT device - Plug

Because was raining outside and I couldn't work in the backyard, I've made rapidly an IoT plug with ESP8266 .

Donor for the case was a timer plug that was in the house. After I've removed its content, I've added my stuff.

IoT plug
Inside the case I have:

  • power supply (220V-3v3 1A)
  • 5V relay ( is working fine on 3.3 V)
  • ESP-01 covered in blue tape 
And the final IoT plug:

IoT final plug



The ESP-01 is accepting JSON over MQTT from my mosquitto broker. 

To control the plug from my phone, I've created an android application that connects over
websockets to mosquitto broker and is sending commands. 

Plug is sending status every 15 seconds to its subscribers and a status after every command its receiving.

Cool.....now I can turn on or off  my  lamp with my IoT device. 

For Android application I've used for rapid development a template, but I am planning to build a totally new application that will discover the IoT devices and add them automatically to the control screen.



IoT Plug application
EDIT: The Android application is different now. See this post.

And a video:











Tuesday, April 7, 2015

Post man #4

To extend the range ( which seems to be fine for my project at this time) I've ordered some 
19 cm mini PCI U.FL to RP-SMA WiFi Antenna Cable. My plan was to reuse the antenna from NRF240L01P modules but I didn't checked the connectors. 


SMA U.FL wifi antenna cable and antenna from NRF24L01



Murphy's law is applicable also in this case, so as you can guess they don't match. So the new antennas are on their way also.


I've received also the BMP180 sensors ( replace the old BMP085 version). 
  • Pressure sensing range: 300-1100 hPa (9000m to -500m above sea level)
  • Up to 0.03hPa / 0.25m resolution
  • -40 to +85°C operational range, +-2°C temperature accuracy
  • This board/chip uses I2C 7-bit address 0x77


BMP180 sensor bag

The sensor and its board is very small, which is great. 

So I have temperature and humidity from DHT22, pressure from BMP180, I can now predict the weather for my irrigation platform. 

Tuesday, March 24, 2015

Quick Notes #1

In the latest SKD 1.0.0 I've seen an interesting function:

system_update_cpu_freq

Function:  Set CPU frequency. Default is 80MHz.

Prototype:

bool system_update_cpu_freq(uint8 freq)

Parameter:

uint8 freq : CPU frequency
#define SYS_CPU_80MHz     80
#define SYS_CPU_160MHz 160

Return:
true:  succeed

false: fail

which is nice, you can double the speed.

Post man #3


From time to time you will need to check the signal on some pins. For that I've recommend you a logical analyzer like this one from banggood.com  (affiliate link)


Specs:


Sampling rate up to: 24 MHz
The logic for each channel sampling rate of 24M / s. General applications around 10M, enough to cope with a variety of occasions.

8-channel:
Logic eight inputs - can be collected at the same time they signal analysis, such as I2C, UART, sampling and analysis.

10 billion samples:
The logic can sample up to 100 100 million everything, so you capture even the most elusive events.

Voltage range:
0.8V logic: 5V voltage, to accept the 5.25 V standard CMOS threshold logic low. 2.0 V logic high. The input impedance is approximately 1 MΩ to see more specificati$

Protection:
Support for the latest version: 1.1.30 version

Note:

You can also download the driver from the link:
www.mcu123.com/product/saleae/Saleae_24M_CD.RAR
Software for learning www.saleae.com doesn't do any other purposes.

Package included:

1 x 24M 8CH logic analyzer
10 x Color DuPont line (10 different color)
1 x USB-MINI line 1

Wires left floating sometimes produce garbage data, so if, say you're only using 4 of the data lines, tie the other 4 to ground so they will show as 0 in the program

Analyzer connected to a PIR sensor

After I've installed the 1.1.15 version for 64 bits and quickly connected a PIR on DCH0 I was able to see the signal in application. Off-course,  this analyzer can do more than that, but it was a quick check to let the shop know that the product is working. 

Saleae 1.1.15 connected to a PIR

New SDK version ( 1.0 )

Espressif the producer of the ESP8266EX chip has announces availability of a new SDK.

If you want to download the latest SDK click here.

So, current version now is 1.0.

Fix bugs:
1     Interrupt during flash erasing will cause wdt reset;
2     Read/write rtc memory;
3     If router disconnect to ESP8266, ESP8266 won’t reconnect;
4     Connect to router which has its SSID

Add APIs:
1 system_update_cpu_freq: change CPU frequency;
2 wifi_promiscuous_set_mac: set a mac address filter during sniffer;
3 wifi_set_broadcast_if : set which interface will UDP broadcast send from;

Optimization:
1 Optimize smartconfig to version v1.0;Please don't call any other APIs during SmartConfig.
2 Optimize AT to version 0.22.0.0;
3 Optimize the protection of system parameters , and add error-check about it;
4 Optimize beacon delay of ESP8266 softAP;
5 Optimize boot to version 1.3(b3);
   5.1 Add API system_restart_enhance: for factory test, support to load and run program in any specific address;
   5.2 Add APIs to get boot version and start address of current user bin;
   5.3 Fix compatibility problem of dual flash;
6 Optimize sniffer, structure sniffer_buf changed, please refer to document;
7 Optimize espconn;
8 Optimize pwm;
9 Other optimize to make the software more reliable;


Espressif will give  a minimum of 200 USD for any developer reporting a previously unknown bug in latest Version 1.0. For more info on bug bounty program click here.