Search the Community
Showing results for tags 'python'.
Found 2 results
Hello all! If anyone else is interested in devops tools like ansible/vagrant/docker or linux administration this project might interest you. I recently started learning about ansible a tool used to configure/orchestrate servers. So I thought I would try and use that to push firmware updates out to MSP430s. I came up with a solution that allows me to run a command on my machine which then copies the firmware to Rapsberry Pis and then flashes any MSP430 LaunchPads connected to them. I first had to compile the msp430 dll and the latest version of mspdebug for the ARM architecture (rather than x86). Essentially this allows me to program MSP430s from a Raspberry Pi using mspdebug. I talk about the steps here: http://zacklalanne.me/automated-deployment-of-msp430-firmware-part1/ Then I wrote an ansible playbook to automatically deploy the dll and mspdebug as well as the firmware to the connected Raspberry Pis which then push the firmware to the MSP430s. http://zacklalanne.me/automated-deployment-of-msp430-firmware-part2/ Don't think this is too realistic for an actual production environment but getting it all to run was a good learning exercise in compiling code on linux and system administration.
Over the past 10 years I've used various micro-controllers and devices to monitor and control my home heating and cooling system, water heater, sump pump, humidifier, AC power, lights, as well as a custom security system. After downsizing and moving into a condo a couple years ago, I also downsized my system toys, much to my wife's relief. But I am currently using a BeagleBoardXM to monitor our gas furnace and relevant weather datapoints. I thought I would share some of this project with anyone who might be interested. The heart of the monitoring system is a BeagleBoardXm running Ubuntu 13.04 headless. The program itself is written in Python 2.7.4. Data passed to the program consists of whether the furnace's gas burner is on or off, the temperature and humidity inside our home and the temperature, wind chill and wind speed outside. These 6 data points are uploaded to Xively every 60 seconds where they are automatically graphed for web analysis. In addition all data is logged to the BeagleBoard's SD card everytime the status of the furnace changes. To be more specific about the hardware, a 24VAC relay is connected to the furnace's gas valve. It's normally closed contacts are connected to a digital input pin on a Xbee radio module. The Xbee is set up in I/O line passing mode. When the furnace fires, pin D3 goes High, which is reflected on another Xbee, also running in I/O line passing mode, connected to a USB port on the BeagleBoard. This Xbee then sends a 13 byte packet to the serial port which is read by the Python program. I could add more appliances to the Xbee in our utility room, for example, the water heater, clothes washer/dryer and AC power. But for now I'm keeping things minimal. To measure the temperature and humidity inside our home, I'm using a Phidgets 8/8/8 Interface Board. Phidgets temperature and humidity sernsors are connected to a couple of its analog inputs. Here again I could add more sensors. To get outside conditions, I'm pulling down metadata from WeatherBug.com, parsing its 30 some data elements and retreiving just temperature, wind chill and wind speed. Those seemed to be the things most relevant to how much my furnace runs. Then as I mentioned, these 6 data elements are uploaded to Xively.com for online viewing. This has come in handy when we are away to make sure things are running OK at home. Here's a link to my account: https://xively.com/feeds/97217%C2'> It may not always be updating, as I fiddle around with the program. I use MobaXterm to SSH into the BeagleBoardXm and WinSCP for more extensive file management, both from my Windows machine through our home network. I did find it necessary to setup a static IP adress for the BBXm. Some of the Python packages this project uses are: PySerial, Mechanize and Phidgets. I'm using an embedded class from: github.com/mattvenn/cosm to format the data elements into a format suitable for uploading to Xively. Interestingly, Pachube was bought by Cosm and finally by Xively during the years I have been using them to graph my data. I also managed to get my sound working and may use it for audible warnings or messages. Perhaps more to come...