Posts

how to IR remote control via wemos d1 (esp8266) & mqtt & sonoff tasmota

Image
I used wemos d1 and connected like this: (source: https://github.com/witnessmenow/ESP8266-IR-Remote-Example) Receiver module is tsop38238 Transistor :  2N3904 (without it , LED is not bright enough to send IR signal) Led diode is Infrared diode. I used this library with arduiono :  https://github.com/markszabo/IRremoteESP8266 From examples  with this one:  IRrecvDumpV2.ino you can capture IR codes from the remote by pressing the remote button and it will be captured  and it generates codes like this:

Bose speaker hack (companion 5) to turn on/off automatically

Image
I have on of these Bose companion 5 speakers. The problem with it is when you don't use it actively it turns off to save energy, next time when you want to use it you should press the button on the control pod to activate it. This is a problem when you use the aux cable as input as a standalone speaker. Solution was not the easiest but it's a quick hack.  I designed a system where when an audio detected from the aux input , it Bose speakers turn on automatically to green. Here is how it goes: Tested the pins of the control pod, looks like there are different voltages supplied to the control pod. It all ends up here because I couldn't find how the audio transmitted to the main device.I had to find a way to open this: There were 2 screws at the back. It turns out it uses the same screws apple uses T5 When I opened it the top came off You need to unscrew these as well, and you have to cut the wheel, (you can glue it ba...

how to connect xiomi temperature and humidity sensor to openhab without a gateway

I've a xiomi temperature and humidity sensor with bluetooth. I'm Using openhab and MQTT so it's easy to connect: 1) Create this script (xiomi.sh) : Replace BT with your sensor's mac address. You can find it with:   sudo hcitool lescan (look for  MJ_HT_V1) Change the IP address (192.168.1.100) to your MQQT server address. #!/bin/bash for pid in $( pidof -x xiomi.sh ); do     if [ $pid != $$ ]; then         echo "[$(date)] : xiomi.sh : Process is already running with PID $pid"         exit 1     fi done bt = "4C:65:A8:DC:AD:CF" sensor = "sensor" RET = 1 until [ ${RET} -eq 0 ]; do     data =$( /usr/bin/timeout 20 /usr/bin/gatttool -b $bt --char-write-req --handle = 0x10 -n 0100 --listen | grep "Notification handle" -m 2 )     RET = $?     sleep 5 done RET = 1 until [ ${RET} -eq 0 ]; do   ...
waveshare 1.44" tft lcd HAT (st7735s)  raspberry pi setup: Enable ‘SPI’ inside ‘Advanced Options’ and then ‘SPI’. You will simply get a yes/no option for the ‘SPI’ setting. Advanced Options’ section is ‘Overscan’. When asked ‘Would you like to enable compensation for displays with overscan?’ you can select No sudo nano /etc/modules add the following into the file (if the lines are not already there) spi-bcm2835 fbtft_device sudo nano /etc/modprobe.d/fbtft.conf add: options fbtft_device name=adafruit18_green gpios=reset:27,dc:25,cs:8,led:24 speed=40000000 bgr=1 fps=60 custom=1 height=128 width=128 rotate=180 sudo apt-get install cmake git and now we have the tools, we can grab the code from github, and build it cd ~ git clone https://github.com/tasanakorn/rpi-fbcp cd rpi-fbcp/ mkdir build cd build/ cmake .. make sudo install fbcp /usr/local/bin/fbcp cd ~ git clone https://github.com/adafruit/Adafruit-Retrogame cd Adafruit-Retrogame/ make sudo ...

Can't update macOS High Sierra

Image
You can't update macOS High Sierra? You are on 10.13.x, but the 10.13.x +1  won't install? It goes through the download and reboot, but when it is done you are still on  same 10.13 ? You can't install kext extensions anymore ? Tried downloading combo updates ? Tried installing direct downloads ? You get in the logs:  Could not create a Preboot Volume for APFS install Or you get:  Could not update Preboot Volume  well... not anymore.. You don't need to reinstall or anything. Check your /Volumes/ folder you probably will see countless preboot volumes there.. This has to be a weird mac os bug. I had 99 folders, probably can't create anymore and hence no more updates for Mac os or no more low level kernel drivers installations... What you need to do is to delete all the folders except the Preboot one. So you should end up with only 1 preboot directory in volumes directory.. Reboot, reinstall and everythi...

how to install google play services to asus tinker board

Asus recently released a new version of android operating system for it's Asus tinker board.You can download the latest version from here: https://www.asus.com/Single-Board-Computer/Tinker-Board/HelpDesk_Download/ However, it comes without google play store. If you want to install google play store, there are lots of versions of it around the web, but which one will work? The correct google play version to select for Asus tinker board is this one: http://www.apkmirror.com/apk/google-inc/google-play-services/google-play-services-10-5-62-release/google-play-services-10-5-62-438-153733333-android-apk-download/ google services: http://www.apkmirror.com/apk/google-inc/google-services-framework/google-services-framework-6-0-1-release/google-services-framework-6-0-1-android-apk-download/download/ this time download the google play store from: http://www.apkmirror.com/apk/google-inc/google-play-store/google-play-store-7-7-31-release/google-play-store-7-7-31-o-all-0-pr-15...

asus tinker board boot problems

Image
Recently got an Asus tinker board , flashed images but no matter it won't boot. Neither android image or debian one. Turns out the problem was with the power supply. This beast requires really a lot power. If you run into issues , try to connect a more powerful usb charger. Apple's iphone charges won't do it.

how can you enable a windows firewall rule for a dynamic dns name or dns address

in a windows server sometimes you just need to enable some ports on your firewall to your dynamic dns address.(such as RDP , FTP , etc..) It is cumbersome when you do this manually every time your ip address changes.Why not update your server automatically every time when your ip changes based on your new dynamic dns update ? 1 ) just create a powershell script like this: $ip = [System.Net.Dns]::GetHostAddresses(" your ddnss address ").IpAddressToString Set-NetFirewallRule -DisplayName " myrule " -RemoteAddress $ip Put in your ddns name like: xxx.dydns.org , no-ip etc.. Create a firewall rule and define ports etc. before hand and name it either "myrule" and use the second line as it is ,or change the "myrule" to your rule's display name on advanced firewall app on windows server. 2) name it as firewall.ps1 3) and than create a task on task scheduler like this: command to execute: powershell -executionpolicy remotesigned -File...

