Samstag, 6. Dezember 2014

WiFi RGB LED controller + FHEM + Pebble

Since I want more control over my heating, I looked into it and decided to give FHEM a try, but more on that later when I actually get the hardware etc. But while looking through some FHEM stuff, I came across WiFi controllers for RGB strips. In the past I already used a Raspberry Pi and a self made IR adapter, but that was rather crude and inefficient.

So I went to Amazon and bought the following:
NEUER LW-12 WIFI WLAN LED RGB STRIPS CONTROLLER für iPhone, iPad, iOS, Android 24V *Weiß*
and
Besdata 5m 500CM RGB 5050 300 SMD LED Strip Leiste Streifen + 44 Key Fernbedienung + Netzteil 12V 6A 72W- RGB - Wasserdicht - PL709A+EU

I recommend you to get a waterproof strip regardless where you install it, because it is easier and safer to install, since you can't get shocked. The normal ones are just open circuitry.

After installing the LED strip and the controller, I set up the controller and was able to control the light with my smartphone and tablet, which is already quite nice. But having to take out the phone and turning on the light is not as efficient as turning a switch.
 I also noticed another "feature" of the controller: It acts as a WiFi repeater. Therefore, it is extremely important to change the standard password of the built in AP, which is always the same. You can do that through the App or web interface. I haven't found a way to turn it off and also the channel selection doesn't work for me and always uses channel 13.

Connecting it to FHEM was rather easy. Download the latest  LW12 from here or WifiLight from here. Then put one or both into your fhem/FHEM folder.

After that just enter:
define your_chosen_name WifiLight RGB LW12:ip.to.your.controller
or
define your_chosen_name LW12 ip.to.your.controller  
For most cases LW12 should be better, since it is just for the LW12 and can use its back channel etc. You can also use them side by side.

 After that I can now control the light with nearly anything I want...

So I made an APP for my Pebble. You can find it here on Github.
If you want to use it, just import it to cloudpebble.net and change the vars etc. to fit into your network etc.

On my Pebble, I added my APP as a quick launch and now I just have to hold the up button and press it again to turn on the light, regardless where I am in the room.

Freitag, 14. November 2014

BigBen Gamegrip STG-ONE

Since I hate playing most games with touch screen controls on my phone or tablet, I got myself the Bigben BB325928 STG-ONE Tablet Game Grip (iOS, Android) schwarz .
Hardware wise, it seems to be mostly quite nice. The phone/tablet holding mechanism can fit anything between around 13cm-29cm. Even my Sony Xperia Z1 Compact fits, even though it is slightly to small and therefore not firmly in place. But there is no danger of it falling out of the mechanism in normal use (not playing with the gamepad on its head).
The analog sticks and buttons have a nice feel to them and the analog sticks are at a perfect position for my (normal sized) hands. The 4 buttons and the D-pad on the other hand are to low to be comfortable in a normal position. If you grip the gamepad lower, you can easily use them though. But in that position you can't really use the analog sticks or the triggers well. So if a game requires both at the same time, it could be rather difficult and painful after a while. But since I haven't had the chance to really play with it yet thanks to the software/firmware (more on that later), I can't really tell yet.
L1 and R1 are normal buttons, but the triggers L2 and R2 are pressure sensitive even though they feels like normal buttons with a clear pressure point. If you press really carefully at the bottom tip you can control the amount, but it is really difficult. In addition to that, it doesn't work with the right trigger on my device since it seems to be defective and only after a clearly felt and heard jump of the button, the press is registered as it should (at least hardware wise...).
The Analog sticks are clickable as well. There are also Start and Select and a Home key(which turns the device on and off and starts the pairing together with start) and a slider for the 4 modes.

And now to the software:
The pairing via bluetooth worked mostly without any problems on my Z1 Compact running a rooted Cyanogenmod 11 (android 4.4.4). But from there it is a hard battle. In the Android(2) and Keyboard(3) mode, I can't get anything to work with the official APP. If I enable the STG-ONE IME, an error message appears but otherwise there is no clue why nothing is working.
At least in HID Mode (4), the Gamepad is working... Mostly...
The 4 main buttons are messed up in their arrangement which leads to a bad layout in most games. The right Analog stick is also incorrectly recognized and further messed up through the triggers. Games (I tested with Goat simulator and Limelight root and some PC games) think the triggers control the Y Axis of the left analog stick etc. So playing games like that is mostly impossible. Then I tried Tincore and other similar apps, but they are really complicated and full of bloat I don't need anyway.
So after some research and hours of testing, I present you with an easy fix for the button layout (on rooted devices):
 Create the file /system/usr/keylayout/Vendor_0e6f_Product_0201.kl with the following content:


