Search This Blog

Thursday, November 19, 2020

Smart Bedframe

Recent gap in posts is due to moving. Now going from a 1 br apt to a house, there are plenty of new things to automate. First project is to make a light controller for the bedroom. 

I want this device to control: 
- RGB led strip under the bed
- White led strip under the bed
- 2 dimmable lights connected to the headboard

I had planned to just use a nodemcu but due to the mosfets and 2 AC dimmers all requiring a PWM signal. I had to go with an Arduino nano paired with an ESP01. Sounds easy enough... but I vastly underestimated how much extra code that added to the project. In retrospect I would probably go with a bigger espressif board. Here is a pic of how I layed out all the boards in fritzing and then physically layed out.


And here it is fully wired up. Code is 95% ready. The ESP can connect to the MQTT server and relay commands to the Arduino Nano.
And now it is installed on the bedframe under the mattress. The 3d printed box pictured is a housing the cover up a screw terminal for the AC and 12v lines.
Biggest hiccup in this project is the AC dimmers library uses internal timer 2, which prevents you from using 2 of the 5 PWM signals. I solved this by just using a digital signal for the RGB mosfets, so I just can't dim the RGB colors anymore. Not a big deal.

Friday, July 24, 2020

Updating the RPI NAS

The RPI NAS that I had built a nice white wood box for has a new home. After finding a design for rack mounted raspberry pi, I knew I must have it. I came across the following design which holds 2 pi's:
https://www.thingiverse.com/thing:3541225

I already have one running openhab and then having a second running openmediavault and pihole, this was perfect. I also have a 3d-printer, so no prob! Well it took a few months for parts to come in and my 3d printer kept breaking. But its finished! Since this picture was taken I have put the 2nd raspberry pi in the setup, everything seems to be running smooth.



If you are curious about the code running the OLED displays. Follow this adafruit blog post, I have raspbian OS launch a python script as a service on boot.

https://learn.adafruit.com/adafruit-pioled-128x32-mini-oled-for-raspberry-pi/usage

Brew Computer Software Update


A while back I had re-written the homebrew computer python code. It was around the time I was working on the water level sensor for the brew setup. While updating the python code I had added a few new features:
  • Added support for 2nd serial/usb connection. One for the arduino handling the buttons and switched under the monitor, the other for the new water level sensor.
  • Added Blynk support so I can remotely monitor the brew process using the Blynk app.
  • Added PID algorithm to better maintain wort temperature
  • Updated the GUI, depicted below

I have now brewed twice with this new setup, so fine tuning is still left to do, but it feel way better to brew with. I have also now made the code available at: https://github.com/kbittle/BrewComputer

Friday, May 29, 2020

Sonos Bridge Hack


This all began when I came across a FREE Sonos Bridge. Ready to be thrown away I swiped it up and figured I could make use of it somehow. Well after googling what the device actually does, I realized how useless its intended function really way. Its really just a glorified Wifi extender. Should you have a Sonos speaker(which I may never own as they are very $$$), they can connect to the Wifi, so you dont need to add a bridge in-between. The box also rattled, so I knew something was broken.

So I immediately open it up and discover both antennas had broke off, would be an easy fix. But I'm not here to fix it, I dove further in, discovered there was a 4 pin header on the PCB. Hooked up a usb to ttl converter and tried every single pin combo at 9600 baud.... 

Diagnostics setup

Wala I saw some output! Very little output, but there was hope I could do something with this thing. Next I tried holding the button down and power cycling, what do you know, there was console output from something called redboot. Which I now know is the bootloader they are using to launch linux. The output said something like press Ctrl+c to halt the boot process. Once you hit that step, you now have free reign to the bootloader tools(I think). 

Redboot output
From this point I started looking into redboot commands, if there was a possibility to load a new kernel, other ways to access the linux environment. Things I found out:
  • Redboot has a load command to pull images from a tftp server
  • The processor is a: Atheros AR2315A-001 D4Q089C 1328
    • OpenWrt distro came in a flavor for this chip. May be a possibility to load that .img
    • https://downloads.openwrt.org/snapshots/targets/ath25/generic/
This all sounded very promising that I could turn this into a linux box. I just couldnt ever figure out how to get this device to connect to my network. Which may have worked originally, but I "accidentally" erased the original/sonos linux filesystem image. Originally I had though I would need to erase the original files to make room, well that flash chip on the board is 64gb I believe, should have been plenty of room to add an extra linux image. That may or may not have impacted the ability for the board to connect to my router. I would think redboot running would have been enough for me to be able to ping the device, but I had no success. My theory is the IP175C ethernet switch chip might be being controlled by the Atheros processor(the linux code that WAS running on it), but I have no idea how to prove or disprove that.
Well I gave it a try, might just pull the rj45 connector off the board and trash the rest.