Marcin Barabasz

imagination is more important than knowledge… A. Einstein


Leave a comment

Cheap WIFI Switch review (KK-SP3)

20150625_22135520150625_22141020150625_22142020150625_221349

This time I would like to share my experience of a cheap Chinese wifi switch that i bought on Ebay for approx. 16$, plenty of sellers offer it. It is advertised to be able to operate from mobile phone via dedicated app. I was really hoping I wouldn’t need to use it for anything more than configuring connection to my home wifi:).

After receiving the package after few weeks from ordering I was really surprised how good it actually looked. The only drawback was the need to use power switch adapter – but it is not that bad since it is hidden under the switch when plugged in.

After connecting the switch to my home wifi using dedicated android app (There is a manual included). I could indeed turn the device connected on and off – it did it’s job pretty well, but that was not a main purpose I bought this device.

After a little googling I was able to connect to it via ssh.

username: root; password: p9z34cCapture

It turned out that it is actually powered by Linux koven 3.10.26 – very nice indeed – always good to see some familiar interface. This distribution is of course very limited to fit this small device but anyway great to have another Linux device at home.

The next thing was to be able to interface the switch over some well recognized channel- like REST for example.

Here is how I did it (from linux prompt):


mkdir /www/cgi-bin

chmod 755 cgi-bin

Download a cgi script from link and put it to cgi-bin directory.

After that you should be able to control the switch with using:

http://192.168.1.13/cgi-bin/relay.cgi?on

http://192.168.1.13/cgi-bin/relay.cgi?off

(replace 192.168.1.13 with the ip of your kankun)

Using this few small steps I can now utilize this switch in my home automation solution. It will be a topic of a separate post so stay tuned.


Leave a comment

Electric longboard

20141212_081440

20150623_215302

20150623_215326

I got this idea of making myself an electric skateboard after watching one episode of a gadget show in polish TV titled “Nowy gadżet” where presenter was enjoying electric skateboards made by Tesla Boards. His experience was great, but there was one problem – the price. At that time the cost of the board was around 4000 PLN which is around 1000 euros. After little bit of digging I have found loads of other manufacturers who sold assembled boards, and also kits allowing to convert your traditional board to an electric one. Unfortunately all of those were still beyond the limit I would be willing to spend for this gadget. After even more digging I have found few instructions how this was build by amateurs one really caught my attention link. The guys goal was to come down to around 300$ which is pretty good for me as well. Then I have decided I will try to make similar project. Actually the other project is very well documented and should be a must read for anyone willing to build their own electric long board. I got all needed components from HobbyKing for about 270$ including shipping, that did not include pulleys and belt, that I have found in one local manufacturer ebmia. The prices were very affordable. Next step was to modify pulleys and create a frame for the motor. Unfortunately I don’t have neither mill nor lathe so I had relay on outsourcing this task to someone else. Politechnika Wrocławska was my choice, also in case of welding it all together – the prices of all this was around 50$ in total. My biggest concern was of course welding, since it is aluminium, and I had no idea which type of aluminium the trucks were made of, some are not weldable at all. Finished frame with motor already mounted looks like this:

20141114_193002

As for battery and all electronics I had an idea of using an old HDD drawer. I thought it would be cool to be able to have a spare battery in a backpack to extend the range. I however abandoned this idea after realizing that first of all I wouldn’t probably need this extra range, second the whole rack was a bit too big. I have ended up using just a drawer.

20141019_184948

20150221_140057

20141211_220516

Putting all things together was really no more than one evening job, The next day I had to try it out so I did. The experience was just awesome. It was even better than I imagined it to be. First runs were smooth and carving without the need to kick was just great. When I first used the board I didn’t have much experience with LiPo batteries, and wasn’t really aware how important it is not to discharge them below certain limit. Unfortunately I used the board a little bit too much without knowing it and I went below that limit. Not only I had to come back home on foot (around 7km) but also I completely damaged one of the batteries (it got swollen and couldn’t be charged anymore). I had to pay my price for being hasty.  After I ordered and received a new battery I invested also in voltage meter and set the limit to 3.5V per cell. The meter starts beeping when the limit is reached and this is definitely the time to stop.

