This is for the tm4c123gxl launchpad and a cheap 433MHz transmitter.
It is essentially using the board as a firecracker (http://www.discounthomeautomation.com/X10-FireCracker-Computer-Interface-Module-XTCM17A?gclid=CjwKCAiAvf3RBRBBEiwAH5XYqBxpDvTQWVctkbn0SbPNjuyZ3y-j6F1CUet_43sZLtlEJHetToocMxoCLm4QAvD_BwE) that plugs into a usb port.
I wrote a simple flask app just to get things up and running. When a url is curled from the command line the web app sends the appropriate even to the microcontroller which sends the command to the x10 devices.
from flask import Flask
import serial
x10 = serial.Serial('/dev/ttyACM1', 115200)
proj = serial.Serial('/dev/ttyUSB0', 9600)
app = Flask(__name__)
@app.route('/')defhello_world():return'Welcome!'@app.route('/living_room_lamp_on')defliving_room_lamp_on():
x10.write('A011')
return'Living room lamp on.'@app.route('/living_room_lamp_off')defliving_room_lamp_off():
x10.write('A010')
return'Living room lamp off.'@app.route('/bedside_lamp_on')defbedside_lamp_on():
x10.write('A021')
return'Bedside lamp on.'@app.route('/bedside_lamp_off')defbedside_lamp_off():
x10.write('A020')
return'Bedside lamp off.'@app.route('/bedroom_tv_on')defbedroom_tv_on():
x10.write('A031')
return'Bedroom tv on.'@app.route('/bedroom_tv_off')defbedroom_tv_off():
x10.write('A030')
return'Bedroom tv off.'@app.route('/living_room_tv_on')defliving_room_tv_on():
proj.write('POWR 1\r')
return'Living room tv on.'@app.route('/living_room_tv_off')defliving_room_tv_off():
proj.write('POWR 0\r')
return'Living room tv off.'