windows 7 can't find files with extension *.pdb , try yourself:

Windows 7 can't find files with extension *.pdb , try yourself: Open a directory where you know that there are files with *.pdb extension type search *.pdb and windows 7 will not be able to find any files and display error message: No items match your search. That's crazy bug ! It works as expected for other file extensions though . such as *.mp3 , *.html or whatever..

angry birds live

Image
well they are real actually but not so angry

ios 5 or ios 5.0.1 on Iphone 4s crashes - kernel panic

I bought one of these iphone 4s 64 gb s on the day they have been released and since then I am having some phone crashes.Phone is crashing and shut-down it self.I am not sure if it is a software problem or hardware but updating to ios 5.0.1 didn't fix the problem and I am wondering if anyone else having these problems. Error log from the iphone 4s is something like this: Incident Identifier: 2E7997B3-0521-4C99-BAA7- DB959D211A92 CrashReporter Key: 3ffcf799c1cef600edb9dcae8dc547 503cdda6ba Hardware Model: iPhone4,1 Date/Time: 2011-11-12 14 :25:20.250 +0000 OS Version: iPhone OS 5.0.1 (9A405) panic(cpu 1 caller 0x800530b3): "no entry"@/SourceCache/xnu/xnu- 1878.4.46/osfmk/vm/vm_map_ store_rb.c:80 Debugger message: panic OS version: 9A405 Kernel version: Darwin Kernel Version 11.0.0: Tue Nov 1 20:34:16 PDT 2011; root:xnu-1878.4.46~1/RELEASE_ ARM_S5L8940X iBoot version: iBoot-1219.43.32 secure boot?: YES Paniclog version: 1 Epoch Time: sec usec Boot : 0x4ebd076c 0x00000000 Sl...

HAL_INITIALIZATION_FAILED Error While Installing Windows 8 Developer Preview Build

Windows 8 developer preview is released, I just wanted to give it a try and install to a virtual Pc however looks like it's not compatible with either VMware or Microsoft virtual Pc 2007 versions that I currently use.The error message when installing is: HAL_INITIALIZATION_FAILED Error While Installing Windows 8 Developer Preview Build Solution: Download & Use Latest build from Virtual Box, http://www.virtualbox.org it's open source and free.. and doesn't have this issue with windows 8

buffalo wzr-hp-g300nh open wrt failsafe mode

I recently ugpraded my router's (buffalo wzr-hp-g300nh) firmware from dd-wrt to open-wrt due to problems with installing packages to dd-wrt's lates version. Looks like open-wrt now is more up to date and works better.However it is easier to break. After playing with it's GUI to configure network I easly bricked the router and needed to recover it. What I found is failsafe mode in open wrt.To achieve this with buffola wzr-hp-g300nh, simply unplug the rooter wait for red diagnostic light to turn of , when the green light starts blinking immediately press the wireless button. This will put the open-wrt in fail safe mode.To be able to access failsafe mode , you should be connected to your router over cable and your ip address should be set to 192.168.1.2 (static). Once you are in , just telnet to 192.168.1.1 and you will be logged in. first mount the file system so that you can write it by typing: mount_root when you do this , FS will be writable. I found def...

