Low cost Flex Sensor for Arduino, and others

One of the sensors that can be attached to an Arduino, or other platforms, is the flex sensor.

These sensors allow, for example, with the movement of hand fingers to control servos, and are, in many cases,  attached to glove fingers.

But these might be expensive, and there are several alternatives available on the internet to make our own flex sensors.

Well, this is my cheap alternative, and it works just fine.

The material needed to build this flex sensor is:

- An LED, 3mm preferably. Any colour will do.
– An LDR, or light dependent resistor. I’ve just picked the one that came with my Arduino ebay kit.
– Two resistors, one of 220 ohm for the LED and other, might be 10K, for the LDR.
– Some water gardening opaque tube (black), the thin ones used in automatic sprinkler systems, but for vases.

The idea is simple:

Cut the thin water gardening tube at length, for example of one finger.
At one end will be the LED, stuck inside the tube. Now the resistor can be soldered right at this point or at some other place, like a control board.

At the other end, the LDR is placed and taped out with some opaque adhesive tape.

So the schematic is the following:

flexsensor

Not shown is that the LED is at one end of the opaque tube, and the LDR is at the other end. Simpler and cheaper than this…

Now if we connect power, and a multimeter at Arduino A0 point and ground, by flexing the tube the light reaching the LDR varies, and so the tension value at this point also changes.

With a lot of flexing the voltages tends to 5V, in this case, and if the tube is completely straight the LED lights up the LDR more strongly and so the voltage at that point might end with a 2V.

By swapping the LDR with R2, then lower voltage is more flexing and more voltage is less flexing.

The 10K resistor might need to be adjusted in function of the LDR used. In my case it works fine.

And now it’s easy to use this cheap flex sensor. Just connect the “Arduino A0 port” point to one of the analogue inputs of your board, and normalize and use the values to control whatever you want.

For bonus points, the LED at the tip, is placed at tip of the fingers, and so it gives the glove a more “cyber-punk” look :)

Soldering station – Aoyue 9378

Being done with pencil type soldering irons (fixed temperature, no changing tips) that I use for my electronics projects, and unable to use my current (now old) solder iron, due to is larger tip, for precision work, I started to look for a replacement.

Everyone talks good about the Hakko 936, Hakko 888 and Wellers, but these in Europe/PT, without being Chinese counterfeit copies, are pretty expensive, (around 200€/250$ mark) and are only available in Ebay, or other online retail stores in China or HK.

At the end I’ve bought an Aoyue 9358 soldering station.

Why?

Overall I’ve seen that reviews available are positive (see Amazon, for example).

It uses Hakko tips, or compatible Hakko tips.

It is not expensive. Around 60€

Replacement parts are available, if any thing goes wrong.

So, the review:

Static analysis:

It come nicely packaged. The station is heavy due to it’s large transformer, and construction seems solid. It also came with a replacement ceramic heating element. Regarding the design, beauty is in the eye of the beholder, but I thinks is ok. Maybe the font for the Aoyue trademark, could be a bit more modern…

The soldering Iron is light, and, at least for me, ergonomic. a very nice improvement from my older soldering iron. The cable connecting from the iron to the station might be a bit short, but enough, at least for me.

It came also with a soldering iron stand and solder stand in aluminium, nicely made. The holder allows the soldering iron to seat nicely, and in my case it has space for those irons with fumes extraction.

The tip provided is a conic 1mm tip, not ten tips like US customers can get on their package.

When on, the digital panel glows red.

Dynamic analysis:

After powering up, it heats up fast. Around 10s/15s to reach the target temperature that can be set between 200ºC to 480ºC.

I’ve tested it with lead free solder (Iron temperature set at around 350ºC) and lead solder ( at around 280º/290º).

It seems to keep and maintain the temperature during heavy soldering. Had no trouble soldering out in sequence a lot of DIP packages and connectors.

The station also has a sleep feature that can be activated that puts the iron to sleep if not moved for a while. We can ear the sensor on the iron if shaking it.

So overall a nice station with a nice price.

Apache Axis deployment on WebLogic and RedHat

Deployed in an WebLogic application server, that is running on RedHat Linux machines, I have some Apache Axis web services deployed. Version 1.6 for the record…

