Archive for January, 2015

Remote Debug on Fuse Fabric Container

January 27, 2015 Leave a comment

When you create a container in fabric you can specify which options should be passed to the container. This way you can set the amount of memory for instance, but you can also specify that the container should start in debug modus.

The following Fuse CLI command would create a container with a maximum heap size of 256 MB:

container-create-child --jvm-opts "-Xmx256m" root child

In the console you’ll find the “Jvm opts” option under the “Advanced” tab on the container creation page.

Now you can also use this to pass the regular debug commands to a JVM: “-Xdebug -Xrunjdwp:transport=dt_socket,address=5001,server=y,suspend=n”.

The CLI command would then look like this:

container-create-child --jvm-opts "-Xdebug -Xrunjdwp:transport=dt_socket,address=5001,server=y,suspend=n" root child

The suspend=n part means that the JVM won’t wait for a debugger to connect but will startup like usual. If you need to see what happens in the JVM right after it starts you can change this to suspend=y. The JVM will then block until a debugger is connected.

This post is based on my answer to luca.santaniello.81 on the JBoss Developer forums.

Categories: JBoss Fuse Tags: , , , , ,

How to control the fan speed on the Odroid U3

January 25, 2015 Leave a comment

I noticed the (optional) fan on my Odroid U3 frequently spinning up only to shut down again 1 second later. This appeared rather buggy to me so I looked into how to control the fan. This is what I found:

You can switch the fan into ‘auto’ or ‘manual’ mode:

echo auto > /sys/devices/platform/odroidu2-fan/fan_mode
echo manual > /sys/devices/platform/odroidu2-fan/fan_mode

Note: The ‘odroidu2’ part of the path is not a typo! Strangely enough the U3 uses the same device path as the U2.

Once you’ve switched the fan into manual mode, you can set the speed of the fan by echo-ing a value between 0 (0%) to 255 (100%) to the fan controller:

echo 0 > /sys/devices/platform/odroidu2-fan/pwm_duty (fan off)
echo 255 > /sys/devices/platform/odroidu2-fan/pwm_duty (fan on full speed)

Fun fact: You can get into an argument with the automatic fan controller by setting the fan speed while in auto mode. The fan will respond to your command but the automatic controller will shut it down after noticing what you did. 🙂

While playing with the fan use the following command to read the CPU temperature:

cat /sys/devices/virtual/thermal/thermal_zone0/temp

And to run a CPU stress-test that utilizes all 4 cores use this command:

sudo openssl speed -multi 4

User xana (among others) has posted a script on the odroid u3 forum that uses the commands described above to periodically set the fan speed based on CPU temperature:

If you have the latest version of the kernel it gets even simpler. You can set the temperature above which the fan should be used to cool down the SoC:

echo 60 > /sys/bus/platform/devices/odroidu2-fan/start_temp

Categories: Uncategorized