How to connect your old phone as a 3g router to your open-wrt installation.

I recently moved to a new flat and currently I don't have an internet connection.I have an old phone: nokia n95 8gb and unlimited data plan. What I decided to connect the phone to the router and access internet as usual. 1-install open-wrt's latest version (OpenWrt Backfire 10.03.1-rc5 in my case) 2-you need to install usb packages kmod-usb-acm 2.6.32.27-1 kmod-usb-core 2.6.32.27-1 kmod-usb-ohci 2.6.32.27-1 kmod-usb2 3-to configure 3g access from backfire's gui you need install package comgt 0.32-9 4-go to wwan section and now select 3g as connection method. put the settings apn etc. and you will be connected to internet over your nokia. Trick here for nokia phones is comminicated through kmod-usb-acm package ...

DD-WRT Mac address clone resets itself upon startup

I have a Buffalo WZR-HP-G300NH modem and I run DD-WRT v24-sp2 (08/07/10) std on it. everything is perfect except I need to have my old router's mac address to keep my old IP address assigned from my ISP. There is a solution in DD-WRT for this in WEB interface > SETUP > MAC address clone where I can change it and it fixes it . However the problem is for some reason or because of a bug, Buffalo forgets MAC address every time it is rebooted or at a power lost and I need to go this address and click apply again to change it back to the desired MAC address. My solution to avoid this is easy: 1) Go to Web interface > Administration> Commands 2) Paste this: nvram set wan_hwaddr="12:40:CC:11:00:00" stopservice wan startservice wan Not that: "12:40:CC:11:00:00" is my MAc address and you need to type your own there! 3) Click Save Startup Next time when you reboot your Modem , or after a power lost you will have the desired mac address set.

first cool hive

9 years ago I recorded half of a song hoping that one day sound recognition technology will advance and I can find out what was the song's name and listen it as a whole.Today by coincidence I found that file again and used shazam on iphone to identify which song was it.maybe I am a bit late but now at least I know that it's called first cool hive and I can stream it from spotify.

Computer Lags but not because of CPU Usage

Image
I had some problems for a while with my laptop about things getting slowing down while I was using my pc.Normally, slow downs occur if the CPU usage is very high and normally I use Task Manager to see what's going on.The interesting thing is when I open the task manager I see some processes using high CPU and I kill them , suddenly another process starts using CPU higher..after a while killing all the processes I end up with Task Manager and task manager uses massive CPU, obviously these processes were not using this much CPU. The first thing came to my mind is a driver problem.But how could I find it and prove which driver was it ? Normally you can do debugging and all kind of stuff to track down the problem but it's a massive work. I was searching the net I found this utility: http://www.thesycon.de/eng/latency_check.shtml great tool, showed me the lag and intervals so that while I was running this program I went to device manager to disable drivers one by one to see whic...

jailbroken iphone 3gs won't boot

today I had to restart my jailbroken iphone because it was getting slow.I was surprised when it didn't boot and stuck while loading the OS.I was lucky that I was using verbose boot thing so that i was able to see what was going on.my problem was related to some fsck error during the boot. I tried hard to capture what was the error message because it was restarting quickly after that step.I used to use linux system and thought that the problem was with a corrupted unix filesystem however it wasn't.After doing some googling i found that thousands of people had this problem and looks like thousands of will have.Some clever guy had found that the problem was because of an update to /sbin directory from the jailbreak community (cydia/rock etc.) . and used one of the jail break programs with some customization to restore the sbin directory. That way you don't need to restore and start everything from square one.Also you won't loose any data. The blog of this guy and the more ...

don't mess with your users

If you get an error related to your user after restoring , mirroring db. etc. Run this: sp_change_users_login 'auto_fix', N'XXXXXX' where XXXXXX= your username, run this under the DB which that user belongs.

sql server 2008 database mirroring gotchas

One day if you try to configure sql server for mirroring without domain accounts you may come across with a few problems.such as this error message: Database mirroring connection error 4 'An error occurred while receiving data: '10054(An existing connection was forcibly closed by the remote "alter failed for database" The server network address can not be reached or does not exist. Check the network address name and that the ports for the local and remote endpoints are operational. The server network address "%.*ls" can not be reached or does not exist. Check the network address name and that the ports for the local and remote endpoints are operational. Error messages differs but the problem is sql servers principal and mirror should trust each other. On the net there are various resources how to configure this via certificates etc. but if you are in a hurry to test something quick try this on your mirror: run on master database if not exists( select * ...