20150425_130417

Charging the batteries is quite convenient. I use IMAX B6 charger and a balancing port. This protects battery from overcharging any of the cells which is not very healthy for the battery pack. The charging does not take long – I usually set the current to 3A and then charging takes around an hour. Of course I had a small issue with charging as well. When I wanted to charge the board fast I set the current to 3 A, having 5A power supply. I thought I was save, but didn’t think that the power supply gives only 12V, and battery pack is 22.2 all together. This resulted of course in frying power supply. Fortunately it was cheap, now I use a server salvaged  power supply (thanks to my colegue) , that is capable of providing around 50A which is plenty to spare.

Traditionaly a movie of a board in action here


Leave a comment

Baby carousel

I read somewhere that babies up to two months struggle to recognize colors. Another fact is that babies prefer watching faces above all – Since it was a bit hard to find a proper carousel that would be both black and white, and have front faces “looking” down I’ve decided to do my own. My beloved helped me with that – the materials were just old T-shirts. A little fun project to do in your spare time – I liked it even more since my machine sawing skills were getting bit rusty recently.

 

As for attaching the “faces” I used regular wooden black hanger, and a fishing rod 🙂 The final product is a bit funny, but my daughter seems to like it very much. whenever the faces are there she just can’t stop looking at them.

enjoy


Leave a comment

Useless box

When I saw it for the first time I knew I was going to build one myself.

Part list:

– Wooden box (I got it for 14 PLN in http://www.empik.com/)

– ON-ON Switch

– Servo (I used cheap Chinese servo from ebay – you can get one for as little as 2$ with free shipping)

– limit switch

– 2AA battery holder

– some wires

– PCB laminate

– Glue gun

– solder

I got electronic parts from local DIY shop for 5PLN total.

First thing is to reassemble the wooden box so that the hinges are on the other side (the box should open lengthwise instead of width wise). Then cut the lid so that both parts are separated. The lid should be cut with less angle so that it closes freely.

Next you need to do is to remove electronics from servo, and limiting pin as well if it exists. The end product should be servo with two wires connected straight to motor.

Next you need to wire things together. It is really not that hard – and nice exercise. The end goal is to have servo rotating in one direction until limit switch is pressed and when ON-ON switch is switched the servo should start turning in other direction that’s it really.

Actually the most tricky part is to attach servo to the box, and construct the arm so that it will open the box and turn the switch. After few failed prototypes made out of cardboard you should get it right. The final piece is made of PCB laminate.

At the end just attach the ON-ON switch to the box and your useless box is ready!

My working piece looks like this http://youtu.be/zVWqqiD8Rmk

 

enjoy

 

 

 


Leave a comment

Kindle holder

This time something really small – but handy. It’s literally just 12×1 pvc pipe cut the way illustrated. It makes a perfect, very stable Kindle holder. There are two furrows, one with greater almost 90 degrees and one smaller angle. It is possible to put your Kindle in them both horizontally and vertically (the Kindle buttons are not pressed accidentally). It is very good to use this with kindle page turner 

enjoy

kindle_holder2kindle_holder


22 Comments

Kindle remote page turner

Today I would like to write few words about a somewhat strange project I did. The need came from the fact that I was quite ill lying in bed for substantial amount of time with problems to move because of sores. I wanted to read something on my Kindle. I found it quite irritating to be forced to move my hand every minute or so to turn the page. I almost immediately thought, come on, there must be a smarter way to do it, and I came up with an idea of a remote page turner for kindle.

But how could that be done? One obvious choice is solenoids mounted on page switchers – but, hey, its the 21st century already. That would not be cool at all. So, the next choice is to hook up to the kindle’s usb port, but the problem is that the kindle works as a slave, not as a host – attaching any HID devices to its usb port is not really possible. USB is out of the picture. After searching the internet, I found that Kindle also has a serial interface. Unfortunately, it is not available unless you open it and solder the port yourself (even though I have done things like that in the past I certainly didn’t want to do it now) there has to be another way of approaching this problem. And finally I got it. WIFI 🙂 – Why didn’t I think of it in the beginning?

Ok, so WIFI, but how can I connect to my kindle using WIFI? Tt is the kindle that connects to the router. Maybe it would be possible to somehow connect (via ssh) to kindles IP address and send commands that way. That was the idea, but, as it turned out it wasn’t that straight forward after all – but doable! 🙂 after figuring out different bits and pieces I was able to ssh to my kindle from a pc great! That’s a big step. Sending commands that would imitate keystrokes should not be that hard since it’s all Linux under the hood. Few internet searches later I got the answer:

[root@kindle root]# echo "send 193" > /proc/keypad
[root@kindle root]# echo "send 191" > /proc/keypad

Et voila – those are the commands for turning pages forward and back respectively. I still I need a pc to connect to my kindle via ssh and send those commands. It doesn’t bring me any closer to the goal of being able to turn pages remotely, or at least without any large movements. The solution was to write an android app that does all that, and the actual remote would be a wired audio remote attached to my Samsung’s headhones. After maybe an hour of searching the internet, and another half hour of actual coding, I had an Android app in place and ready to operate. It is very rough and could probably be improved in almost every aspect, but it does its job perfectly. I can now lie in bed holding my wired remote between my fingers and read my kindle – isn’t that awesome?

There is still the possibility to go completely wireless with something like a bluetooth camera shutter, but I think that the first solution is good enough.

 P1200942 P1200940

Here you can see the assembled piece in action:  http://youtu.be/hb3-mywNwF4

Android application code available there: https://github.com/mbarabasz/KindleTurn

Steps:

1. Jailbreak Kindle

2. Install USBNetwork update

3. Enable SSH over WIFI

4 Test out commands to turn pages via usb link

5. Write Android app to listen to remote commands and send commands to Kindles ssh server

Links:

ssh lib for java

http://wiki.jsch.org/index.php?Manual%2FExamples%2FJschExecExample

kindle rooting and getting access to its ssh

http://wiki.mobileread.com/wiki/Kindle4NTHacking#Debricking_.2F_Un-demoing_.2F_Flashing_firmware

http://www.turnkeylinux.org/blog/kindle-root

http://blog.joschika.tk/2012/03/01/kindle-4nt-ssh-over-wifi/

http://members.ping.de/~sven/kindle.html

http://www.shatteredhaven.com/2012/11/1337365-ssh-on-kindle-4-usbnetwork-hack.html

UPDATE (17/08/2014):

Just few days ago I finally received my remote shutter for Android and iOS. It is a pretty cool device even if used for its original purpose. As stated in the previous post I was intending to at some point to “go completely wireless” and having remote shutter would make it possible. So here we go:

This is exactly how my device looks like. I bought it on ebay for just over 3$ with free shipping (it took almost one month to arrive but still it is a good deal).

remote_shutter

After connecting device to my phone over bluetooth (which was dead easy, just pair devices) it was recognized as a bluetooth keyboard. I opened my camera app and it worked straight away I was able to take pictures with it (small android buttoe n). Of course I was curious about the bigger button, it would be cool to use it as FORWARD in this project where as the small one would fit for PREVIOUS perfectly. When pressed in home screen it is putting volume up – brilliant.

After quick modification of Android app I wrote, changing the keys that should turn the pages and adding possibility to modify kindle’s ip, kindle’s username, and kindle’s password. I was good to go for a first test. It worked!

As for the usage – it works pretty much perfectly, it is quick and reliable. The range is sufficient as you still need to see the Kindle, so1m is more than enough (I haven’t tested it but it should do at least 5m). There is one remark I need to make thou: The shutter turns itself to power preservation mode after around one minute from last usage – this means you need to read at least one page per minute to keep it up, which shouldn’t be a problem for a typical person. Pressing the button after that time takes around 3s to reconnect and then turns the page, I think it is acceptable.

The modified code can be found in github. At some point I am planning to put it to Google Play (even got developers account for that purpose), I am a little concerned thou since getting this setup to work requires few extra steps and some basic understanding. Stay tuned.

Wireless version in action: http://youtu.be/DCK1khQHFfE