Ivo's blog

Hacks, code and random thoughts

Marmitek IP Robocam 8 (wireless) == TRENDnet TV IP400W

written by ivo, on Oct 25, 2009 3:40:00 PM.

I bought a Marmitek IP Robocom 8 wireless (which also supports wired networks) about a year ago. It seems to be discontinued by Marmitek by now.

I've been researching if there are any interesting firmware upgrades or other (OSX) software available, but Marmitek doesn't supply any. However, I found out that the camera is basically a TRENDnet TV IP400W camera in a different encosure (and slightly modified firmware). Or, alternatively, they're both based on the same (unknown) OEM hardware/software.

In case you ever need anything for this camera (software, software support in software, etc), it may be good to know it's essentially the TV-IP400W. I haven't tried the IP400W firmware on my Marmitek but it just might work.

Some stuff I found:

  • TV-IP400W emulator. Really similar to the Marmitek. Some pages that are missing on the Marmitek (i.e. /About.htm) can actually be subsituted by hand
  • TV IP400W software, including firmwares. More recent than the "3.25" that the Marmitek has.
  • GPL sources. The 410W is listed but eventhough similarities (and similar version number) I don't think the IP400W is running any sort of linux.
  • Reverse-engineerd details
  • Another member of the family: NCS-370W
  • Get the cam to work with ZoneMinder, by Peter Hulst
  • Stil no decent OSX support

Better flash video playback on Linux (Ubuntu)

written by ivo, on Oct 24, 2009 3:40:00 PM.

I'm currently looking at some Google IO android talks on youtube and I was annoyed by the fact that eventhough I have a brand new core2duo 2.4ghz laptop, videoplayback was still horrible.

Eventhough this is Flash video playback as I know it I had a look of there are any known solutions. And there are!

1. Create an /etc/adobe/mms.cfg containing 

OverrideGPUValidation=true

2. Install a CPU frequency monitor and adjust your cpu speed settings.

 

Step 1 was sufficient for me to fix my problems and have an (almost) smooth playback, but forcing your CPU into a higher speed may sometimes also be a good solution.

 

Links

http://blogs.adobe.com/penguin.swf/2008/08/secrets_of_the_mmscfg_file_1.html

http://allredb.wordpress.com/2009/05/07/speed-up-flash-and-firefox-in-ubuntu-jaunty-904/

http://webupd8.blogspot.com/2009/07/speed-up-flash-and-firefox-in-ubuntu.html

Samsung Galaxy i7500 review

written by ivo, on Sep 21, 2009 6:50:00 PM.

I recently purchased a Samsung Galaxy i7500 when it became available in the Netherlands. It's already been available in Germany and (I think) the UK for a while so it's not even that cutting edge.

In this posting I'll document some of my findings.

First Impression

My first impression which also includes working with Android for the first time was: what an amazing device! The included applications are fantastic, especially with the included hardware and this finally is a device which I can use to chat, mail, consult google maps and surf sites. I've heard people complain about battery life and (keyboard) slowness, but those are okay with me.

I was actually surprised how well the on-screen keyboard works.

However

I was so focussed on the software and gadgetvalue of the device that I didn't pay any real attention to calls. And that's an area where the Galaxy behaves horrible.

  • Sometimes the remote party becomes siltent for a fraction of a second during a conversion. Very annoying because you'll miss parts of words. I understand it's both ways, I've heard the remote part complaining I was interrupted by silence
  • Sometimes it can't make or receive calls. I can't really define what the problem is - poorer T-Mobile reception perhaps, possibly combined with all the onboard hardware. Or just buggy hardware/software. It's hard to say
  • The screen dimms a second after you've made a call which is very confusing. I'm still not sure if it's some feature, just the screensaver/lock kicking in or something else. But if you need to enter numbers or access the menu, it's very confusing

I've attempted to do a firmware upgrade but eventhoug it's reported there are updates, there isn't one for my version. It may be I just don't understand Samsung's horrible "Samsung PC Studio" which, eventhough it's the only available download for the Galaxy, doesn't recorgnize the device without some serious tweaking (and even then I'm not sure). 