The issue with this combination, is that periodically people complained that the Axis web services stopped working, for no apparent reason….

Looking at the Axis and webservices log, it complained that some directories and files that Axix needed are now missing from the /tmp directory:

java.io.FileNotFoundException: /tmp/axis2-tmp-1781229799800844743.tmp/axis23357234725283571419sler.jar (No such file or directory)

It was a fact that indeed the /tmp/axis* directories where all gone, but nobody has deleted them…

A temporary solution for this issue was (because it’s solved for good now) to redeploy the web services that had the issue.

But that doesn’t solve the mystery of why the /tmp directory had files cleaned…

Well it’s simple: RedHat has on /etc/cron.daily a script to check for files that are on /tmp and had no access for more than 720 hours.

This script tmpwatch, was the culprit of deleting axis files.

So there are two permanent solutions for this:

1st) Change/disable the tmpwatch script
2nd) Move Axis temporary files to another location

Because I’m not the machine administrator, but the Weblogic administrator, I’ve choosed 2) and added the following option to the server startup:

-Djava.io.tmpdir=/opt/axis-tmp

Restarted the servers, and allas: Axis temp files in /opt/axis-tmp

Problem solved.

Rising from the ashes: NSLU2

Despite having a Synology Diskstation DS212+ for storing my data (photos, videos and PC/laptop backups), I also backup that data to an external disk connected to my faithful Linksys NSLU2 bought in 2005 using rsync from the Diskstation.

The NSLU2 is flashed ith the openSlug 5.3Beta firmware since 2009 (when it came out), with the operating system installed in a crappy 2GB SD card.

But this weekend due to a power failure, the NSLU2 failed to boot up. It kept the amber led blinking signalling that it couldn’t forward from the initial stages of booting up.

Using my desktop computer, I’ve FSCK’ed the external disk filesystem, that had some inconsistencies, nothing serious (most of the time it is dormant), and FSCK’ed the SD card, and, well, most of the /etc and /var directory where gone.

Due to having a backup of the SD card (these things die…), I’ve recovered the /etc directory, but still the NSLU2 didn’t boot.

Booting up without SD card, the NSLU2 did finish booting up, but it wouldn’t ping, neither the original IP address (192.168.1.77) neither the configured IP address. All I had on my Linux machine was incomplete at the arp table…

nslu2 (191.168.1.32) at <incomplete> [ether] on enp4s0f2

Not good….

I’ve flashed it again with the openSlug firmare, but still I was unable to ssh to it so I could initialize. Because I was able to flash it again with the upslug2 tool, it mean that the ethernet port was ok, and probably everything was ok, except the NVRAM settings that define the ip address where pretty much corrupted… Let’s hope that.

So the solution was to boot into RedBoot and erase the NVRAM (http://www.nslu2-linux.org/wiki/HowTo/ResetSysConf) with the following command: fis erase -f 0x50040000 -l 0x20000  (Attention to this command!!!! Don’t get it wrong)

And then upgrade from the RedBoot interface. The original Linksys firmware was flashed and after rebooting this firmware initialized the NVRAM with default settings: IP address 192.168.1.77, and bingo, ping works, and I can access the original Linksys Web Interface. On the web interface I’ve configured the old IP address, DNS, host name, and so on, and rebooted.

After reseting the NVRAM from redboot you must install the original Linksys firmware, because the openSlug doesn’t initialize the NVRAM.

Everything was fine, and the NSLU2 was working on the new IP. From this point on I’ve just flashed again the openSlug firmware, and formatted the SD Card (turnup with the memstick otion), and configured everything again (crontab, ntpclient and rsync daemon).

In no time I had the Diskstation again backing up to the NSLU2 external disk.

So, welcome again NSLU2 :)

Good Morning: Step in to Arduino….

So I’ve bought one of those cheap Arduino kits off eBay… In fact I’ve bought the cheapest one that I could find from a European seller… Bought it on Chinese shop with an UK warehouse, but the kit came from Sweden… Talk about globalization… After waiting around 10 days, I’ve got my kit, and in 5 minutes a LED was blinking in pure RGB glory (just red…).

