Июн 242014
 

Простое чтение данных.

#!/usr/bin/perl
    use GPS::NMEA;
    use Data::Dumper;
    
    my $gps = GPS::NMEA->new(Port => '/dev/cuaa0', # or COM5: or /dev/ttyS0
                             Baud => 4800);
    while(1) {
        $gps->parse;
    
        # Dump internal NMEA data:
        $gps->nmea_data_dump;
    
        # Alternative to look at the internal NMEA data:
        require Data::Dumper;
        print Data::Dumper->new([$gps->{NMEADATA}],[])->Indent(1)->Useqq(1)->Dump;
    }

Печатаем координаты.


 #!/usr/bin/perl
    use GPS::NMEA;
    use Data::Dumper;
    
    my $gps = GPS::NMEA->new(Port => '/dev/cuaa0', # or COM5: or /dev/ttyS0
                             Baud => 4800);
    while(1) {
        $gps->parse;
    
        # Dump internal NMEA data:
        $gps->nmea_data_dump;
    
        # Alternative to look at the internal NMEA data:
        require Data::Dumper;
        print Data::Dumper->new([$gps->{NMEADATA}],[])->Indent(1)->Useqq(1)->Dump;
    }

Дамп всех NMEA данных с порта.

 #!/usr/bin/perl
    use GPS::NMEA;
    use Data::Dumper;
    
    my $gps = GPS::NMEA->new(Port => '/dev/cuaa0', # or COM5: or /dev/ttyS0
                             Baud => 4800);
    while(1) {
        $gps->parse;
    
        # Dump internal NMEA data:
        $gps->nmea_data_dump;
    
        # Alternative to look at the internal NMEA data:
        require Data::Dumper;
        print Data::Dumper->new([$gps->{NMEADATA}],[])->Indent(1)->Useqq(1)->Dump;
    }
 Posted by at 17:22
Июн 192014
 

Cubieboard / Cubietruck Debian Wheezy SD card image

Fex Guide — Описание FEX стандарта

Cubieboard1&2_HW.pdf

/boot/cb2-hdmi.bin
# bin2fex cb2-hdmi.bin > cb2-hdmi.txt
# fex2bin cb2-hdmi.txt cb2-hdmi.bin

PH20 — Зеленый светодиод на плате.

Все порта должны быть прописаны а также не должны пересекаться.

[gpio_para]
gpio_used = 1
gpio_num = 3
gpio_pin_1 = port:PH20<1><default><default><1>
gpio_pin_2 = port:PH21<1><default><default><1>
gpio_pin_3 = port:PD1<1><default><default><1>

#cd /sys/class/gpio
#ls -al
 export
 gpiochip1 -> ../../devices/platform/gpio-sunxi/gpio/gpiochip1
 unexport

Активация порта PH20. (echo 3 -> для PD1)
# echo 1 > /sys/class/gpio/export 
# ls -al
 export
 gpio1_ph20 -> ../../devices/platform/gpio-sunxi/gpio/gpio1_ph20
 gpiochip1 -> ../../devices/platform/gpio-sunxi/gpio/gpiochip1
 unexport

Включаем режим вывода.
# echo out > gpio1_ph20/direction 

Читаем из порта.
# cat gpio1_ph20/value
 0

Записываем в порт.
# echo 1 > gpio1_ph20/value
# cat gpio1_ph20/value
 1


Проверенно, работает.

http://blog.radiotech.kz/blog/cubieboard/34.html

gpio_defination_large

 Posted by at 15:16
Июн 032014
 

