IoT Archives - Falafel Software Blog

Read/Write data from/to USB thumb drive on a Windows IoT Core device

By | .NET, Blogs, C#, Fun, IoT, Microsoft, Multi-Device, News, Raspberry Pi, Visual Studio, Windows Universal Apps | One Comment

Currently, universal apps are sandboxed to the point of blocking you from reading/writing data files to a removable USB drive on Windows IoT Core devices. This post will show you a work around if you really need to do this. Now, understand that this is not for store apps. If you submit an app using this work around, it will likely get rejected. However, for internal projects, it will definitely work, and work well. This is a great way of reading application initialization data and writing log data in a test apparatus and laboratory setting. Particularly when a network or…

Read More

C# Windows IoT Core Serial Communications with an ESP8266

By | Blogs, C#, ESP8266, git, Hardware, IoT, Microsoft, Multi-Device, News, Raspberry Pi, Visual Studio, Windows Universal Apps | No Comments

Windows IoT Core is great for connecting single board computers such a Pi2 to an ESP8266, via a serial link. The hardware for such a link can be found in my previous post here. The details for a basic serial communication C# framework are detailed in this post. If you have an ESP8266, there are numerous ways of communicating with them such as LuaLoader. However, I needed to communicate with my ESP8266 through a Pi2 running Windows IoT Core. This is part of a larger automated test project for an upcoming consumer project we’re developing. In this post, I’ll cover…

Read More

How to Build the NodeMCU Firmware using BoUoW

By | ESP8266, IoT, Linux, Windows | No Comments

This is post 13 of 13 in the series “IoT with the ESP8266” The Windows 10 Anniversary Update includes the Windows Subsystem for Linux, as I had mentioned in a previous post. The Bash shell (succinctly named “Bash on Ubuntu on Windows”, or BoUoW if you’re actually trying to search for information) permits native Linux ELF64 binaries to run on Windows. It’s pretty clever, but a little limited in areas. So, I wondered: since Linux is the preferred first-class build environment for ESP8266 firmware, can I build the NodeMCU firmware using BoUoW? Let’s find out! First, you will need to activate the feature and install BoUoW….

Read More

Add A Small LCD Display To Your Raspberry Pi

By | IoT | One Comment

Recently, I needed to put together a Raspberry Pi-based solution to run a Node.js app. I didn’t need Windows IoT Core or X-Windows – just a Linux TTY would do. But, I also wanted to include a LCD display to eliminate the need for a HDMI monitor.  Was it possible? Selecting and Configuring Display Hardware A quick search of the internet reveals many 3.5 inch screens for the Raspberry Pi. In fact, there are many different screen sizes available, but the 3.5 inch matches the footprint of the Pi itself. These are typically TFT displays with an SPI interface that plug into the Pi’s…

Read More

Quick serial clip connector for your multiple IoT PCBs

By | Blogs, ESP8266, IoT, News | No Comments

You don’t need a fancy USB serial connector for your multiple IoT PCBs. It’s easy to create your own quick and inexpensive connector. This is an example of a simple quick-connect serial clip that can connect a PCB- mounted ESP8266 to a computer via USB. If you don’t want the expense or bother of soldering on a fancy USB connector to your many IoT PCBs for flashing and/or programing your ESP (or other) device, you have options. I worked out an easy, cheap, and reliable method of making a quick short-term connection. You need a few things. Some parts you…

Read More

Traveling with Wi-Fi IoT Devices

By | Hardware, IoT | No Comments

These days, a lot of Wi-Fi IoT devices are intended for use in your home where there is typically only a single Wi-Fi access point. You set up the device one time, and then as long as the SSID and password never changes, the device will just continue to work. But, taking that same device on the road can prove to be a challenge. Add a hotel or conference center wireless network into the mix, especially one with a Captive Portal, and it can be next to impossible to get the device onto the internet. I have started using a travel router with…

Read More
Adafruit BMP280 sensor: https://www.adafruit.com/products/2651

A Simple IoT Project using NodeMCU

By | IoT | No Comments