#This is a key layout file for the BigBen Game Grip to make it work correctly in HID mode.

#Buttons
key 307   BUTTON_A
key 306   BUTTON_B
key 305   BUTTON_X
key 304   BUTTON_Y
key 310   BUTTON_L1
key 311   BUTTON_R1
key 314   BUTTON_SELECT
key 315   BUTTON_START


# Left and right stick.
axis 0x00 X
axis 0x01 Y
axis 0x3 Z
axis 0x4 RZ

# Triggers.
axis 0x5 split 0x00008000 LTRIGGER RTRIGGER

# Hat.
axis 0x10 HAT_X
axis 0x11 HAT_Y
 Now after a reconnect of the device everything should work as intended except for pressing the Analog sticks (They don't send any signal in HID mode) and pressing both triggers at the same time since they are interpreted as one axis. And after trying for hours to find the right split value for it just by trying hundreds of different ones, I don't have the energy or knowledge left to fix it.

Dienstag, 9. September 2014

TP-Link Archer C5 with OpenWRT

Since I couldn't find any real information about the C5 running OpenWRT in English or German apart from some commits to OpenWRT enabling the support.


Some infos about the router:

I bought the TP-Link Archer C5 AC1200 WLAN Dual Band Gigabit Router (802.11b/g/n/ac, 1200Mbit/s, 4x LAN, 1x WAN, 2x USB 2.0) from Amazon Warehouse Deals for 67€
Right now it is the cheapest AC router with OpenWRT support I could find apart from one without Gigabit Ethernet.
The hardware of the C5 V1.2 is nearly identical to the C7 V2. Apart from the claimed max speed, I couldn't find a difference.

Installing OpenWRT on the Archer C5:
I just followed the instructions for the C7 and used the provided C5 .bin file instead of the C7 one.
That's it. Everything C5 specific works out of the box, including the 5Ghz WiFi.

Configuring WiFi:
I had some minor problems setting up the wifi through LuCI.
1. Because I saved the router password in Chrome, my WPA2-Key was overwritten with the password every time I changed something. Deleting the password in Chrome solved it for now.
2. After I chose the Auto channel, the 5GHz wifi wouldn't start. Even changing the channel didn't help. I had to edit the channel in the config file by hand.

Country Code:
Because of some laws the country selection isn't working by default.
To unlock the allowed channels for your country, you have to use the reghack.
This is rather important for my case because there are many wifi networks around, but none of them are channel 12-14 and the one on channel 11 is rather weak.
Afterwards I changed the country to world to test what the router is capable of:
2.4GHz: 25 dBm /   316 mW  Choosing anything above 25 dBm results in 25 dBm
5GHz:    30 dBm / 1000 mW which is also the maximum allowed in Germany at some frequencies

Speed:
Because I'm rather limited by my other wifi products right now, I can't really test the max speed, but I can compare it with my previous router, the TL-WR1042ND with some huge 8dBi antennas:

Sony Xperia Z1 Compact and Asus Nexus 7 (2013) LTE : I could finally replace the top results in the Speedtest.net App which I got over LTE (88Mbit/s) with WiFi results (98Mbit/s). With my old router, I only got around 50-60Mbit/s. iperf results are above 100Mbit/s as well

TP-Link TL-WN821N Netzwerk W-LAN USB Adapter 300 MBit: At around 150Mbit/s it should be around the same as before.

HP Chromebook 14: ~200Mbit/s

These results are from a quick test I did between the various devices and 2 Computers connected over Gbit Lan (which provided around the full 1Gbit/s of course). I will have to do further testing when I have some time since the testing environment wasn't constant across the tests at all and the iperf values aren't really accurate because I didn't write them down or save them, so they are just what I remember.

Range:
The range is a bit better on the 2.4Ghz band than before, but not really much. The 5GHz range is nearly as good as the 2.4GHz range in my flat. But only after I fixed the country setting and set the TX power to 30dBm.

So in the end I'm quite happy with the router so far. Right now I don't have time to do more stuff with it, but if you have any questions, then don't hesitate to ask me.

Freitag, 5. September 2014

What this Blog is about

Over the last couple of years I have done quite a bit of cool things with technology. Sometimes it took quite a bit of research to get the information that I needed so I sometimes posted the results on various forums to help others with similar problems and to have a guide for myself to repeat the project. With this blog I want to collect most of those projects and I will add more over time.
I'm from Germany and German is my mother language, so please excuse my English and don't hesitate to ask me something in German. Since most of the tech world uses English, I decided to use it rather than German which most people can't understand.