Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Jojo

Pages: [1]
Hi @all,

Here is another script from me!

What it does?! Here is an example:
I faced the problem, that I wanted to compress some files (some Cubie images). But not all files in one archive, I wanted to have one archive for each file. And depending on the size and the structure of the file (and the speed of your computer of course ;) ), it might take several hours – per file! So wouldn’t it be great to start that process and let it run over night? Yes, but how to manage that without any interaction?

Now here is what my script does:
You can specify a file name pattern (*.img for example), and after some confirming the script executes the command "7z a nameoffile.7z nameoffile" for every single file. Of course other file name patterns are possible.

If no file with the specified file name pattern was found, you will be informed and have the possibility to change the search pattern.

So this is the main program flow:

  • Ask for a file name pattern
  • Search for that pattern with “find”
    • No files found
      • Correct your pattern
      • Exit
    • At least 1 file was found
      • Continue immediately
      • List up all found files and mark/unmark them
      • Exit
  • Confirm you want to zip the files
  • Execute “7z a filename.7z filename” for every file
  • Exit

Important notes:
  • “dialog” is used, so it has to be installed
  • “7z” is used, so it has to be installed
  • The script does not check if dialog and 7z are installed
  • The files to be compressed must be in the same folder where you execute the script
  • Some unimportant outputs (like from 7z) are written to the file /tmp/nul . The script does not delete that file for further inspections.

If you like it, please let me know  8) . If you have some great ideas to improve it, please let me know. If you don’t like it, I don’t care  :P .



after making some tests with overclocking or other CPU speed adjustments, I started to feel unhappy with the way to do it: entering the console, typing long commands and paths, etc... Also not every frequency worked properbly and you have to figure out, which one is available... complicated and not beautiful of course ;) .

So I wrote a script, that lets me choose which core's speed I want to change, and also gives me a list with more or less available frequencies, which are known to work.

NOTE 1: this is one of my very first scripts, so I don't garantee for anything  :-X ! Use it on your own risk!!!

For a basic GUI style, I used "dialog" (a program for basic grafical thing in the terminal). This has to be installed first!
Code: [Select]
sudo apt-get install dialog

The script needs to be started with "root" privileges, because the CPU frequency file it will be edited. After starting the script with
Code: [Select]
sudo bash
the script does:
  • look for the folder "/sys/devices/system/cpu/cpu0/cpufreq/"
    • if it does exist: go on...
    • if it does not exist: report and exit
  • look for "cpux" directories (which are the cores) in "/sys/devices/system/cpu/"
    • if there is only one (cpu0, A10 board) or two cores (cpu0 AND cpu1, A20 board): go on...
    • if there are >2 cores: report and cancel
  • giving a choice which core shall be adjusted (A20 board)
  • lists up available frequencies to make a choice from (see notes please)
  • setting the maximum core frequency to the chosen value ("/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq")

Note 2:
  • the script does NOT check of it is really a A10/A20 CPU. It just counts the directories (cores). Depending on the core count, it assumes the CPU type!!!
  • the default frequency table has been created by me after testing all available frequencies on MY CB2!!! The possible frequencies on your board may vary!
  • the clock speed change is NOT permanent!

oooops, what I have forgotten to explain:
  • Ja = Yes
  • Nein = No
  • Abbrechen = Cancel
The labels will be in your system default language ;) ...

Please try out and let me know your thoughts. If I get positiv feedback and/or some constructive critics, I might think about an improved release ;) .

The script is attatched  8) !


Tips, Tricks and Guides / A20 (A10?) Temperature logging script
« on: April 03, 2014, 03:10:02 am »

I have made a tiny script that lets you continously log the temperature of the TP controller in th A20. Due it is inside the same package you can use this information nearly as you CPU temperature ;) .

I have made a tiny script that lets you continously log the temperature of the AXP PMU IC on you CB2. Before the advice from ssvb (thx) I thought that it would be the sensor of the TP controller inside of the A20. That seems to be wrong. Sorry for that!

Feature overview:
  • scaling the readout to 0.1°C
  • log in intervals defined by the user
  • default logging interval is 1s
  • gives an output to the terminal with timestamp and temperature
  • creates a logfile everytime you start the script
  • logfile name is "Temp_log_hh:mm:ss" (starting time)
  • logging format in file is "hh:mm:ss   TT.t"
  • script will be stopped/closed by pressing any key

Known issues:
  • script does not prove the existance of the temperatue directory befor readout
  • if user input for logging interval is invalid (not a number) the script f**ks up and you have to cancel it

Call the scipt with default logging interval (1 second)
Code: [Select]

Call the scipt with another logging interval (5 seconds)
Code: [Select]
bash 5

