Tuesday, April 18, 2017

iOS App - My Book Store

I developed an iOS app.
My Book Store
MyBooksTop

My 5 year old daughter was building a cash register with a building block and playing pretend to be a cacher.
My worst mistake was the comment - "OK, I'll make your register with iPad!".

Midnight coding.
Next morning, my kids try the app and feedback to me.
And then, my wife draws U/I parts.
Midnight coding again...
Endless loop...

Agile development like a sweatshop.

The following technics are implemented in the app.
I would like to introduce about these, if I feel inclined...
  • Camera preview in a non-full-screen view.
  • Barcode reader using MetaDataObject
  • Voice synthesizer using AVSpeechSynthesizer
  • Retrieve book information from Amazon Product Advertising API
  • Realm DB
  • iPad/iPhone universal responsive design on a single story board
  • A single view with multi container view for iPad. Multi view with transition for iPhone.
  • Rotated cells on collection view
  • Google AdMob

Sunday, April 16, 2017

OpenCV on iOS swift

I found OpenCV was available on Xcode.

So, I introduce how to use OpenCV sobel edge with swift as a simple example.


Materials


  • Mac

    Use a Mac that is surplus at home!
  • iPhone or iPad

    There are a few iOS devices at any home, aren't there?
  • Xcode

    It's a development environment software for iOS apps.

    If only for writing code and building apps (without distribution), it is free to use.
    It is available on AppStore for Mac.
  • OpenCV

    Global standard in image processing field, maybe.
    Version 3.0.0 was available, when I tried the following way.


Saturday, April 15, 2017

Home IP phone server by Raspberry Pi + asterisk

I built a PBX (IP phone server) with Raspberry Pi and made an extension call with old smartphone.
My 5 year old daughter seemes happy that she obtained her own mobile phone.
Many phone call comes from her.

Call with an outside line is also possible if configure.
But, for now, my goal is a usable toy phone by simple configuration, for now.


Asterisk vs RasPBX

I used software "Aterisk" to make Raspberry Pi a PBX.

As another way, Raspberry Pi distribution RasPBX is also available.
PasPBX provides very easy setup and web base configuration.

Today's goal is a toy, so advanced settings are not needed.
Plus, I want to use a Raspberry Pi also for other purposes.
So, I chose Asterisk, not RasPBX.

Install Asterisk

Just use apt-get.
pi@raspberrypi ~ $ sudo apt-get install asterisk

The necessary users are created automatically.

Setup Asterisk:/etc/asterisk/sip.conf


Thursday, April 13, 2017

Temperature and hygrometer with FlashAir + Arduino + Raspberry Pi (4) : Visualize on Raspberry Pi

Table of contents.
  1. Read values from sensor
  2. Read from SD card with iSDIO
  3. Send values from arduino to Raspbery Pi
  4. Visualize on Raspberry Pi

It is the final round!
The data sent from Arduino is received by Raspberry Pi and made visible by Java Script.

Source code is on GitHub.

The below is connection sequence.


Data collection API receives data from arduino.
Received data is written in a log file, and then, Java Script of a display page refers the data.

Web API works on Raspberry Pi

Make Web API with Apache and PHP.
Just install some packages.
pi@raspberrypi ~ $ sudo apt-get install apache2
pi@raspberrypi ~ $ sudo apt-get install php
pi@raspberrypi ~ $ sudo systemctl start apache2
After installation, files under /var/www/html/ can be accepted via HTTP.

Data collection API

Temperature and hygrometer with FlashAir + Arduino + Raspberry Pi (3) : Send measured data from Arduino to Raspberry Pi

Table of contents.
  1. Read values from sensor
  2. Read from SD card with iSDIO
  3. Send values from arduino to Raspbery Pi
  4. Visualize on Raspberry Pi

It's readied to use FlashAir from Arduino.
Let's send data via Flash Air to Raspberry Pi.
The all of following source code is put in Github.

Connect arduino and Flash Air



The each function of SD card pins is as follows.
I use 4th pin as the chip select pin.
SilkFunction
CDDo not use
CSChip select
CLKClock
SDOOutput
SDIInput
GNDGround
3.3V3.3V power
5V5V power


Read a parameter file from FlashAir storage

Read a parameter from a file on SD card volume.

Temperature and hygrometer with FlashAir + Arduino + Raspberry Pi (2) : Read SD card with using iSDIO

Table of contents.
  1. Read values from sensor
  2. Read from SD card with iSDIO
  3. Send values from arduino to Raspbery Pi
  4. Visualize on Raspberry Pi

Last time we measured temperature and humidity with DHT22.

Before sending measurement results, Modify FlashAir's iSDIO library.

Support FlashAir iSDIO and SD card function both

Following the FlashAir Developers tutorial, you can connect to HTTP using iSDIO with FlashAir.
FlashAir Developers:Arduino tutorial

However, in this tutorial, the SD card access function is killed.
So, we have to enhance the library by our selves.

Temperature and hygrometer with FlashAir + Arduino + Raspberry Pi (1) : Read values from sensor

Table of contents.
  1. Read values from sensor
  2. Read from SD card with iSDIO
  3. Send values from arduino to Raspbery Pi
  4. Visualize on Raspberry Pi

I made a thermo-hygrometer sensing with arduino.
It sends values via Toshiba FlashAir to Raspberry Pi, and visualizes on a web page.

[ Points ]
  • Visualize sensor data using FlashAir, arduino and Raspberry Pi
  • Measure temperature and humidity using DHT22 sensor.
  • Convert from float to number text on arduino.
  • Support iSDIO WiFi connection and SD card read/write at the same time.
  • Show a bubble chart with Chart.js.


Final image.


The data of multiple rooms are displayed, but the temperature and humidity meter is one.
I only want to compare the rooms, so I measured the data one by one and overlapped the data.

The hardware of the thermo-hygrometer.



Basic Design