SodaqOne version 2 LoRa kit

First try at LoRa

 

I am a backer for The Things Network, but at the moment (december 10, 2016) the hardware isn’t ready yet. So I bought a LoRa node from Sodaq to try and see if I can get it to succesfully send messages to a TTN gateway. Here’s a log so far:

  • Bought kit from Sodaq, connected antennas and plugged in micro USB
  • Downloaded Arduino IDE from https://www.arduino.cc/en/Main/Software
  • Set http://downloads.sodaq.net/package_sodaq_index.json as additional board manager URL in preferences of Arduino IDE
  • Installed Sodaq SAMD Boards in Arduino IDE’s Board Manager and set board type to SODAQ ONE with OneBASE SPI
  • Re-plugged USB power which reset the board. A new ‘usbmodem’ port appeared and showed some data on the serial monitor. LoRa settings not yet correct. USB is disabled after a while. red led stays on, yellow led blinks as if showing data. Then all leds go off (sleep?)
  • Reading http://support.sodaq.com/sodaq-one/
  • Followed http://support.sodaq.com/sodaq-one/connect-to-the-things-network/ creating application on https://staging.thethingsnetwork.org/applications
  • Set Arduino monitor to 57600 baud and NL&CR
  • Completed settings. No OTAA activation succeeded yet and no messages.
  • Some hours later, got my first GPS fix. It happened after I opened a window, which may indicate that my windows are coated and bad for radio? Wouldn’t surprise me at all.
  • Second succesful GPS fix was with window closed 🙂 No LoRa activity yet. Probably no nearby gateway, anyway and today I won’t be leaving the house to try elsewhere.
  • Compiled and uploaded current version of the tracker from https://github.com/SodaqMoja/SodaqOne-UniversalTracker
  • Interesting article from someone who also uses the SodaqOne with TTN: https://vanderzee.org/blog/article-160730-181003

Athom Homey

On the 10th of February, 2016 I received my Homey by Athom. It’s a home automation hub which listens to you and speaks back, and can control all kinds of devices. It has just been released, which means there’s still quite some bugs. So I will list here what has worked for me, and what hasn’t.

Currently on version 0.8.39 (started on 0.8.17)

Bugs I’ve encountered myself:

  • https://github.com/athombv/homey/issues/94 – philips hue, lux lamps wont (all) turn off or on with command all lights off or on

Works:

  • Adding and controlling Philips Hue lights. I have an existing Hue setup with Hue, Hue Lux, Hue Whites, Livingwhites, Livingcolors and LivingAmbience lamps. Homey added them all very easily by pairing with the hub (I have a first generation hub). You can then place the lamps in rooms so you can tell homey “OK Homey, turn of the lights in the living room” and that actually works 🙂
  • Adding and controlling Eurodomest 433MHz remote sockets. I bought a set of 3 sockets and a remote at Big Bazar for €10. They work nicely. Homey can add a socket by copying the remote’s radio signal, or by pairing with the socket directly after putting it into learning mode (press the on-off button on the socket itself for a few seconds)
  • Asking the time (“OK Homey, what time is it?”). Other built-in commands: what version are you, what are you doing, testing 1 2 3… voice recognition isn’t as good as Siri (Apple iOS) or OK Google (Android) though.
  • Adding a flow that turns on and off a light at a specific time. The turn off card has a delay so it first turns on the light then after a few seconds turns it off again.
  • Fibaro Motion sensor FGMS-001. A device that looks like an eyeball and uses Z-Wave. It was quite easy to pair, however the pairing wizard doesn’t know it is a Fibaro Motion Sensor and in stead adds some generic device. On the Homey forum I read that it was supposed to be on association group 3. Whatever that means 🙂 I’m new to this Z-Wave stuff.

Doesn’t work (yet ;):

  • Adding a bluetooth speaker. Confirmed that it doesn’t work yet, although it is being worked on by Athom.
  • cloning IR remotes isn’t working very well. Tried to copy my Philips TV remote but it won’t register even though the tv itself does (while pointing the remote at Homey!)

LED ring color meanings:

Yellow: Homey is starting, please wait

Red: Homey is dead, please disconnect power and restart

Blue: Homey is downloading something, you can still use me

Pink: Homey is updating, do not disconnect power

Orange: Homey is listening to your voice command

White: Homey is analysing your voice online

Rainbow: Homey is operational and waiting for an event

REST API:

Find the bearer token to use with the Authorization: Bearer HTTP header in the REST API:

go to my.athom.com, log in to your account, copy the link address of the homey picture, paste as text in a text editor, write down the bearer_token

tip: use https://www.getpostman.com/ to create the proper requests

Programming for Homey

I got my first Homey app working thanks to the documentation at https://developers.athom.com/library/introduction. I am creating an app to control my Marantz NR1604 receiver over the network (using the telnet-like interface over TCP).

The app (driver) is now online 🙂 https://apps.athom.com/app/nl.marcovandenhout.marantz

It should also work for similar Denon AVR’s which have the same network interface.

 

Controlling Philips Hue lamps with a Pebble smartwatch

As far as I know, at this moment there is no direct way to control Philips Hue lamps using a Pebble smartwatch. A workaround is possible though, with the help of a webserver that sends the right commands to the Hue bridge as you visit a specific webpage. Here’s how I did it.