Output will look like this (screenshot will follow):
Code: [Select]
Temperature logging started in file "Temp_log_hh:mm:ss"...
hh:mm:ss TT.t°C <- changing continously

Logging stopped at hh:mm:ss

The log file will be created in the same directory of the script!

You can end the script by pressing any key ("Where is the 'any'-key?!")

I have decided to log the temperature without unit (no "°C" in file) because that makes it more easy to convert the data to another software (for making charts, for example).
I think it could be useful if you are running benchmarks or if you want to see the influence of the CPU speed to the temperature.

I don't know if the script works on the A10, because the temperature register is located at another address (A20: 0x20, A10: 0x1C). Please let me know if it works on the A10!

Due the CB1 and and CB2 have the same layout, the script should also work on the CB1. But I have no CB1, so I can not test it.  Please let me know if it works on the CB1!

Please let me know if you like it. And also if not ;) .


General Discussion / Whats the NAND good for?
« on: March 31, 2014, 07:47:02 am »

the question sounds quite simple: if you'd like to use Linux, what is the internal NAND of the Cubieboard good for  ??? ?! I have tried to find out as much as possible and I am asking that for some reasons:
  • the NAND is known to be slower than (fast) SD cards
  • NAND has less write cycles than (good) SD cards
  • the NAND has a strange partitioning format (can only be repartitionized by Phoenix tool or other special NAND-part tools)

Of course, you could
  • use it just as storage, ok -> not a real big "pro-NAND"
  • keep you original Andriod stuff on it -> sry, what the h**l whas it good for? I have booted the Android system exactly ONCE, than decided that it is just useless...
  • use the SD card for storage purposes -> the only "real" pro, from my point of view

What else? What do you use your NAND for?


About the forum / Where are my attachments gone?
« on: March 31, 2014, 06:54:03 am »

I have opened a topic some time ago, where I uploaded some pictures (.jpg) as attachment to my posts. See here:
When I click on the attachment at the bottom of my posts, me browser (Firefox) says:
Code: [Select]
404 - Attachment Not Found

I've never had that problem before. What happened?!


Tips, Tricks and Guides / LED trigger manipulator with GUI - script!
« on: March 24, 2014, 06:24:06 am »

the idea came to me, that I wanted to change the trigger of the onboard LEDs of my CB2 in a user-friendly way. A noob like me does not want to search trough deep folder structures, type teminal commands and these things  ::) . Terminal rules, of course, but it is not noob friendly ;) .

So I wrote a script that does the work for you  8) ! It is my very first linux script, so please don't be too strict with your critics  :-* ...

For a basic GUI style, I used "dialog" (a program for basic grafical thing in the terminal). This has to be installed first!
Code: [Select]
sudo apt-get install dialog

The script needs to be started with "root" privileges, because of the trigger file it will edit. After starting the script with
Code: [Select]
sudo bash

the script does:
  • look for the "leds" directory on the system (if not, report it)
  • in case of presence look if there is something in the "leds" directory (if not, report it)
  • list up the content of the "leds" directory (which are the present LEDs) in a radio box
  • after choosing a LED from the list, available triggers for that LED are listed in a radio box
  • after choosing a trigger from the list, it asks to really perform the action (setting the trigger)
  • if yes, new trigger is written to the trigger file for the LED
  • if no (or you choose "Cancel" somwhere, the program exits

Note 1:
the labels of the "buttons" are german, they depend on your default system language (in my case it is german).
"OK" means "OK" (who would have thought that  ;D ?!?!)
"Abbrechen" means "Cancel"
"Ja" means "Yes"
"Nein" means "No".

Note 2:
the change is NOT permanentely, to the original trigger will be restored after reboot. Maybe I make another box which asks to save the trigger permanentely. That would lead to an entry in the rc.local...

If you like it, I will improve it by things like
- checking installation of dialog
- more interaction with the user
- sizes of the "widows"
- ...

Please try and let me know your thoughts!
The script is attatched  8) .

Software & Applications / Skype on CB2 / ARMHF
« on: March 19, 2014, 05:40:43 pm »