The kit came with a UNO R3 clone, identical to the original, and several other components.

It depends what you want to do with your Arduino, but just to have an idea what came with my Kit:

- Some LED’s, push buttons, resistors, 7 segment (single and 4 side by side) and led matrix.

- One shift register 74hc595.

While the leds and the single segment can be driven by Arduino pins, for the led Matrix e the 4 7-segment display the shift register allows to drive them and use a minimal number of pins.

- An Infra red receiver and small remote. This is great because it allows to have multiple inputs (the remote switches) only using a single input.

- A 16×2 LCD display. I never used it directly, and just also bought an I2C driver for it, so I only need 2 pins to drive it and 2 pins for powering it.

- One servo SG-9 motor, and one stepper motor with a ULN2003 driver.
This allows to do some basic learning with these type of motors, but I think to do something useful, more motors are needed.

- An expansion shield with a mini bread board. Not used yet.

- A larger breadboard and some dupont cables. These last item are only enough for some basic experiments but for more advanced stuff there is the need to buy more…

- A 9V battery clip for providing standalone power

- An USB cable.

- Some assorted stuff. (On pot, flame sensor, LDR, tilt switch, etc…)

So, it is worth it to buy this kind of kit?

The short answer, yes, but for intermediate levels or more advanced levels, some more items are needed to be added to the kit, namely cables, and to allow the use of the 16×2 lcd while having pins available, at least an I2C driver/shield for the lcd. This is cheap out of ebay, works fine, and allows introducing to the I2C protocol

JVM Peer Gone in WebLogic T3 connection

So I have this exception when connecting to a FileNet P8 API from my Linux Machine:

com.filenet.api.exception.EngineRuntimeException: FNRCE0040E: E_NOT_AUTHENTICATED: The user is not authenticated. Message was: java.net.ConnectException: t3://1.2.3.4:9210: Bootstrap to 1.2.3.4/1.2.3.4:9210 failed. It is likely that the remote side declared peer gone on this JVM  at com.filenet.apiimpl.core.UserPasswordToken.getSubject(UserPasswordToken.java:121)
at com.filenet.api.util.UserContext.createSubject(UserContext.java:288)

This happens when connecting to a WebLogic Cluster and not into a single node (Well it might happen with a single node…).

The solution?

Easy: just add to the host files of the client machine the name and ip address of each weblogic cluster node.

Synology and MyDS Quickconnect

The issue: Quickconnect doesn’t work

After upgrading to the latest DSM version 5.0, it took a while to notice that my quickconnect id that I had chosen was not working…

On the DSM Control Panel, if I tried to change and apply the settings it gave a Unknow Error. On the logs, the only message related to the Quickconnect settings was network error: -23, and that was it…

On the myds site, my DS status was red, and clicking on the Quickconnect ID just gave a page that said that my DS was offline or with no network connection, but clicking on the host name just worked fine.

Using the Apps with the hostname and/or IP worked fine, just not with the Quickconnect ID.

The solution:

I don’t have a solution that might work for everyone, but the steps that I’ve taken solved the issue for me.

First on MyDS site I deleted the hostname, and on the DS Control Panel on DDNS settings I tried to register it again. This failed as said that the hostname doesn’t exist…

So, I also deleted the entry for the DDNS Synology provider and configured it again. I needed to enter again my login credentials to the MyDS site, and my hostname again.

This time, it worked, and on the MyDS page the hostname (after I deleted it from there) appeared again. Still clicking on the Quickconnect Id failed.

So, again on the DS Control Panel I went to the QuickConnect on Control Panel, and this time it said that I need to register a QuickConnect ID, so, I registered again my ID, providing the MyDS site credentials, and ID. And it worked.

Now my Quickconnect ID works and DDNS name also works.

The status of my DS on the MyDS site remained red for a large period of time, but at the end it turned green. Also clicking on the Quickconnect ID now works and gives me access to the Web frontend of DS.

This was quite a suprise for me as I didn’t expected to have the Web Administration console available to the internet.

I’ll have to see how to block this.

tl;dr:

Delete your DDNS configuration and register it again. Register again the QuickConnect ID.