Monday, March 6, 2017

MicroPython on ESP8266: sending data to ThingSpeak

Here is a tutorial about using MicroPython on ESP8266. The post describes how to use MicroPython to measure temperature and humidity, and send data to ThingSpeak.

MicroPython on ESP8266: sending data to ThingSpeak

MicroPython on ESP8266 with DHT22 and ThingSpeak

Saturday, March 4, 2017

Problems with running MicroPython on ESP8266 with 512K

The post below describes a couple of problems you may run into if you use MicroPython on ESP8266 boards which have less than 512K of flash.

Problems with running MicroPython on ESP8266 with 512K


Monday, February 27, 2017

How to list files in a directory with Java 8

Here is how it can be done with older Java versions:

File folder = new File("path/to/dir");
File[] files = folder.listFiles();
for (int i = 0; i < files.length; i++) {
    if (files[i].getName().endsWith("txt")) {
        System.out.println("File found: " 
                + files[i].getName());
    }
}
You might also use for-each loop which would make it nicer. Now we have streams in Java 8:

Files.list(Paths.get("path/to/dir"))
    .filter(file -> file.toString().endsWith("txt"))
    .forEach(file -> {
        System.out.println("File found: " + file);
    });

It doesn't look shorter (although you can write it in one line, and still be able to read it), but no loops and ifs.

There is one disadvantage in the approach with streams (or, at least one). If something throws a checked exception in forEach(), then you'll need to catch it there. You can't add a "throws" statement to the method which contains this code - the Java compiler will complain about that.

Enjoy.

Friday, February 17, 2017

Getting started with ESP8266 and MicroPython

Here is a tutorial about running MicroPython on ESP8266 board. The article contains step-by-step instructions about flashing ESP-07 with MicroPython, and running the standard "Hello World" project for microcontrollers - driving an LED.

Getting started with ESP8266 and MicroPython

Tuesday, January 17, 2017

Fuzzing GUI applications: AbiWord

It's relatively easy to run fuzzing for a headless application. A headless application doesn't have any GUI, and can be simply run in a terminal. You can use your favorite fuzzer, and feed fuzzed data to the application. Normally, a headless application just processes data, and then quits or crashes right away. But it may be a little different if you are trying to run fuzzing for an application with GUI. This blog post explains how to run fuzzing for AbiWord - an open source text editor.

Read more about Fuzzing GUI applications

Sunday, January 15, 2017

Quick fuzzing of MessagePack

MessagePack is a serialization protocol. It has an implementation on C/C++. Let's check if it has any memory corruption issues. We'll use American Fuzzy Lop and AddressSanitizer for it.

More about MessagePack fuzzing

Thursday, December 1, 2016

How to send a text command to STM32 with USART

This article describes how a string can be send to STM32 microcontroller with USART. It contains a simple code example which shows how to drive an LED by sending text commands from a laptop to STM32 board. Enjoy!

Read more about sending text to STM32 microcontroller.