I am trying since two hours get Skype working on my CB2. I searched through the internet, but it seems to me as it is not possible at the moment :( .

I tried the two "ubuntu" .deb packages from the Skype homepage, but when I do
Code: [Select]
sudo dpkg --install skype-ubuntu-precise_4.2.0.13-1_i386.deb

it says:
Code: [Select]
dpkg: Fehler beim Bearbeiten von skype-ubuntu-precise_4.2.0.13-1_i386.deb (--install):
 Paket-Architektur (i386) passt nicht zum System (armhf)
That means something like "package architecture (i386) does not match to the system (armhf).

Are there any experiances with that? Is there another way to get skype working?


Beginners / Failing to set up a shared network folder :(
« on: March 15, 2014, 08:57:47 am »
Hi together,

I am failing miserably on a very noobish thing. I just want to share a folder in my local network (my SATA disk at my CB2, running Cubiuntu) with samba. But I don' get it...  :-[

The shared folder should be
  • generally visible
  • when you want to open it, you get asked for user name and password
  • there should be two possibilities to open it:
    • 1) as guest with only read permissions
    • 2) as the current user of the Cubie (lets say "linaro") with R/W permissions

Nothing else  :o :o . But I just find the correct settings for the samba server. I was able to open the folder without any login data promts (not good) and I also had a configuration, where I could not open the folder at all (not good, too  ::) ).

Could anyone please assist me with that? It can't be so difficult, but I don't get it...


Accessories / DIY 5V/3A power supply
« on: February 04, 2014, 08:36:24 am »
Hello there,

last week, I have bought a 2,5" SATA drive for my CB2. As I plugged it in, I saw that my current PSU strong enough to power the CPU, but it was to weak to power up the HDD.
Because it was already saturday evening, I was unable to go out to buy a new PSU.
So I searched through my spare part cooking boxes, but I just found a 12V/2A PSU. But waht is this?! I also found some integrated switching mode step-down voltage converters:

And suddenly the neccessary external components (schottky diode, capacitors inductors and resistors) came across  ;) :D !

The result of the weekend was a nicely working and quite strong combination of the 12V/2A PSU and a completly new 5V/3A PCB  8) .

- the very special high performance heatsink ;)
- I know that the PCB is "not beautyful". Please don't tell me things about 45 degree wires ;) .
- I know that the efficiency is not so good. But I prefere to have a working PSU then NOT to have a PSU ;) ...


Beginners / glmark2-es2 - failed to open sunxi-mali
« on: January 23, 2014, 09:02:03 am »

I just tried this nice thing glmark2-es2. But when started, it says:

Code: [Select]
linaro@linaro-ubuntu-desktop:~$ glmark2-es2
libEGL warning: failed to create a pipe screen for sunxi-mali
libEGL warning: DRI2: failed to open sunxi-mali (search paths /usr/lib/arm-linux-gnueabihf/dri)

And the results are quite bad. If that means that my mali-driver is not running correctly, what can I do?!

lsmod says:
Code: [Select]
linaro@linaro-ubuntu-desktop:~$ lsmod
Module                  Size  Used by
disp_ump                 861  0
8192cu                450521  0
mali_drm                2608  1
drm                   208605  2 mali_drm
mali                  110943  0
ump                    51995  4 disp_ump,mali
lcd                     3778  0

I am running cubiuntu 0.6 from patwood on CB2.


Tips, Tricks and Guides / Overclocking in Cubiuntu 0.6 - Quick and dirty
« on: January 19, 2014, 08:52:28 am »
this is a small guide how to overclock your CB in Cubiuntu 0.6.

Attention - Attention...This is really quick and dirty. Normally, you would have to slightly increase the core voltage, when you increase the CPU clock frequency. This guide does NOT manipulate the voltage, only frequency!
And of course: do this on your own risk ;) .
Attention - Attention...
I have tried this on my CB2 (A20). It runs stable at 1,2GHz, I have not tried higher frquencies. Important: I have also added a small heat sink which I have cut out of a normal low-profile CPU heat sink (19x19 mm).

This method of overclocking just manipulates the limits (increases the upper frequency limit), the performance govenor can work within.
For this manipulation, you need the file(s), that set the maximum frequency per core:
Code: [Select]
and for CB2:

By writing a new value to the file (in kHz) you immediatly set the new limit:
Code: [Select]
echo 1200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 1200000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq

These changes are temporarily. So when you reboot you board, the file content will be overwritten be the default value.
What you can do is:
- write a script and execute it on boot
- add commands to the file "/etc/rc.local"

I did the second thing. The original content of my rc.local file was
Code: [Select]
echo 1008000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 408000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
echo 200000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
echo 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
Code: [Select]
#echo 1008000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 1200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 408000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

echo 1200000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo 408000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor

echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
echo 200000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
echo 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor

Thats it  8)

Good luck :)


I've searched through many manuals and forums, but I just could not find a solution.

I'd like to measure some voltages with the CB2. I've read that there are analog inputs for the internal ADC of the A20 on the external connectors. But I really don't understand how to use these pins! Are there any good sources where I can read about that? How many SPS, what resolution? Or is it just not possible?!

Edit: I'd like to use Lubuntu :)

Thanks alot in advance,


Pages: [1]