Tuesday, March 31, 2015

Esp8266 - The Intenet-of-Things

My friend Larry - KB7KMO put me onto a new interesting and inexpensive device, - the Esp8266. The breakout board is available on ebay and others for only a few bucks ( <$5.00, the prices seem to vary all over the map).

Currently there are several Rev's available (e.g., -ESP03, -ESP04, through -ESP12). I have Esp8266-ESP11 and Exp8266-ESP12 on order. I will know more about what the Rev's really mean later. Found: see Link.

Apparently the device is relatively NEW, forums are starting to fill with; information, example code, and projects.

Esp8266 is WIFI Device with a Digital Interface

The Esp8266 can be used to add WIFI to any processor with just a few lines of code. Many of the standard processors (i.e. Arduino) have support libraries already available.

Or Better YET !

The Esp8266 is a processor in it own right. There is a specially constructed GitHup repository with the new (1.6.1) Arduino IDE configuration the can be used to download and run code directly on the Esp8266 board. (see the GitHub Readme file)

The number of I/O's is a little lacking on the Esp8266, but for Networked Device for checking; a simple temperature, a water level, or alarming circuit, which reports status via Text Message, this is a great little part. As a stand-alone device, the one or two digital pins may be enough for some projects, just plan for multiple devices.

The Exp8266 can be configured as a simple Web Server, Web Client, Access Point, send Text Messages, and much-much more.

I think this is going to be a fascinating part for our Ham Radio and Hobby projects, this will make them all a part of the Internet-of-Things.

More info to follow, on how I will be using this part, I am very excited.

-- Home Page: https://WA0UWH.blogspot.com

Tuesday, March 24, 2015

More Tasks for the Raspberry

As shown in the previous post, I have been working with the Raspberry PI 2 Computer Board. Thus far I have Connect a Camera and Servos to point the camera. In time, this will become a Roving Robot (more on that in a future post).

Also, I have been waiting for the Raspberry to grow large enough to run the OpenCPN Navigation software for my Boat. Previously, it was ran on a LapTop (which is now old and klunky).

Previous hardware Raspberry PI configurations (A, B, B+) did not have enough RAM nor CPU speed to make any of that that really possible. The Raspberry PI 2, with its 2x RAM, 4x Processors (which provide about 6x Speed). is a good match for the Boat's Navigation requirement. I do not have all of the details worked out yet, but it appears do able (that will be a subject of another blog post).

To make Boat Navigation and Rover Robot possible I need a network connection between the Raspberry PI and my Tablet. The boat navigation software runs on the PI and displayed on the Tablet. The PI will be in the Roving Robot with Camera display and Controls at my Tablet.

There are several pieces of software need to make all of this possible, most are readily available.  The Center piece is the  WIFI Access Point, with it I can connect Tablet directly (ah, . .  via WIFI) to the Raspberry PI, and when the PI is connected to my home Internet (i.e., during development) I can enjoy normal Internet access. Obviously, on the Boat and while Roving as a Robot, the Internet connection may not be available.

Adafruit has a nice tutorial which is helpful when setting up the Raspberry PI as a WIFI Access Point. With only a little head scratching, I got it and the attending DHCP up and running.  My internal home private is 192.168.2.xx, the new PI private address is 192.168.4.xx.  The PI routers between the two. Once set up, it was easy to attach my Cell Phone and Tablet to the new PI WIFI network.

Access to the devices and files on the Raspberry PI private network from my home network can easily be accoumplished with the "sshuttle" command, "rp22" is the name of my Raspberry.

$ sshuttle -DNHr rp22

The OpenCPN Navigation Software is ran on the PI, in a virtual "vncserver" window. The window is configured to match the aspect ratio (600x900) of the Tablet.

I use "ssh" to access the PI and execute the "vncserver" command. Once set up, what ever is running, will continue to run even when a viewer is disconnected, the next connection just continue the previous session. With the "-alwaysshared" option, multiple viewers can be connected simultaneously. This will be very convenient for both the Boat and the Rover.

$ vncserver -alwaysshared -geometry 600x900 :3

I use "vncviewer" on the Tablet (and/or cell phone) to view the results.

OpenCPN running on The Raspberry PI
and Displayed on the Tablet

As can be seen below with "xosview", the Raspberry PI 2 is just idling along.

System Resource Report
For the Roving Robot I will use the PI to operate the Camera pointing Servos and eventually control wheels. Currently I am streaming the camera's video to my Tablet.

All of this functionality is useful and will be used on several of my projects, including my Minima Transceiver (see many previous posts). I plan to write software to provide a Remote Panel for the Minima.

Boat Camping

During last years Boat Camping trip to the San Juan Islands,  I had 8 adults and their attending kids on board my Boat. Most camped overnight on shore.

They all had there personal devices and after the first night, they all needed to be re-charged. We had a few USB Chargers in the Boat, but there was a line waiting to gain access, I had little time on the charger myself.

For this next year, I plan to install MotorCycle USB Chargers in several places on the Boat. One will be installed on the Bridge, where I can use it with the Tablet and Navigation Software.

MotorCycle USB Charging Ports

More details to follow - while having fun with the Raspberry PI !

-- Home Page: https://WA0UWH.blogspot.com

A Lurking Raspberry PI 2

I have been playing with the Raspberry PI 2, connecting a PI Camera and Servos to it. To provide articulation, I used an optional 12" Camera Cable for the connection.

After several hours of research I have figured out how to capture and stream images. Recently I have also figured out how to use the Servos Hat (servo adaptor board) via the Adafruit's I2C Libraries.

So with the combination of Camera and Servos, I now have a "Lurking Raspberry PI".

 I have bits and pieces of programs to control the camera and adjust the servos over the Internet, I just need to assemble the pieces together for a convenient Internet controlled system. Most of the programming will be in python, as contributed libraries are readily available.

