Settings
top

At Caesar’s Palace

Vacation time…

Back to my first love

Seeing the work that I mostly do now, you would never guess that the only degree I hold is for Visual Communication (Graphic Design). For many years I worked as a print and publications Art Director, not even sure if that title exists any more. I was good at it and I loved it so much. The stress, deadlines, intense negotiations, last minute Canadian press checks, and the countless best practices you had to follow. It all made up some of the most exhilarating and eventful years of my life and just in time for me to turn 21 and learn how to drink.

Every now and then I get to jump back into that world and work with a print house. Sometimes I feel like a blind man when it comes to the higher level hardware and programming stuff that find myself working on more and more. I am learning quickly, but I do get stuck from time to time. Talking to a printer about a print job though… that is more like watching a tennis match at Wimbledon. Though I am not up on the latest print tech, I can speak the language well. There is no need to dumb things down.

“I need single sided full color prints on 7mil vinyl stock and can you run that on digital because we only need 4 of each out of 20 prints. What is the turnaround?”

I know that this makes me a total geek, but I totally get off on these types of exchanges. In some ways I am sad that the pace of tech will inevitably make printed media obsolete. However, if I live long enough to see it, I will enjoy telling stories of how we once put ink on paper.

My new garden tags are right at home.

New tags for the garden.

Why care about MIT App Inventor?

The other day I made a post about using App Inventor to create a simple UI for the Particle Photon. I have also been working on a project that involves an internet connected Weather Cloud. To make it easy for the owner to control this cloud, I have put together and Android app.

image

This works much faster that using something like IFTTT and requires no additional libraries like Blynk.

This brings up an interesting observation when it comes to IOT. If you want to interact with your devices, there are not a lot of good ways to go about it.
You can throw some Ajax onto your web server. If you have a web server that is.
Connect your devices API to another companies API and send your data on an epic journey when you are often in the same room as the device you are sending data to.
Make your own API and take pride that you have joined a legacy of frustrated developers world wide. Then scrap it all to use IFTTT just so much easier.
You could add a few new libraries to your firmware so that it can talk to a custom UI app like Blynk. This is actually not a bad option except that I should not have to add a new library to exploit the basic HTTP interaction protocol that comes standard with the Particle API.
Going back to the web server thing, you can just use a simple HTML page and form data for interaction. This just leaves your device credentials open for the world to see.

This is the problem with IOT right now. There are lots of ways to interact with devices, but no really good way to just go from user to device for the average person. App Inventor gives us a quick fix by letting us create an app that just uses HTTP GET and POST requests while keeping the credentials private. However, we need something better. An app that uses basic the preexisting protocol with an intuitive UI.

This is what I am working on at the moment with Vince at SoDo MakerSpace. An app like Blynk with no additional libraries, IFTTT without the additional API hooks, and Ajax without all of the coding.

I feel like this will help to open the door to the dream of IOT for the masses.

App Inventor and Particle

AppInvent09This is set up to work with the WEB-Connected LED example app for the Particle Spark, Photon, or Electron.

App Inventor is an easy way to make Apps for the Android platform. We will go through how to use App Inventor for communicating with any Particle device.

 

The Designer
AppInvent01

You will want to make two buttons. The button names do not matter, but we will just call them ButtonOn and ButtonOff.

AppInvent02Next we will add the Web component with the following attributes.

  1. Check AllowCookies.
  2. Enter https://api.particle.io/v1/devices/ in the Url field.

Code Blocks

Now we get into the codding. The thing to keep in mind is that a Particle function can only be called with an HTTP POST request. App Inventor makes it easy to send GET data so we will have to jump through a few hoops to get there.

Set Global Variables

First, lets set up some global variables. These can be found under Variables and initialize global. To this we will add a Text value to start with.AppInvent04

  1. Make sure the serverURL is set to “https://api.particle.io/v1/devices/“.
  2. Copy the Device ID and use that for the deviceID variable.
  3. Locate the Access Token from your Particle account and use that for the accessToken.

  4. Fun
    should be set to the function name from the Particle code. For this instance, we are calling “led”.
  5. Var is a placeholder for the value we will be sending to the function. It is blank.
  6. HTTP_Reply can be used to get a conformation message from the Particle device.
  7. PINstate can be used later to toggle the On/Off button.

The Send Procedure

In App Inventor, a Procedure is a block of code that can be called on to run at any time. This saves time and space when you need to run the same code over and over again.

  1. AppInvent07From the Procedures blocks, add the Do block.
  2. Name this procedure “SendToParticle“.
  3. Add the Set Web1 block from the Web1 section to the new procedure.
  4. Now we will assemble a string for the set Web1.Url by using the Join block from Text.
  5. All together we will be joining the serverURL, deviceID,/“, Fun,?access_token=“, and accessToken.
  6. Under the Set.Url block, we will add a Call.PostText block from the Web1 section.
  7. To this we will add a Join block for sending to our Particle function via POST request.
  8. We will join “params=” and the Var value.

AppInvent06When ever this procedure is called Val will be sent via POST to:

https://api.particle.io/v1/devices/your-device-id/led?access_token=your-access-token

The Button Click

For now we will just use one button for ON and one for OFF. So we want to grab the when.click from the ButtonOn and ButtonOff blocks.

  1. AppInvent05To that we will add a Set block for the Var variable. Also add the value of “on” to this.
  2. Next we will be calling on the SendToParticle Procedure.

 

 

That is it!

Once this App is loaded onto your phone it will turn the built-in LED, attached to Pin 7 on the Particle device, on or off.

What Next?

Well this is a good place to get you started. From here you can try to make the button toggle the LED on or off.

AppInvent08

Change the button into an image to make things look a little nicer.

Add a Relay to Pin 7 on the Particle device and you can turn an actual light on or off.

The possibilities are nearly endless and this will help get you well on the road to making it easy to use the next big IOT… thing.

The Techno Cyber Monk rides again.

I am on my way to the MakerSpace to finish up a few last minute things, then it is off to #ECCC. I installed a few dreads and have my Adafruit powered War Hammer.

image

image

A friend once said that I looked like some sort of Techno Cyber Monk walking down the street.

Kombucha Harvesting Time!

IMAG0674_BURST002Recently a fellow maker, Jon, gave us a Scoby so we could make our own Kambucha… 2 weeks later and it is ripe for drinking. I got a bottle full in the fridge for tomorrow and the rest will be bottled for secondary fermentation.

IMAG0673_BURST002_COVEROur first attempt found us brewing up a bunch of caffeine free green tea. This was not so good for Scoby growth, but it did spawn a second mother. So now we are going to try and get a second pot going as well.

IMAG0676_BURST002As far as the secondary fermentation goes, we have added some ginger and I put on some frozen Rasberries and Blue Berries. We will see how it goes.