Short demonstration on Youtube

What I used:

  • Philips Hue starter pack including Hue bridge (plus several Hue, Living Colors and Living Whites lamps which can be controlled by the bridge)
  • iPhone 4S
  • Pebble smartwatch
  • Smartwatch Pro app for iOS and the included WatchApp to be run on the Pebble
  • PC acting as a webserver (eeepc 4G, an older and relatively cheap netbook) on my local network
  • Debian GNU/Linux with Apache, PHP5, Phue, Composer, php5-curl

The steps as I recall them:

  • Make sure you can control the lamps using the Hue app for the iPhone.
  • Register your own ‘username’ with the Hue bridge as explained in http://developers.meethue.com/gettingstarted.html (Phue includes a tool to do this as well). You can test if you can control the lamps from your web browser using the Clip debugger.
  • Install Debian GNU/Linux on a suitable machine (just about any pc-like system that you can keep running on your network). For installation instructions, see http://www.debian.org/distrib/ At installation, make sure you select the task webserver. A full desktop system is not necessary for this purpose.
  • The Apache webserver and PHP5 should already be installed. If not already done, install package php5-curl (aptitude install php5-curl) as well.
  • Install Composer. At this moment it’s not an included package, so you can use these steps:
apt-get install curl
curl -s https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
  • Make a subdirectory (folder) in /var/www where your webpages will be located.
  • Install Phue by creating a composer.json file in the web folder
{        
"require": { "sqmk/phue": "*" }
}

and then running

composer install
  • create php webpages like the following (call it lamp1.php for example). Make sure you have the right IP address of the Hue bridge and the previously registered username.
<html>
  <head>
    <title>Turn on lamp 1</title>
  </head>
  <body>
     <h1>Lamp 1</h1>

<?php

require_once 'vendor/autoload.php';

$client = new PhueClient('192.168.1.2', 'thisismyhueusername');

try {
    (new PhueCommandPing)->send($client);
} catch (PhueTransportExceptionConnectionException $e) {
    echo 'There was a problem accessing the bridge';
}

// Manually send command to get light by id
$light = $client->sendCommand(
    new PhueCommandGetLightById(1)
);
echo $light->getName(), "n";
$light->setOn(true);
// Setting brightness (0 for no light, 255 for max brightness)
$light->setBrightness(255);
// Set color temp (153 min, 500 max), changes color mode to 'ct'
$light->setColorTemp(400);

?>

  </body>
</html>
  • Open the created webpage from a web browser in your network and see if it works.
  • Install the iOS app Smartwatch Pro, run it and install the watchapp on your Pebble. It doesn’t have to be Smartwatch Pro, but any app that can open a web address by pushing a button on the Pebble.
  • In Smartwatch Pro on the iPhone, enable the HTTP requests option, and add a HTTP request to the webpage you just created.
  • In the Smartwatch watchapp on your Pebble, select the HTTP request and enjoy 🙂

To see what you can do with Phue, check https://github.com/sqmk/Phue and the Hue developers information at http://developers.meethue.com/

 

Apple IIc from Scryption collection

I recently bought some of the ‘leftovers’ from the Scryption Museum which unfortunately had to close due to lack of funding. Here’s one of the systems I bought from them, an Apple IIc with matching monitor and power brick. It powers up, displaying “Apple //c” and “Check Disk Drive.” messages. Hitting Ctrl-Reset gives me a working BASIC prompt. print peek(64447) returns 255.

Actually, I have two IIc’s with matching monitors (green, composite). Both work fine as far as I can see, but both won’t work properly with the external Disk IIc (could be a faulty Disk IIc). Internal drives are fine, managed to receive and write disk images with ADT Pro and a cable from retrofloppy.com!
Apple IIc s/n are C5 05WK XX and C5 29S3 XX. Disk IIc serial is 139997 (model A2M4050Z).

SMC SMCWBR14S-N2 draft-N router

Picked up another home router (the kind of device people have at home between their internet connection and computers) at a flea market today. I had hoped to be able to install a Linux-based third party firmware (like Tomato, OpenWRT, dd-WRT, etc) but couldn’t find a lot about this router. It appears to work fine though so I could at least play with it or use it as a cheap LAN switch. I’m not experienced in hacking this kind of device (besides uploading firmware someone else already made) but if you have any questions feel free to comment on this post. I can open it and post pictures if needed, or even do some hacking if I have the time.

Some info I found:

brand: SMC
model: SMCWBR14S-N2 aka “Barricade N Draft 11n Wireless 4-port Broadband Router”
part number: 752.9256EU

silver colored plastic housing, WPS button, 4-port 10/100 switch, WAN port, recessed reset button, 9VDC/1A power connection, two fixed antennas.

to open: unscrew 3 philips (+) screws on the bottom (2 of which are hidden behind the rubber feet)

visible chips:        RT2880F (Ralink 266MHz? MIPS processor also used in the Linksys WRT160N V2)
IC+ IP175C (www.icplus.com.tw 5 port 10/100 ethernet integrated switch)
2x ISSI IS42S16400B-7TL    (2 times 8MB RAM = 16MB of RAM memory)

default IP address: 192.168.2.1
default admin password: smcadmin
management page is at http://192.168.2.1/ by default