This post is mostly a note for myself, but might prove useful for other also. A while back I bought a security camera to my home from Dealextreme. It was typical Chinese quality with strange translations and weird software but worked nevertheless. I decided to buy another for my company and chose this model again from Dealextreme and thought that it’s the same camera with updated resolution. I was very wrong, this time the cameras internal software was so buggy that it almost made it unusable. The camera has no brand or name or anything, but the manufacturer is probably Wansview.
List of workarounds:
- Searching camera from the network
- Tool for OS X does not start in Mavericks, use Windows version (h_search.exe)
- Allow plenty of time for camera to start before trying to find it
- Web interface
- The cameras web interface seem to only work in old IE versions. I had success with Windows 7 and IE 9
- ActiveX component needs to be installed from the first page
- Without Windows, the problem is that the alarm page does not work and thus the alarm limits can’t be set. However by looking at the page source, it’s quite easy to see what kind of request needs to be sent to camera to set the alarm if you don’t have or can’t use Windows.
On alarm page, ftp upload is greyed out. To enable it you need also select “save video to sd-card”, even though the camera does not have sd-card
On ftp-page, ftp directory path must start with dot (‘.’), otherwise the settings wont get saved.
On alarm page, only video uploading can be selected (even though I have never seen the camera to actually upload videos). There’s a hidden selection to allow camera to upload also pictures. Enable it by opening url: http://IPaddress:port/cgi-bin/hi3510/param.cgi?cmd=setmdalarm&-aname=ftpsnap&-switch=on
- Viewing pictures
- You can snap picture by opening url: http://IPaddress:port/tmpfs/snap.jpg
- Useful resources
I recently switched from Sports Tracker to Runkeeper, because the latter one offers integration with the Pebble smart watch. However both of those refused to work with my Polar heart rate sensor so I ended up with Endomondo. I wanted to keep the Pebble integration, but apparently even though that there are few threads in the interwebs requesting this feature, it does not seem to be in the list for now.
Endomondo does not offer any API to query information, but I noticed that when it’s not the active application it posts a notification with some very useful information. Since I heard that it’s possible for Android application to catch the notification messages posted by other programs, I decided to write my own adapter for Pebble.
It proved to be quite difficult to extract the sent information since it’s wrapped into RemoteView object, which does not provide any useful way to tinker with its contents. Finally I found an example from the Stack Overflow which gives an example how do this. Unfortunately the only way seems to be using introspection which is never recommended but seems to work.
The application gets the following information:
- Duration of exercise
- Calories burned
- Heart rate
The information is sent to Pebble’s built-in sports application, so no extra application slot is used from the watch. Unfortunately the watch app is not customizable. It has a display for pace and speed and neither of those is available from Endomondo, so I’m reusing those fields for calories and pulse. User can toggle between these numbers by pressing the middle button on the watch.
The watch application will start automatically when Endomondo starts pushing notifications. The included Android app only displays some instructions and is required by the Play store. The actual program runs as a service on the phone and it needs to be given access to application notifications from the settings menu.
Application source code is available here: https://gitorious.org/pebblemondo
Installable application is available from the Play store against small support fee: https://play.google.com/store/apps/details?id=com.jannem.pebblemondo
Disclaimer: This application is not associated with Endomondo® or Pebble®
As a good friend of mine, Ville Kotimäki (who is also an excellent photographer btw) just finished his PhD, some figuring out some present to give was in order. I got an idea to machine some really solid piece out of aluminum and engrave it with text. I also wanted it to play something, as it seems to be a recurring theme for me.
The initial idea was to build a fire alarm siren inside an aluminum container, which would be welded shut and would only have ON button, but no means to turn it off. The idea was shortly scratched because also I would have to listen to it. The second iteration was to make the container read out the thesis like an audiobook.
Fortunately I managed to recruit my friend Heikki to do all the laborious tasks. We started by downloading the thesis pdf. The pdf was converted to text and Heikki did they most annoying part of the project by cleaning the text files from badly converted items like equations, picture captions and tables etc. In the meanwhile I tried a few different speech synthesis programs. I would have liked to use some open source software, but most of them sounded like Stephen Hawking on a bad day.
The commercial Nuance was far superior to everything else I tried. Nobody seemed to have a license for it but there is a nifty feature in OS X that it has text to speech support by Nuance and from system preferences menu you can even download additional voices from Nuance. Heikki proceeded to write a script, which splits the text file to single pages. These pages are then converted to speech with “say” command in OS X and resulting AIFF files are converted to WAV files suitable for wav library we used in Arduino.
The container itself was first drafted on a piece of paper. The measurements were dictated by the speaker we used (diameter 66mm) and the fact that on the inside there are speaker, 9v battery and power switch on top of each other. My brother machined the container shape from solid aluminum with a manual lathe from the drawing. Engraving and machining of the legs and drilling the bottom to let the sound out was designed with Alphacam software and machined with Haas UMC-750 5-axis machining center at my company G-Tronic.
I thought the engraving would be an easy job with Alphacam , but it turned out that the post processor which generates code for the machining center from cad drawing had a few nasty bugs resulting the tool occasionally to go through the work piece. Eventually I had to resort the help of professional machinists at the company, but (or because of that) the finished product looks great! The black effect on text is achieved by coloring it over with a black sharpie and wiping it over with a tissue dipped in acetone.
The schematic for the device is really simple. SD-card is connected in parallel with ISP interface to ATMega328p. Since SD-cards operate with 3.3v voltage, LM328 regulator drops voltage from 9v battery to 3.3v. BC547 transistor acts as a extremely simple audio amplifier, switching 9v voltage to speaker commanded by processors pwm output. Not and audiophile solution but works surprisingly well in this case. Since Heikki wanted to learn some electronics, I just drew the schematic in Eagle and left him the job of figuring parts arrangement on the stripboard and soldering the parts together.
We had a great trouble with the first version. We tried to use LD1117V33 fixed voltage regulator. When measured, it outputted solid 3.3v but the ATMega just would not start to execute the code. The thing worked without problems when powered with PSU. Only explanation I can think about is that the regulator starts to oscillate, but when we checked the output with oscilloscope, there was nothing obvious visible. In the end we exchanged the regulator with trusty old LM328 and the problems went away. The circuit draws about 170 mA, which translates to roughly 3h of usage from 9v battery, but we figured out that no sane person wants to listen this for more than couple of minutes at the time. Note that the connector SV2 pinout is not the same than SD-card pinout! For example how to connect the SD-Card to avr, see here.
The firmware itself is quite straightforward, the only difficulty was the user interface since there is only a power button and we did not want the device to start at the beginning of the book each time. We also wanted a couple of different voices to read the book. On the SD-card, audio files are saved with file name pattern <page (number)>-<voice (number)>.wav. When the device is turned on, it randomizes one of the three voices to use. Each time it finishes playing one page (one file), it saves the next page number to eeprom memory. When device is turned on, it starts to play from the saved page. If the device is turned off before it finishes to play back one page, the counter resets to the beginning of the book. There’s even a nifty page turn sound saved in every other file.
When we initially tested the setup on Arduino UNO board, we used TMRPCM library. It worked well, but on the final hardware, we used the internal 8MHz oscillator instead of 16MHz crystal and found out that the library does not support other that 16MHz clock speed. We changed the library to superior SimpleSDAudio, which enabled us to use 31.250 kHz sampling rate @ 8 Mhz. The library seemed also to have smaller compiled size, but that was irrelevant to us since we are only using 10k of 32k code space.
- Source, scripts and schematics are available at: https://gitorious.org/thesis-grenade
I was really happy with the finished device. Some Ville’s friend dubbed the device to “Thesis Grenade”, which is quite accurate by the looks of it =) The video below is a little bit repetitive, I tried to demonstrate the different voices used, but the random generator decided to use one same voice for many times.
I needed a tool that can play back recorded serial stream “in real time”, so that the playback perfectly reflects the stream that was originally sent. Rather than building my own, OpenLog project seemed to be a perfect starting point. The board itself is very small, about the size of a micro-sd socket that is on the bottom of the board. By default the device records serial data received to standard ftdi-pinout serial port. The device is Arduino UNO compatible and code can be compiled and uploaded with the Arduino IDE. The device is configured by editing CONFIG.TXT file on the sd-card. If the file is not present on the card, the device creates one with default settings at the startup.
Example of config file:
As you can see, I added the timestamp option at the end. If this option is enabled, each received byte in the log file is prefixed with 4-byte unsigned long timestamp. The timestamp is in little endian order and in milliseconds. Unsigned long type provides about 55 days before counter rolls over. The value can be decoded for example in python with struct.unpack function:
buf = f.read(4) timestamp = struct.unpack("<L", buf) char = f.read(1)
The logged files will be four times larger than without timestamping, but with large sd-cards this does not really make a difference. I quickly tested the performance and the device still seemed to be able to log the data without data drops at 115200 bps speed.
The python script that plays back the stream in real time can be found from the examples folder.
I’m using Samsung NX1000 for aerial photography. The camera has a nifty feature of using smartphone as a remote viewfinder and shutter release but unfortunately the good idea is watered by buggy and limited program and the feature freezes the whole camera all too often. Fortunately there is a simple way of triggering the shutter via cameras usb-port. The trick is to have 68K resistor between ID and GND pins. After this USB data lines can be used to trigger camera focus and shutter.
Tip: If you have spare micro-usb cables, it’s easy to source a connector from the cable that came with the camera. Just squeeze black plastic around the connector with a pliers and the plastic casing will crack open exposing the connector. The connector on the cable has a small pcb, which makes it easy to solder the required resistor in place. If you use smd resistor, the casing can even be reassembled.
The cable described above works fine for manual use, but to use the camera for aerial photography some interface for rc receiver is needed. Fortunately this is easily achieved with a small arduino program, which reads pwm value from receiver servo port and then pulls either shutter or focus line low based on channel value. The compiled code size is under two kilobytes, so it’s possible to use small and inexpensive microcontroller like AtTiny2313.
The schematics and sources can be found at: https://gitorious.org/nxshutter/nxshutter
Compatible with (at least) following models: NX20, NX210, NX1000, NX1100 and NX2000
As with other hardware in this blog, if you need one and don’t want to make one yourself, drop me a message and we’ll see what we can do!
Update: If you don’t want to make your own, I’m selling these ready made. Just drop me a message.
My usual setup when flying FPV is to have laptop running mission planner with image capture running. This works quite well, but forces me to stand in one place to see the picture, so I wanted something more mobile. I came across Procaster DTV-007 digital TV which at 45 € price is a real bargain. I wondered how to mount it with the controller, and my father came up with an idea to machine a mounting piece that would have a slot for the controller handle.
I drew the mount as two parts, first has a slot for Auroras handle and the second has t-slot for the display. Parts fix to each other with two screws. The part was machined in G-Tronic, where they optimized the part to a single piece. Overall, I’m happy with the results, the mount is very compact and stable in use.
Since there’s now machining files for this part, the design can be replicated easily if someone should need similar part.