Feb 132011
 

2 good things I just found out:

  1. Pogoplug is being sold via amazon.co.jp, and the Pro model will be out soon too. It’s quite a bit more expensive than the US price, but it’s finally here. I still wait for the Buffalo device though, which has the disks internally.
  2. b-mobile has finally (and expected) a Talking SIM U300, which means it’ll have voice and data (300 kbit/s max) for cheap (3960 Yen/month, data flat, voice calls extra at 21 Yen/30 sec, including 1050 Yen calls for free). This is very similar to Docomo’s SS plan which I currently use (with no Internet data plan). One difference is that no carry forward of unused call minutes is possible. Docomo allows this for 3 months, which works really well for me and effectively sets my voice calls close to zero. Email and calls to my family is free too. It’s a tough call, especially when Docomo will lower their smartphone data plans. Until now it’s only that cheap with their phones (and about 11000 Yen/month for data in case you use a random other device like this).
Feb 112011
 
XBee - Again

xbee-python is out in version 2.0.0 which officially supports the ZigBee (Series 2) version of the Digi XBee modules. Thus time to update my test programs to this new library.

Here the result:

#!/usr/bin/python

# This is a simple demo to remotely turn a LED on and off
# 2011-02-11 Harald Kubota

import serial
from xbee import ZigBee
import time

PORT='/dev/ttyUSB0'
BAUD_RATE=9600
ser = serial.Serial(PORT, BAUD_RATE)

# ZB XBee here. If you have Series 1 XBee, try XBee(ser) instead
xbee=ZigBee(ser)

#MAC, number written on the back of the XBee module
# CO3 = my coordinator
# EP1 = my endpoint with the LED on pin 11
device={
        "CO3":'\x00\x13\xa2\x00\x40\x52\x8d\x8a',
        "EP1":'\x00\x13\xa2\x00\x40\x4a\x61\x84'
}
#64 bit address
led=False

#change remote device function
xbee.remote_at(dest_addr_long=device["EP1"],command='D2',parameter='\x02')
xbee.remote_at(dest_addr_long=device["EP1"],command='D1',parameter='\x03')
xbee.remote_at(dest_addr_long=device["EP1"],command='IR',parameter='\x04\x00')
xbee.remote_at(dest_addr_long=device["EP1"],command='IC',parameter='\x02')

while 1:
        #set led status
        led=not led
        if led:
                xbee.remote_at(dest_addr_long=device["EP1"],command='D4',parameter='\x04')
        else:
                xbee.remote_at(dest_addr_long=device["EP1"],command='D4',parameter='\x05')
        # wait 1 second
        time.sleep(1)

ser.close()

Time to learn Python. I was mostly guessing my way through the Python code of this library. Luckily it’s far easier to read and understand than someĀ other languages. Maybe I am just not a friend of putting $ signs in front of variables.