Cubieboard / Cubietruck Debian Wheezy SD card image.

  • Debian Wheezy 7.5 based
  • Kernel 3.4.91 with broad hardware support, headers included
  • Ethernet adapter with DHCP and SSH server ready on default port (22) with regenerated keys @ first boot
  • Wireless adapter with DHCP ready but disabled (/etc/network/interfaces, WPA2: normal connect or AP mode)
  • Enabled audio devices: analog, spdif and I2S
  • Advanced IR driver with RAW RX and TX
  • Bluetooth ready (currently working only with supported external USB devices)
  • Clustering / stacking
  • USB redirector — for sharing USB over TCP/IP (disabled by default /etc/init.d/rc.usbsrvd)
  • root file-system auto resize
  • Graphics desktop environment upgrade ready
  • NAND and SATA install script included (/root)
  • Disabled LED blinking, logo, boot messages (/etc/init.d/disable_led.sh, kernel.config, kernel parameters in uEnv.txt)
  • Total memory is exactly 2000Mb (disabled all memory reservations for GPU)
  • Login script shows Cubietruck / Cubieboard 2 auto MOTD with current CPU temp, hard drive temp & actual free memory
  • MAC address from chip ID, manual optional
  • Fastest Debian mirror auto selection @ first boot
  • root password=1234
  • sunxi-tools included: fex2bin, bin2fex, nand-part
  • Performance tweaks:
    • /tmp & /log = RAM, ramlog app saves logs to disk daily and on shut-down
    • IO scheduler NOOP for SD, CFQ for sda (mechanical hard drive). (change in /etc/sysfs.conf)
    • journal data writeback enabled. (/etc/fstab)
    • commit=600 to flush data to the disk every 10 minutes (/etc/fstab)
    • optimized CPU frequency scaling 480-1200Mhz with interactive governor and small 20% overclock (/etc/init.d/cpufrequtils)
  • Known bugs or limitations
    • On board Bluetooth unstable / unusable (firmware issue)
    • NAND install script sometime fails. Dirty but working workaround — installing Lubuntu to NAND with Phoenix tools and run the nand-install again.
    • Gigabit ethernet transfer rate is around 50% of its theoretical max rate (hardware or firmware issue)
    • Shutdown, reboot and battery troubles regarding poor AXP chip driver (firmware issue, probably solved in development kernel)
  • Unzipped images can be written with Image Writer on Windows or with DD command in Linux/Mac (dd bs=1M if=filename.raw of=sd card device). Kernel package should be uncompressed under root user to / Change boot parameter if your old kernel has different name.
 Posted by at 11:51
Фев 232014
 

 

cubieboard2

CPU: ARM® Cortex™-A7 Dual-Core
GPU: ARM® Mali400MP2, Complies with OpenGL ES 2.0/1.1
Память: 1GB DDR3 @960M
Накопитель: встроенная 4GB NAND flash, расширяемая до 64GB (есть слот uSD).
Жесткий диск: возможность подключения 2.5″ SATA объемом до 2T
Питание: 5VDC, 2A или USB otg
Сеть: 10/100 ethernet, возможно подключение wifi dongle
USB: 2x USB 2.0 HOST, 1x USB 2.0 OTG
Прочие интерфейсы: 2×96 pin, I2C, SPI, RGB/LVDS, CSI/TS, FM-IN, ADC, CVBS, VGA, SPDIF-OUT
ИК порт: 1x
ОС: Android, Ubuntu, Fedora и др.
Ноя 082013
 

Данный метод не работает.

# To switch VGA/HDMI display mode in command line. e.g.
$ cb-display-tool -o 8 -m 11
# Note: can switch to the same resolutions only currently.

А вот если изменить script.fex

[disp_init]
disp_init_enable = 1
disp_mode = 0
screen0_output_type = 4
screen0_output_mode = 4
screen1_output_type = 2
screen1_output_mode = 14

То все работает.

Для конвертации из bin to fex : bin2fex script.bin > script.fex
для конвертации из fex to bin : fex2bin script.fex > script.bin

 Posted by at 19:40
Ноя 072013
 

При выполнения некоторых команд появляется вот такая ошибка.

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "ru_RU.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

Решение проблемы:

sudo apt-get install --reinstall language-pack-en
sudo locale-gen
sudo dpkg-reconfigure locales
sudo locale-gen ru_RU.utf8
 Posted by at 14:51