This is post 12 of 13 in the series “IoT with the ESP8266” At a recent conference, I showed a simple demo for the ESP8266 using NodeMCU. This demo connected to Wi-Fi, synchronized the time with an internet time server, and then read temperature and air pressure from a sensor every 5 seconds and published the values to a MQTT broker. It was essentially a fully functional IoT solution (minus a lot of the exception handling and compensation that a more polished app would include). For the temperature and barometer, I used a BMP280 sensor available on a small board from Adafruit that…

Read More

How to Set the Current Datetime with NodeMCU

By | IoT | One Comment

This is post 11 of 13 in the series “IoT with the ESP8266” When the ESP8266 starts up, the Realtime Clock (RTC) is not initialized. If your IoT project has the need to provide timestamps in its generated data, then your code will need to fetch the current datetime from a server after the network is available. One way to do this with NodeMCU is to use the sntp (Simple Network Time Protocol) module in conjunction with the rtctime module. The sntp module will fetch the time from a specified time server (could be on your LAN, or from an official source on the internet) and…

Read More

ESP8266 and Wi-Fi Channels

By | ESP8266, IoT | 2 Comments

This is post 10 of 13 in the series “IoT with the ESP8266” The ESP8266 supports operating as a Wi-Fi station (station mode), an access point (softAP mode), and can even do both at the same time (softAP+station mode). However, there is one important detail that must be understood or else it will come back to bite you: the radio in the ESP8266 only supports one hardware channel at a time. What does this mean? Well, 802.11b/g/n operating on 2.4GHz has 14 different channels that can be used (though, in North America, we can only use channels 1-11 due to…

Read More

ESP8266/NodeMCU Deep Sleep

By | ESP8266, IoT | 8 Comments

This is post 9 of 13 in the series “IoT with the ESP8266” Sometimes, an IoT device will perform small chunks of work, and then will otherwise be idle. For instance, a weather station with sensors for temperature, pressure, and humidity (such as the BME280) may only need to take a reading every 15 minutes and broadcast to the cloud – something that requires 10 seconds to accomplish. If the device is powered by a battery, then you want it to enter a deep sleep state in between the work cycles in order to maximize battery life. But, how would you force an ESP8266 to…

Read More

Azure EventHub – Getting your device data to the cloud

By | Azure, IoT | No Comments

This is post 15 of 29 in the series “A Cloudy 29 Days of Microsoft Azure” Sticking with my IoT theme for this Azure blog series, I am going to show you how to use the Azure EventHub to write data to the cloud. In my previous post, Azure IoT Hub – Connecting your device to the cloud with MQTT, I talked about leveraging Azure IoT Hub which is also a great mechanism to write your IoT Data. In this post I am going to show how to use an http mechanism to write data to the Azure Service Bus…

Read More
Breadboard Diagram

Azure IoT Hub: Managing and communicating with IoT devices

By | Azure, C#, Hardware, IoT, Microsoft, Raspberry Pi | 3 Comments

This is post 13 of 29 in the series “A Cloudy 29 Days of Microsoft Azure” Officially declared Generally Available (GA) on February 3rd, 2016, the Microsoft Azure IoT hub aims to help ease the software development burden by providing foundational tasks when it comes to building an Internet of Things system. With device provisioning, monitoring, management and system updates provided by the Azure IoT Hub, you are free to concentrate on coding your device’s core functionality. Another alluring aspect of Azure IoT Hub is that there is a free tier that allows an account to provision and maintain up…

Read More

Programming GPIO on the ESP8266 with NodeMCU

By | ESP8266, IoT | 9 Comments

This is post 8 of 13 in the series “IoT with the ESP8266” IoT devices (a.k.a., Things) aren’t very interesting if they cannot interact with the world around them. As Makers, we need to hook up sensors, light up LEDs, and communicate with other devices that are wired up to our Things. To do this, we need IO functionality that can be programmed. GPIO (General Purpose Input/Output) refers to a set of generic pins of a microcontroller that can be used for digital signaling. GPIO pins can be individually set to act as input or output, and values can be either…

Read More

Working with Files in NodeMCU on the ESP8266

By | ESP8266, IoT | 6 Comments

This is post 7 of 13 in the series “IoT with the ESP8266” What is SPIFFS? One of the coolest things about the NodeMCU firmware is that it includes a SPI Flash File System (SPIFFS) module. This means that data and scripts can be written to and read from the flash memory using the concept of files instead programming against raw memory locations. Flash memory allow random access reads and writes. But, by nature, flash memory only allows erasure for entire blocks of memory (i.e., 64 kB) at a time. When erased, a NOR flash memory address will contain all…

Read More

Let’s Do Something with the ESP8266 using NodeMCU

By | ESP8266, IoT | 3 Comments

This is post 6 of 13 in the series “IoT with the ESP8266” Get to a Prompt Up until now, I’ve been putting out a lot of high-level background information about the ESP8266 and different firmware in order to establish a baseline of knowledge about the platform and its history. Now that you [hopefully] have NodeMCU installed onto your own ESP8266 device, let’s do something with it. Connect your device to the USB port, and open a serial terminal program. If you’re looking for a serial terminal for Windows, then you may want to try out RealTerm. It has become my…

Read More

How to Wire the ESP8266-12 for Programming

By | ESP8266, IoT | 5 Comments

This is post 5 of 13 in the series “IoT with the ESP8266” In my last post, I discussed how to acquire the NodeMCU firmware, and then how to flash it using a serial port (or, rather, your USB port). The assumption that I was making was that people already had the ESP8266-12 module in an easy-to-work-with form, like the NodeMCU DevKit or Adafruit Huzzah. But, some of the readers only had the bare module. I was asked what it would take to ready the ESP8266-12 module itself for programming. My response follows: ESP8266-12 Pinouts Here are the pinouts of…

Read More

NodeMCU Firmware for the ESP8266

By | ESP8266, IoT | No Comments

This is post 4 of 13 in the series “IoT with the ESP8266” Introducing NodeMCU The NodeMCU Firmware is an open source project that provides an abstraction layer on top of the Expressif SDK for the ESP8266. While the SDK itself provides low-level access to the peripherals of the ESP8266EX chip, NodeMCU provides a high level API that hides a lot of the implementation details of how the chip works. NodeMCU includes a version of the Lua programming language that is based on eLua. Like many developers, I was personally first introduced to the Lua language by means of a…

Read More

ESP8266 Firmware

By | ESP8266, IoT | 3 Comments

This is post 3 of 13 in the series “IoT with the ESP8266” Firmware is the term given to software that runs from non-volatile memory (NVM) on a piece of hardware. It is the “permanent” program stored in the ROM of any device that contains a processor, like your TV’s remote control, your digital camera, your Wi-Fi router, and even modern light bulbs (the programmable LED ones). It is considered non-volatile because the program survives power-down states without requiring any sort of supplemental battery power. Historically, a device’s firmware is set during manufacturing and never changed. Though, since re-writable flash…

Read More

Introducing the ESP8266-12 Module

By | ESP8266, IoT | No Comments

This is post 2 of 13 in the series “IoT with the ESP8266” Don’t let the $2-3 price fool you: there is a lot of functionality packed into the ESP8266-12 module by Chinese manufacturer AI-Thinker. The ESP8266EX itself is a System on Chip (SoC) produced by another Chinese manufacturer, Espressif. Within this tiny 5mm TSLP package is: a 32-bit 80 MHz microcontroller based on the Tensilica LX106 64 KB of Instruction RAM, 96 KB of data RAM Built-in 2.1 GHz 801.11 b/g/n Wi-Fi interface (TR Switch, Balun, LNA, Power Amplifier, and Matching Network) 17 GPIO pins with internal pull-up/pull-down resistors…

Read More

Heart Rate Display with a Photon and a Microsoft Band

By | .NET, Blogs, C#, Fun, IoT, Microsoft Band, Mobile, Multi-Device, News, Photon, Visual Studio, Windows Phone | 4 Comments

Those who know me, know I love sensors, and doing things with sensors. I’ve published many posts on accessing the various sensors on the Microsoft Band: Accelerometer & Gyroscope, Ultraviolet, Skin Temperature, and Galvanic Skin Response. One subject that I haven’t gotten to is the heart rate sensor. I’ve also started to publish a few IoT posts. For this post, I thought it would be fun to integrate the Band’s heart rate sensor with a Particle Photon so you can visualize your heart rate with an RGB LED. The LED pulses at the same rate as your heart and will shift…

Read More

Why is IoT so Expensive? Hint: It Doesn’t Have to Be!

By | ESP8266, IoT | One Comment

This is post 1 of 13 in the series “IoT with the ESP8266” So often today, I see the Internet of Things (IoT) as being associated with small form-factor general-purpose computers, like the Raspberry Pi 2, the Intel Galileo, and the MinnowBoard MAX. Don’t get me wrong: these are all great platforms for prototyping just about anything, offering fast multi-core processors, a reasonable amount of RAM by today’s standards, a plethora of I/O, and external removable storage (i.e., SD card) all at a reasonable cost if you are buying one or two… but at $35, $45, and $145, these are…

Read More

PIR Sensor with a Photon, Particle Cloud, and a UWA

By | .NET, Blogs, C#, Fun, IoT, Microsoft, Multi-Device, News, Photon, Visual Studio, Windows, Windows Universal Apps | One Comment

My latest sensor experiment involved the PIR Motion Sensor (HC-SR501) that comes with the Photon Maker Kit. The motion sensor didn’t have the best English documentation; however, there were enough translations and fragments out on the Internet to get the job done. I decided to interface the motion sensor with a Photon, and then feed the sensor output to a UWA through the Particle Cloud by using a Particle Event Stream. The sensor has two potentiometers on its PCB. One controls the sensitivity of the sensor and the other controls the output latch delay. Turning the sensitivity down essentially limits the…

Read More
Touchscreen Panel Application

Windows IoT Core : A Philips Hue Touchscreen Panel Application

By | C#, Fun, Hardware, IoT, Microsoft, Multi-Device, Raspberry Pi, Visual Studio, Windows, Windows Universal Apps | 10 Comments

Philips Hue is a fabulous lighting system. It is a hub based system that discovers when new bulbs are added, allowing you to grow the collection of smart bulbs in your home organically. Hue also has apps available on some mobile platforms that make customizing and controlling your lights an easy and visual task. These are all fine and dandy, as long as you have a mobile device with you at all times. Hardware switches are available to circumvent that need, but they have limited functionality and in all honesty, they aren’t all that flashy or futuristic looking. I thought…

Read More

Controlling an RGB LED on a Photon with a UWA Color Picker

By | .NET, Blogs, C#, Fun, IoT, Microsoft, Mobile, Multi-Device, News, Photon, Visual Studio, Windows Universal Apps | 3 Comments

The Particle Photon makes it easy to control the color of an RGB LED. There are a number of color picker controls you can use in Windows apps. I wanted to see how easy it was to hook a Photon RGB LED up to a Windows app color picker. It ended up being a snap by using the Particle cloud functions. In this project I wrote a simple UWA that calls a Particle cloud function called “setRGB” on my targeted Photon whenever I change the selected value on the color picker. Then I implemented an event handler on that Photon’s…

Read More
Wiring Diagram

Windows IoT Core : Inter-Application Communication using App Services

By | C#, Hardware, IoT, Microsoft, News, Raspberry Pi, Visual Studio, Windows, Windows Universal Apps | 12 Comments

Windows IoT Core applications fall into two categories. Headless applications, also called Background applications, and Headed applications which are applications that expose a user interface. The Windows IoT Core device as a whole can also be run in a headless or headed mode. You are still able to run any number of background applications on a device that is configured in headed mode. These background applications may also be deployed alongside a currently running headed application. It is important to note that there can only be one running UI application at a given time. Background applications can be thought of…

Read More