The Raspberry PI is currently tethered via a Network Cable, and Power Cord.  But, by adding Wheels, (a big) Battery, and WIFI, is should be able to roam as desired.

My goal is complete control from my Tablet (and from any place on the Internet). Currently, simple Servo Commands can be sent via "ssh" and "telnet" on a private Public IP Address, Private Port, and Private Password. Video is also streamed to a Browser, with and a similar network connection. When completed, a single interactive Web Browser session will control the Camera Servos and future Wheel motors.

One of my goals is to, make the "Lurking Raspberry PI" available to the public with limited control, but that will be in the future.

Raspberry PI 2

I added the Servo Hat, and of course the Adafruit Case was full.

Full Case

Note: it appears that I did not have the Raspberry PI completely snapped in place.

There is not a space to mount the Camera and the Case Lid no longer fit on. So, I cut the bottom out of another one of a Ladyada's cases, which with just a little cutting and adjusting fits perfectly stacked (it almost snaps together). But it may not be an easy task for someone with two left (or right) thumbs. To make things easier, I believe Ladyada is planning an extension case similar to this.

Stacked Cases, The Bottom was Removed from Top Case

The removed (cut out) bottom is being used as an insulator between the Raspberry PI and the Servo Hat, otherwise the Servo through hole pins touch the metal HDMI connector, and it helps stabilize the Hat without special screws and spacers. The Nibs were left on the plastic to help hold-up the far side of the Servo Hat. A slot was cut to accommodate the Camera Cable.

Salvaged Case Bottom

The Two Ganged Servos are mounted on the Case cover.

Servos Mounted

The Case is closed and the Camera is installed, now it is almost ready for Action. The Bands ensure that it does NOT spring apart, and provides anti-skid feet.

Ready For Action
It's Lurking, . . . at me?

It looks like I could have use a little shorter 8" Camera Cable, but 12" Camera Cable will work fine.

More details of this project will follow, I plan to post some photos and/or captured video.


Sunday, March 15, 2015

More, CloseUp Tablet Photos

After thinking about the photos taken for the previous post, I was wondering how photos compare; when taken with the Tablet "Magnify App", and when taken through the Microscope Lens with a Tablet or Cell phone Camera?

Here is a photo taken with the Cell Phone Camera (at the Eyepiece Lens) through the Microscope at 15x Power (30x Eyepiece and with a 0.5 Diopter Object Lens).

Cell Phone Photo
through the Microscope Lens
The following photo shows the same area, taken with just the Tablet Camera with the "Magnify App".

Tablet Photo using "Magnify App"
And the same area with just the Normal Tablet Camera.

Tablet Photo using Normal Camera App
The following is the set up, as can be seen, I am just holding the Tablet, using the Microscope LED Ring Light for lighting. The photo was taken with a Cell Phone. The mouse-PCB (the photo subject) is in the spot light.

Set up Configuration
Photo take with Cell Phone
By the sizes of the saved photo files, it is obvious that the Magnify App is using Digital Zoom. but for my blogs the photos are large enough and have enough resolution.

Conclusion: I think until I get a better Microscope Mounted USB Camera, I will be using the Tablet with the "Magnify App" for most of my blog photos.

To make taking photos easier, I plan to build a stand to hold the Tablet steady. The Microscope Ring Light works fine for my photos.


Saturday, March 7, 2015

Mouse Surgery

Several weeks ago my Computer Mouse started acting up.  It would sometimes Double-Click on a single left button Click. This is very frustrating as unexpected functions results.

I had recently updated the OS and was thinking that the update had tweaked the Mouse Drivers and inappropriately set the de-bounce timing in the software. But Nope, replacing the mouse solved the problem.

Because I had a similar junk box mouse, I decided to see if I could replace the left button switch and solve the problem.

Right Button Switch Salvaged
From Junk Box Mouse
I successfully removed and reinstalled the mouse switch, I used the right switch from the junk box mouse, thinking that it had "less use" than the left switch. De-soldering the switch was a pain, because it was constructed with Lead Free solder.

I hate Lead Free solder ! And now, my local source for good 62/36/2 is going away, that is RadioShack is going out of business.
62/36/2 Solder

This Mouse surgery was done under heave sedation (battery removed) and with the aid of a Microscope :-)

After surgery, I decide to take some Microscope photos, but my standard microscope USB Camera is OLD and with a bare minimum resolution, I think it is 3Meg Pixel Photo Frame. For modern photos, a minimum is 9 to 12Meg Pixels would be ideal, but high resolution Microscope USB Cameras are expensive.

Recently I had read that reasonable photo can be taken through the Microscope (or telescope) with a cell phone camera, just place the phone camera at the eyepiece. Holding the my tablet steady and in focus was a real problem. Adaptors and fixtures are available on-line.

Microscope and Tablet Camera Photo
The photo resolution is 3264 x 1836 pixels (1.8Mbytes).

The tablet has a Camera "Magnify" Application, just for fun I decided to try it on some small parts. The following were taken with just the tablet camera. Most photos are about 2MBytes in size. I am pleased with the simple results.

The first part is the dis-assembled bad mouse switch, I was wondering if I could spot the problem, I thinks so, "crud" on the contact causing switch bounce.

The following were take just for fun. Note: all of these were taken with just the Tablet Camera. The dime in the corner for scale, note: at this scale, everything appears with "crud" attached. It is no wonder that "clean rooms" are necessary for manufacturing.

For me, this switch is amazing, beautiful, and a marvel of Engineering and Manufacturing.

Just for fun, more photos were taken of other miscellaneous parts.

I Think this is a 1206 size Capacitor
BTW: The Mouse will live, to Run another day :-)

-- Home Page: https://WA0UWH.blogspot.com