Besides the pretty big call issue above, there are some minor issues

  • it doesn't always find local wireless networks. Excplicitly searching the network and connecting to it will result in a password not accepted. The fix? Reboot the device :(
  • the gallery sometimes shows good pictures as being damaged. Restarting the app fixes this (the pictures really aren't broken), eventhough, when I didn't know the pics were okay, it made me delete pictures that were actually perfectly fine.

 

Conclusion

The Galaxy may have slightly better specs/looks than the HTC Hero, but for now I'd chose a phone that can actually make calls. Either wait for updates from Samsung, new Android devices or buy a Hero, but at this point I wouldn't advice anyone to buy the Samsung Galaxy i7500

 

Update

It appears most calling isses are caused by poor T-mobile reception. Switching providers fixed most of these.

After using the device for a couple of months, I find it usable. There still are very annoying bugs (wifi, e-mail, dialpad doesn't respond while calling). Also, by now, Android 1.5 is really old, and it's still not clear if there will be an update.

quick hack to unit-test a browserview that depends on plone.protect

written by ivo, on Jul 30, 2009 3:50:00 PM.

Plone provides the plone.protect.authenticator view to protect against Cross Site Request Forgery (CSRF).

However, this makes unit-testing such code slightly more difficult. I'm currently using the following hack, if anyone can point me to a better direction.

Imagine a BrowserView Foo with the following __call__

class Foo(BrowserView):
...
    def __call__(self):
        ...
        authenticator = self.context.restrictedTraverse('@@authenticator', None) 
        if not authenticator.verify(): 
            raise Forbidden
        ...

Essentially, this means you need to provide the correct _authenticator formvalue in self.app.REQUEST.form in your unittest. The following method handles this:

    def _getauth(self):
        import re

        authenticator = self.portal.restrictedTraverse("@@authenticator")
        html = authenticator.authenticator()
        handle = re.search('value="(.*)"', html).groups()[0]
        return handle


You can use it in your test as follows:

    def test_foo(self):
        self.app.REQUEST.form['_authenticator'] = self._getauth()
        foo = self.portal.restrictedTraverse("@@foo")
        foo()

 

Works for me! (at least for now)

 

Full text-based document generation using asciidoc and ditaa

written by ivo, on Apr 23, 2009 11:01:00 PM.

I'm not a big fan of wordprocessors like OpenOffice.org or MS Office for writing technical documentation. I always end up focussing on how things are outlined and styled instead of the contents. Especially with technical documentation, content and structure are more important (in my opinion). Also, I like typing text in Vim :)

That's why, when I recently had to write documentation for a project, I went searching for a structured text based solution . After asking around a bit, asciidoc seemed to be a good option. There are many structured text solutions for the web, but only a few that will work standlone from the commandline (and support conversion to multiple target formats).

Coincidentally, I ran into "ditaa" which converts ascii linedrawings to png diagrams. Combining these two would mean I could do everything from within a single document that, by itself, remains perfectly readable but also renders nicely to HTML and PDF (and, therefore, print).

Combining the two required a small pythonscript that acts as a filter. It parses your asciidoc document and scans for '[ASCIIART ..]' and '[TRAIICSA]' markers. Everything in between is fed to ditaa, and an asciidoc image reference is included in the filtered document, which can then be passed to asciidoc for forther processing. You are required to supply a filename which will be created and included, and you can optionally supply arguments between parenthesis which are passed directly to the asciidoc image: markup. By default, this means the title for the document.

I.e. the following markup:

 

= Sample =

- look at the nifty
- drawings!

[ASCIIART sample.png (Sample drawing)]
/----------\  /--------\  /---------\
| asciidoc |  | mumble |  |         |
|    +     |->| mumble |->| PROFIT! |
|  ditaa   |  | mumble |  |         |
\----------/  \--------/  \---------/
[TRAIICSA]

Will result in the following asiidoc markup after filtering

= Sample =

- look at the nifty
- drawings!

image:sample.png[Sample drawing]

which will render to the following HTML (somewhat scaled)

 asciidoc ditaa

The script ("handleimages.py") is rather trivial and doesn't handle errors too well (actually, not at all). But for me it gets the job done.

#!/usr/bin/env python
import sys
import re
import subprocess

header = re.compile("\[ASCIIART\s+(\S+?)\s*\((.*?)\)?\]")

def main(document):
    parsed = []
    parsing = False
    filename = ""
    worklist = {}
    for line in document:
        if line.strip().startswith("[ASCIIART"):
            filename, flags = header.match(line).groups()
            if flags:
                flags = "[%s]" % flags
            else:
                flags = ""
            parsed.append("image:%s%s\n\n" % (filename, flags))
            parsing = True
            worklist[filename] = ""
        elif line.strip() == "[TRAIICSA]":
            a = open("/tmp/asciiart.txt", "w")
            a.write(worklist[filename])
            a.close()
            parsing = False
            job = subprocess.Popen(["java", "-jar", "ditaa0_6b.jar", "-o", "/tmp/asciiart.txt", filename], stdout=subprocess.PIPE)
            job.wait()
        elif parsing:
            worklist[filename] += line
        else:
            parsed.append(line)

    print "".join(parsed)

if __name__ == "__main__":
    if len(sys.argv) == 2:
        document = open(sys.argv[1], "r").readlines()
    else:
        document = sys.stdin.readlines()
    main(document)

Invoke it, for example, using the following script ("create.sh")

#!/bin/sh 

if [ "$1" = "" ]; then
  echo "Specify an asciidoc file"
  exit
fi

TARGET=`basename $1 .txt`.html

./handleimages.py $1 | asciidoc -d book -o $TARGET - 

There's probably some plugin/extension system for asciidoc that I can use for a cleaner, tighter integration. But as I said, for now, this gets the job done.

 

Siemens sx762 wlan dsl router experiences

written by ivo, on Mar 15, 2009 3:04:00 PM.

My ISP recently sent me a Siemens sx762 wlan dsl modem with voip support. it replaces the ATA voip box they previously provided me which is suffering from too much echo on certain calls.

It looks like a decent, pretty functional modem which a rather decent webinterface. After testing/poking it a bit more I found the following:

It runs Linux. Nmap reports the following:

PORT     STATE SERVICE
22/tcp   open  ssh
53/tcp   open  domain
80/tcp   open  http
443/tcp  open  https
5555/tcp open  freeciv
8080/tcp open  http-proxy
MAC Address: 00:21:04:43:6E:8A (Unknown)
Device type: general purpose
Running: Linux 2.4.X
OS details: Linux 2.4.28 - 2.4.30
Uptime: 3.772 days (since Wed Mar 11 21:35:03 2009)
Network Distance: 1 hop

Additionally to the ports listed above, it also listens to port 8085. More on this later.

If it runs Linux, Siemens should provide the necessary sourcecode and licenses. You can find this here (found on the net, not my router's info).

The first interesting thing is port 22, ssh. It appears you can ssh into the device using 'administrator' as username, and the password you use for the webaccess. This will provide you with a restricted management shell. You can find a complete overview of all information here.

If you look in detail at this file, you'll see the following:

 

ManagementServer.URL = http://tsm.topit.nl:1111/ACS-INTF 
ManagementServer.Username = 000000-CPE-000000000000 (cleared)
ManagementServer.Password =  
ManagementServer.PeriodicInformEnable = 0 
ManagementServer.PeriodicInformInterval = 240 
ManagementServer.PeriodicInformTime = 0001-01-01T00:00:00 
ManagementServer.ParameterKey =  
ManagementServer.ConnectionRequestURL = http://n.n.n.n:8085/CPE-ACCESS (ip removed)

I'm not really sure what this does. It looks like some sort of remote management support. I'm not sure if the modem is somehow able to "call out" (to tsm.topit.nl in this case). Additionally, an extra service appears to be running on port 8085 (which is unfiltered).

Port 8085 seems to be running "RomPager Advanced Server", as far as I can tell an embedded web-based management server. I haven't been able to access it though. Perhaps this is a remote management option for my ISP, but it does scare me a bit. The "normal" management user interface also appears to run on the RomPager server, but url's are different.

Issues

As said before, the modem works well, except for one issue: It doesn't properly register a hangup. If I call my cellphone and hangup before I pickup the cellphone, the cellphone will continue ringing (and eventually switch to voicemail, where two minutes of voicemailbox are filled with nothing). I haven't yet found a cause or solution for this.

I did find a relevant piece of logging:

... calling an umber (ending in 52)
Mar 15 13:56:46 Inf <EVENT>  FXS 1: Detected DTMF 5
Mar 15 13:56:46 Inf <EVENT>  FXS 1: Detected DTMF 2
Mar 15 13:56:51 Inf <EVENT>  Ept 1 : created stream 1 (coder 0)
Mar 15 13:56:58 Inf <EVENT>  FXS 1: Detected hook event 0x1 : onhook
Mar 15 13:56:58 Inf <EVENT>  Ept 1 : deleting stream 1 (coder 0)

So it does register the hangup.

 

 Stuff to figure out

  • are there options to escape to a shell? busybox seems to be included
  • what's running on port 443 and 5555? 443 doesn't behave like https
  • what's the purpose of port 8085 and what's topit.nl's role?