Jump to content

Peter Valencic

Members
  • Posts

    27
  • Joined

  • Last visited

Everything posted by Peter Valencic

  1. Friday magic friday Solved... Have changed SPI mode to 0 and now it works well
  2. ok.. I tryed with this code below... #include <iostream> #include <stdint.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <getopt.h> #include <fcntl.h> #include <sys/ioctl.h> #include <sys/times.h> #include <linux/types.h> #include <linux/spi/spidev.h> #include <spi_lib.h> using namespace std; #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) static const char *device = "/dev/spidev0.0"; static uint8_t mode = 3; static uint8_t bits = 8; static uint32_t speed = 250000; //250kHz static uint16_t delays; static void pabort(const char *s) { perror(s); abort(); } void setBaudRate(int fd, char uart) { if (uart < 4) { int ret = -1; uint8_t tx_buffer_baud = (uint8_t) (0x80 | uart); //9600 baud rate UART 1 ret = spi_write(fd, &tx_buffer_baud, 1); printf("ret1: %d\n", ret); usleep(150); tx_buffer_baud = (uint8_t) 3; ret = spi_write(fd, &tx_buffer_baud, 1); usleep(150); printf("ret1: %d\n", ret); } } void TransmitString(int fd, char uart, char *DATA, char NUMBYTES) { char IDX = (0x0); int ret = -1; if (uart < 4) { uint8_t tx_buffer_baud = (uint8_t) (0x40 | uart); //9600 baud rate UART 1 ret = spi_write(fd, &tx_buffer_baud, 1); usleep(150); tx_buffer_baud = (uint8_t) (NUMBYTES); ret = spi_write(fd, &tx_buffer_baud, 1); usleep(150); while (IDX < NUMBYTES) { tx_buffer_baud = (uint8_t) DATA[IDX]; ret = spi_write(fd, &tx_buffer_baud, 1); usleep(150); IDX = IDX + 1; } usleep(150); } } int main(int argc, char** argv) { int ret = 0; int fd; fd = open(device, O_RDWR); //read write if (fd < 0) { printf("can't open device"); return -1; } /* * spi mode */ ret = ioctl(fd, SPI_IOC_WR_MODE, &mode); if (ret == -1) pabort("can't set spi mode"); ret = ioctl(fd, SPI_IOC_RD_MODE, &mode); if (ret == -1) pabort("can't get spi mode"); /* * bits per word */ ret = ioctl(fd, SPI_IOC_WR_BITS_PER_WORD, &bits); if (ret == -1) printf("can't set bits per word"); ret = ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits); if (ret == -1) printf("can't get bits per word"); /* * max speed hz */ ret = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed); if (ret == -1) printf("can't set max speed hz"); ret = ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed); if (ret == -1) printf("can't get max speed hz"); printf("spi mode: %d\n", mode); printf("bits per word: %d\n", bits); printf("max speed: %d Hz (%d KHz)\n", speed, speed / 1000); //set baud rate // Initialise the UART baud rates // 0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200 setBaudRate(fd, 0); //UART 1 TransmitString(fd,0,"PETER",5); close(fd); return ret; } and connected the interface with USB/AURT cable... On My PC RS232terminal I now receive some "garbage"...
  3. Hi Martin and others I started a new Thread because have problems using some third party interfaces with OrangePI running Armbian. Well.. In my project I need to communicate with 5 sensors which have UART output so I decided to buy a circuit (uart2spi) which work well if connected to Arduino. The Circuit description is available here: http://www.rowlandtechnology.com/projects/2015/09/25/spi-to-4-x-uart-bridge-multiuart-project/ First step: This is how I have connected the circuit to GPIO bus on my OrangePi pc.. The circuit has (from left to right) +3.3V pin, MISO, MOSI, SCK (clock), CS and GND.. I have connected those wires to GPIO pins: +3.3V to pin 17 MOSI to pin 19 MISO to pin 21 SCK to pin 23 CS to pin 24 (chip select) GND to pin 20 This is how it look like... (the green led on my interface is on so it's mean that power is on) If I look at the tutorial on how to setup the board on Arduino is the same (you just connect wires) except CS is some output pin which you can togle on/off.. in my case I have connected those wire to orangepi on pin 24 (CE0).. Now I would like to port Arduino library to C and here the problems begin... first... the initialization of SPI... In Arduino I have this kind of method (SPIDivider is set to 250000 (250 kHz)) Arduino code: void MULTIUART::initialise(int SPIDivider) { SPI.begin(); SPI.setBitOrder(MSBFIRST); SPI.setClockDivider(SPIDivider); } and here is my code in C but I don't know if this is the right way to write over spi? and also how to set-up bitOrderMask (if needed)? Orangepi code : #include <iostream> #include <stdint.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <getopt.h> #include <fcntl.h> #include <sys/ioctl.h> #include <sys/times.h> #include <linux/types.h> #include <linux/spi/spidev.h> #include <spi_lib.h> using namespace std; #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) static const char *device = "/dev/spidev0.0"; static uint8_t mode = 3; static uint8_t bits = 8; static uint32_t speed = 250000; //250kHz static uint16_t delays; static void pabort(const char *s) { perror(s); abort(); } int main(int argc, char** argv) { int ret = 0; int fd; fd = open(device, O_RDWR); //read write if (fd < 0) { printf("can't open device"); return -1; } ret = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed); if (ret == -1) { printf("can't open device"); return -1; } printf("spi mode: %d\n", mode); printf("bits per word: %d\n", bits); printf("max speed: %d Hz (%d KHz)\n", speed, speed / 1000); if (ioctl(fd, SPI_IOC_WR_MODE, &mode) == -1) pabort("Can't set SPI mode"); close(fd); return ret; } from console i get: now... Here I have a function from Arduino to set BaudRate for specified channel on my interface. (baud rate is selected with values from 0 to 7 (0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200)) This function works well on Arduino (but.... if you see it uses digitalWrite command to pull down the signal on CS pin and then the command is send over SPI.transfer function.. ) void MULTIUART::SetBaud(char UART, char BAUD) { if (UART < 4) { if (BAUD < 10) { digitalWrite(_ss_pin, LOW); SPI.transfer(0x80 | UART); delayMicroseconds(50); SPI.transfer(BAUD); digitalWrite(_ss_pin, HIGH); delayMicroseconds(50); } } } Now I don't know if the same must be done on OrangePI with CS pin (pin 24 on GPIO or is this done by kernel)? I have ported this code above on orangepi like this: void setBaudRate(int fd,char uart) { if (uart <4) { int ret = -1; uint8_t tx_buffer_baud = (uint8_t)(0x80|uart); //??? CS pin must be in LOW mode ret = spi_write(fd,&tx_buffer_baud,1); printf("ret1: %d\n", ret); usleep(50); tx_buffer_baud = (uint8_t) 3; ret = spi_write(fd,&tx_buffer_baud,1); usleep(50); //??? CS pin must be in HIGH mode printf("ret1: %d\n", ret); } } So is the CS pin set to LOW before the command is send over SPI or it must be done manually? thank you for any info..
  4. Hi, need some help.. I'am familar with Java but with c/c++ not So.. have downloaded source from: https://github.com/duxingkei33/orangepi_PC_gpio_pyH3 to my orangepi.. Than I have installed the library with python and all is ok.. On the remote PC I have setup Netbeans IDE and now want to include gpio_lib.h The problem is that IDE can't find header files in directories listed below... So.. what is the procedure to use orangepi_PC_gpio_pyH3 library? Can I only copy/paste files to /usr/include folder on my OP?
  5. Hi after half a year using orangepi PC have upgraded system and it hangs when compiling headers.... After that have to reformat sd card and installed last version of armbian and the problem still remain when try to upgrade it... fresh system... đ then apt-get update root@orangepipc:~# clear root@orangepipc:~# apt-get update Hit:1 http://ports.ubuntu.com xenial InRelease Get:2 http://ports.ubuntu.com xenial-security InRelease [102 kB] Get:3 http://ports.ubuntu.com xenial-updates InRelease [102 kB] Get:4 http://apt.armbian.com xenial InRelease [14.1 kB] Get:5 http://ports.ubuntu.com xenial-backports InRelease [102 kB] Get:6 http://ports.ubuntu.com xenial-security/main armhf Packages [245 kB] Get:7 http://ports.ubuntu.com xenial-security/main Translation-en [124 kB] Get:8 http://ports.ubuntu.com xenial-security/universe armhf Packages [136 kB] Get:9 http://ports.ubuntu.com xenial-security/universe Translation-en [72.2 kB] Get:10 http://ports.ubuntu.com xenial-updates/main armhf Packages [506 kB] Get:11 http://ports.ubuntu.com xenial-updates/main Translation-en [228 kB] Get:12 http://ports.ubuntu.com xenial-updates/universe armhf Packages [444 kB] Get:13 http://ports.ubuntu.com xenial-updates/universe Translation-en [193 kB] Get:14 http://apt.armbian.com xenial/main armhf Packages [305 kB] Get:15 http://apt.armbian.com xenial/utils armhf Packages [8,005 B] Get:16 http://apt.armbian.com xenial/xenial-desktop armhf Packages [17.0 kB] Fetched 2,598 kB in 4s (620 kB/s) Reading package lists... Done root@orangepipc:~# apt-get upgrade root@orangepipc:~# apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages will be upgraded: hostapd libc-bin libc-dev-bin libc6 libc6-dev libgnutls-openssl27 libgnutls30 libssl-dev libssl1.0.0 linux-firmware linux-headers-sun8i linux-image-sun8i linux-libc-dev linux-u-boot-orangepipc-default linux-xenial-root-orangepipc locales multiarch-support openssl sunxi-tools vlan 20 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 68.3 MB of archives. After this operation, 24.6 kB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 http://ports.ubuntu.com xenial-security/main armhf libc6-dev armhf 2.23-0ubuntu9 [1,643 kB] Get:2 http://apt.armbian.com xenial/utils armhf hostapd armhf 1:2.5~armbian5.31+1 [306 kB] Get:3 http://apt.armbian.com xenial/main armhf linux-headers-sun8i armhf 5.31 [5,774 kB] Get:4 http://ports.ubuntu.com xenial-security/main armhf libc-dev-bin armhf 2.23-0ubuntu9 [59.2 kB] Get:5 http://ports.ubuntu.com xenial-security/main armhf linux-libc-dev armhf 4.4.0-81.104 [815 kB] Get:6 http://ports.ubuntu.com xenial-security/main armhf libc6 armhf 2.23-0ubuntu9 [2,143 kB] Get:7 http://ports.ubuntu.com xenial-security/main armhf locales all 2.23-0ubuntu9 [3,220 kB] Get:8 http://ports.ubuntu.com xenial-security/main armhf libc-bin armhf 2.23-0ubuntu9 [486 kB] Get:9 http://ports.ubuntu.com xenial-security/main armhf multiarch-support armhf 2.23-0ubuntu9 [6,826 B] Get:10 http://ports.ubuntu.com xenial-security/main armhf libgnutls-openssl27 armhf 3.4.10-4ubuntu1.3 [19. 0 kB] Get:11 http://ports.ubuntu.com xenial-security/main armhf libgnutls30 armhf 3.4.10-4ubuntu1.3 [486 kB] Get:12 http://ports.ubuntu.com xenial-updates/main armhf libssl-dev armhf 1.0.2g-1ubuntu4.8 [982 kB] Get:13 http://ports.ubuntu.com xenial-updates/main armhf libssl1.0.0 armhf 1.0.2g-1ubuntu4.8 [712 kB] Get:14 http://ports.ubuntu.com xenial-updates/main armhf openssl armhf 1.0.2g-1ubuntu4.8 [485 kB] Get:15 http://ports.ubuntu.com xenial-updates/main armhf linux-firmware all 1.157.11 [37.9 MB] Get:16 http://apt.armbian.com xenial/main armhf linux-image-sun8i armhf 5.31 [12.6 MB] Get:17 http://apt.armbian.com xenial/main armhf linux-u-boot-orangepipc-default armhf 5.31 [166 kB] Get:18 http://apt.armbian.com xenial/main armhf linux-xenial-root-orangepipc armhf 5.31 [395 kB] Get:19 http://apt.armbian.com xenial/utils armhf sunxi-tools armhf 1.4.2-1~armbian5.31+1 [36.0 kB] Get:20 http://ports.ubuntu.com xenial-updates/main armhf vlan armhf 1.9-3.2ubuntu1.16.04.3 [30.5 kB] Fetched 68.3 MB in 14s (4,740 kB/s) Preconfiguring packages ... (Reading database ... 43965 files and directories currently installed.) Preparing to unpack .../libc6-dev_2.23-0ubuntu9_armhf.deb ... Unpacking libc6-dev:armhf (2.23-0ubuntu9) over (2.23-0ubuntu7) ... Preparing to unpack .../libc-dev-bin_2.23-0ubuntu9_armhf.deb ... Unpacking libc-dev-bin (2.23-0ubuntu9) over (2.23-0ubuntu7) ... Preparing to unpack .../linux-libc-dev_4.4.0-81.104_armhf.deb ... Unpacking linux-libc-dev:armhf (4.4.0-81.104) over (4.4.0-79.100) ... Preparing to unpack .../libc6_2.23-0ubuntu9_armhf.deb ... Unpacking libc6:armhf (2.23-0ubuntu9) over (2.23-0ubuntu7) ... Setting up libc6:armhf (2.23-0ubuntu9) ... Processing triggers for libc-bin (2.23-0ubuntu7) ... Processing triggers for man-db (2.7.5-1) ... (Reading database ... 43965 files and directories currently installed.) Preparing to unpack .../locales_2.23-0ubuntu9_all.deb ... Unpacking locales (2.23-0ubuntu9) over (2.23-0ubuntu7) ... Preparing to unpack .../libc-bin_2.23-0ubuntu9_armhf.deb ... Unpacking libc-bin (2.23-0ubuntu9) over (2.23-0ubuntu7) ... Processing triggers for man-db (2.7.5-1) ... Setting up libc-bin (2.23-0ubuntu9) ... (Reading database ... 43965 files and directories currently installed.) Preparing to unpack .../multiarch-support_2.23-0ubuntu9_armhf.deb ... Unpacking multiarch-support (2.23-0ubuntu9) over (2.23-0ubuntu7) ... Setting up multiarch-support (2.23-0ubuntu9) ... (Reading database ... 43965 files and directories currently installed.) Preparing to unpack .../libgnutls-openssl27_3.4.10-4ubuntu1.3_armhf.deb ... Unpacking libgnutls-openssl27:armhf (3.4.10-4ubuntu1.3) over (3.4.10-4ubuntu1.2) ... Preparing to unpack .../libgnutls30_3.4.10-4ubuntu1.3_armhf.deb ... Unpacking libgnutls30:armhf (3.4.10-4ubuntu1.3) over (3.4.10-4ubuntu1.2) ... Preparing to unpack .../libssl-dev_1.0.2g-1ubuntu4.8_armhf.deb ... Unpacking libssl-dev:armhf (1.0.2g-1ubuntu4.8) over (1.0.2g-1ubuntu4.6) ... Preparing to unpack .../libssl1.0.0_1.0.2g-1ubuntu4.8_armhf.deb ... Unpacking libssl1.0.0:armhf (1.0.2g-1ubuntu4.8) over (1.0.2g-1ubuntu4.6) ... Preparing to unpack .../openssl_1.0.2g-1ubuntu4.8_armhf.deb ... Unpacking openssl (1.0.2g-1ubuntu4.8) over (1.0.2g-1ubuntu4.6) ... Preparing to unpack .../hostapd_1%3a2.5~armbian5.31+1_armhf.deb ... Unpacking hostapd (1:2.5~armbian5.31+1) over (1:2.5~armbian5.30+1) ... Preparing to unpack .../linux-firmware_1.157.11_all.deb ... Unpacking linux-firmware (1.157.11) over (1.157.10) ... Replaced by files in installed package armbian-firmware (5.30) ... Preparing to unpack .../linux-headers-sun8i_5.31_armhf.deb ... Unpacking linux-headers-sun8i (5.31) over (5.30) ... Preparing to unpack .../linux-u-boot-orangepipc-default_5.31_armhf.deb ... Unpacking linux-u-boot-orangepipc-default (5.31) over (5.30) ... Preparing to unpack .../linux-xenial-root-orangepipc_5.31_armhf.deb ... Leaving 'diversion of /etc/mpv/mpv.conf to /etc/mpv/mpv-dist.conf by linux-xenial-root-orangepipc' Unpacking linux-xenial-root-orangepipc (5.31) over (5.30) ... Preparing to unpack .../sunxi-tools_1.4.2-1~armbian5.31+1_armhf.deb ... Unpacking sunxi-tools (1.4.2-1~armbian5.31+1) over (1.4.2-1~armbian5.30+1) ... Preparing to unpack .../vlan_1.9-3.2ubuntu1.16.04.3_armhf.deb ... Unpacking vlan (1.9-3.2ubuntu1.16.04.3) over (1.9-3.2ubuntu1.16.04.1) ... Processing triggers for libc-bin (2.23-0ubuntu9) ... Processing triggers for man-db (2.7.5-1) ... Processing triggers for systemd (229-4ubuntu17) ... Processing triggers for ureadahead (0.100.0-19) ... Processing triggers for initramfs-tools (0.122ubuntu8.8) ... update-initramfs: Generating /boot/initrd.img-3.4.113-sun8i update-initramfs: Converting to u-boot format Setting up libc-dev-bin (2.23-0ubuntu9) ... Setting up linux-libc-dev:armhf (4.4.0-81.104) ... Setting up libc6-dev:armhf (2.23-0ubuntu9) ... Setting up locales (2.23-0ubuntu9) ... Generating locales (this might take a while)... en_US.UTF-8... done Generation complete. Setting up libgnutls30:armhf (3.4.10-4ubuntu1.3) ... Setting up libgnutls-openssl27:armhf (3.4.10-4ubuntu1.3) ... Setting up libssl1.0.0:armhf (1.0.2g-1ubuntu4.8) ... Setting up libssl-dev:armhf (1.0.2g-1ubuntu4.8) ... Setting up openssl (1.0.2g-1ubuntu4.8) ... Setting up hostapd (1:2.5~armbian5.31+1) ... Setting up linux-firmware (1.157.11) ... update-initramfs: Generating /boot/initrd.img-3.4.113-sun8i update-initramfs: Converting to u-boot format Setting up linux-headers-sun8i (5.31) ... Compiling headers - please wait ... It's now more than hour I'am waiting... and nothing happened... If try to open new session window i get this: in first session window the system is allways at the same point (compiling headers - please wait)?! but.. If I try to reboot the system it will hang... the SD card is sony 32 GB... What else I can do? or check?
  6. I found the implementation here (It's for arduino but should work also on orangepi with some modifications): https://github.com/RowlandTechnology/MULTIUART or maybe to use MAX14830 (https://www.maximintegrated.com/en/products/interface/controllers-expanders/MAX14830.html) 4 uarts to SPI http://www.spinics.net/lists/linux-serial/msg10232.html I'm working on scientific project where we must acquire datas over 5 uarts. Each uart is connected to specific sensor (oxygen, temp, salinity, pressure, chlorophile,..)..
  7. Hi, I need to connect this kind of board over SPI bus to Orange PI: http://www.instructables.com/id/SPI-to-4-x-UART-Bridge-MULTIUART/ Can I use the https://github.com/duxingkei33/orangepi_PC_gpio_pyH3 libraries to talk over SPI bus? regards Peter
  8. Hi, I have trouble to update armbian with apt upgrade. (ARMBIAN 5.27.170320 nightly Debian GNU/Linux 8 (jessie) 3.4.113-sun8i) how to solve? [ 9 updates to install: apt upgrade ] New to Armbian? Check the documentation first: docs.armbian.com Last login: Sun Mar 19 20:01:15 2017 from peter-laptop root@orangepipc:~# apt upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages will be upgraded: armbian-firmware armbian-tools-jessie hostapd libvdpau1 linux-headers-sun8i linux-image-sun8i linux-jessie-root-orangepipc linux-u-boot-orangepipc-default sunxi-tools 9 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 20.9 MB of archives. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] Y Err http://beta.armbian.com/ jessie/jessie-desktop libvdpau1 armhf 1.1.1-10~armbian5.27.170321+1 404 Not Found Err http://beta.armbian.com/ jessie/main armbian-firmware armhf 5.27.170321 404 Not Found Err http://beta.armbian.com/ jessie/main armbian-tools-jessie armhf 5.27.170321 404 Not Found Err http://beta.armbian.com/ jessie/utils hostapd armhf 1:2.5~armbian5.27.170321+1 404 Not Found Err http://beta.armbian.com/ jessie/main linux-headers-sun8i armhf 5.27.170321 404 Not Found Err http://beta.armbian.com/ jessie/main linux-image-sun8i armhf 5.27.170321 404 Not Found Err http://beta.armbian.com/ jessie/main linux-jessie-root-orangepipc armhf 5.27.170321 404 Not Found Err http://beta.armbian.com/ jessie/main linux-u-boot-orangepipc-default armhf 5.27.170321 404 Not Found Err http://beta.armbian.com/ jessie/utils sunxi-tools armhf 1.4.2-1~armbian5.27.170321+1 404 Not Found E: Failed to fetch http://beta.armbian.com/pool/jessie-desktop/libv/libvdpau/libvdpau1_1.1.1-10~armbian5.27.170321+1_armhf.deb 404 Not Found E: Failed to fetch http://beta.armbian.com/pool/main/a/armbian-firmware/armbian-firmware_5.27.170321_armhf.deb 404 Not Found E: Failed to fetch http://beta.armbian.com/pool/main/a/armbian-tools-jessie/armbian-tools-jessie_5.27.170321_armhf.deb 404 Not Found E: Failed to fetch http://beta.armbian.com/pool/utils/w/wpa/hostapd_2.5~armbian5.27.170321+1_armhf.deb 404 Not Found E: Failed to fetch http://beta.armbian.com/pool/main/l/linux-upstream/linux-headers-sun8i_5.27.170321_armhf.deb 404 Not Found E: Failed to fetch http://beta.armbian.com/pool/main/l/linux-upstream/linux-image-sun8i_5.27.170321_armhf.deb 404 Not Found E: Failed to fetch http://beta.armbian.com/pool/main/l/linux-jessie-root-orangepipc/linux-jessie-root-orangepipc_5.27.170321_armhf.deb 404 Not Found E: Failed to fetch http://beta.armbian.com/pool/main/l/linux-u-boot-orangepipc-default/linux-u-boot-orangepipc_5.27.170321_armhf.deb 404 Not Found E: Failed to fetch http://beta.armbian.com/pool/utils/s/sunxi-tools/sunxi-tools_1.4.2-1~armbian5.27.170321+1_armhf.deb 404 Not Found E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? root@orangepipc:~#
  9. Hi, Have Arduino (microcontroller) clone with CH340 USB/UART (USB serial port). Does armbian support it? regards Peter
  10. Hi, for my project I need to stream a video from IP camera and add some text from sensors into the final video. From armbian console I have installed ffmpeg (apt-get install ffmpeg).. The program works except the text is not included into streamed video: Example: ffserver.conf HTTPPort 8090 HTTPBindAddress 0.0.0.0 MaxHTTPConnections 2000 MaxClients 1000 MaxBandwidth 10000 CustomLog - <Feed monitoring1.ffm> File /tmp/monitoring1.ffm FileMaxSize 50M ACL allow 127.0.0.1 ACL allow 192.168.0.0 192.168.255.255 </Feed> <Stream monitoring1.mjpg> Feed monitoring1.ffm Format mpjpeg VideoCodec mjpeg VideoFrameRate 22 VideoBufferSize 80 VideoSize 720x264 NoAudio </Stream> # Redirect index.html to the appropriate site <Redirect index.html> URL http://www.ffmpeg.org/ </Redirect> Then I start a simple example as: ffmpeg -i rtsp://mpv.cdn3.bigCDN.com:554/bigCDN/definst/mp4:bigbuckbunnyiphone_400.mp4 -vf drawtext="fontfile=/home/projekt/StreamTest/DejaVuSans.ttf: \ text='TEST TEST': fontcolor=white: fontsize=36: box=1: boxcolor=black@0.5: \ boxborderw=5: x=(w-text_w)/2: y=(h-text_h)/2" -codec:a copy http://localhost:8090/monitoring1.ffm In Armbian console I get: root@orangepipc:/home/projekt/StreamTest# ./test.sh ffmpeg version 3.2.2-1~bpo8+1 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 4.9.2 (Debian 4.9.2-10) configuration: --prefix=/usr --extra-version='1~bpo8+1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --disable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-libopencv --enable-frei0r --enable-libx264 --enable-chromaprint --enable-shared libavutil 55. 34.100 / 55. 34.100 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.100 / 57. 56.100 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libavresample 3. 1. 0 / 3. 1. 0 libswscale 4. 2.100 / 4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 / 54. 1.100 [rtsp @ 0xb7a0a280] UDP timeout, retrying with TCP Input #0, rtsp, from 'rtsp://mpv.cdn3.bigCDN.com:554/bigCDN/definst/mp4:bigbuckbunnyiphone_400.mp4': Metadata: title : http/9aaa4066-cs.mi-cdn.io/streaming/streams/flash/bigbuckbunnyiphone_400.mp4 Duration: 00:09:56.46, start: 0.000000, bitrate: N/A Stream #0:0: Audio: aac (LC), 48000 Hz, stereo, fltp Stream #0:1: Video: h264 (Constrained Baseline), yuv420p(progressive), 320x180, 24 tbr, 90k tbn, 180k tbc [tcp @ 0xb7a11ca0] Connection to tcp://localhost:8090 failed (Connection refused), trying next address Last message repeated 1 times [swscaler @ 0xb7a61d10] deprecated pixel format used, make sure you did set range correctly Output #0, ffm, to 'http://localhost:8090/monitoring1.ffm': Metadata: title : http/9aaa4066-cs.mi-cdn.io/streaming/streams/flash/bigbuckbunnyiphone_400.mp4 creation_time : now encoder : Lavf57.56.100 Stream #0:0: Video: mjpeg, yuvj420p(pc), 720x264, q=2-31, 64 kb/s, 24 fps, 1000k tbn, 22 tbc Metadata: encoder : Lavc57.64.101 mjpeg Side data: cpb: bitrate max/min/avg: 128000/0/64000 buffer size: 655360 vbv_delay: -1 Stream mapping: Stream #0:1 -> #0:0 (h264 (native) -> mjpeg (native)) Press [q] to stop, [?] for help [mjpeg @ 0xb7b0f760] rc buffer underflowkB time=00:00:00.77 bitrate= 720.9kbits/s dup=0 drop=1 speed=1.51x Last message repeated 8 times [mjpeg @ 0xb7b0f760] rc buffer underflowkB time=00:00:01.27 bitrate= 720.9kbits/s dup=0 drop=2 speed=1.24x Last message repeated 6 times Past duration 0.719322 too large [mjpeg @ 0xb7b0f760] rc buffer underflow Past duration 0.795326 too large [mjpeg @ 0xb7b0f760] rc buffer underflow Past duration 0.893318 too large [mjpeg @ 0xb7b0f760] rc buffer underflow Last message repeated 1 times [mjpeg @ 0xb7b0f760] rc buffer underflowkB time=00:00:01.77 bitrate= 739.4kbits/s dup=0 drop=3 speed=1.15x Last message repeated 8 times [mjpeg @ 0xb7b0f760] rc buffer underflowkB time=00:00:02.18 bitrate= 750.9kbits/s dup=0 drop=3 speed=1.06x Last message repeated 3 times frame= 53 fps= 23 q=31.4 Lsize= 224kB time=00:00:02.36 bitrate= 776.3kbits/s dup=0 drop=4 speed=1.04x video:217kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.163595% Exiting normally, received signal 2. root@orangepipc:/home/projekt/StreamTest# This is the result of "streamed" video but without embedded text 'TEST TEST' Does anyone know what could be wrong? or how to get latest version of Ffmpeg?
  11. Will try to upgrade ... sed -i "s/apt/beta/" /etc/apt/sources.list.d/armbian.list apt-get update apt-get upgrade
  12. Thank you for your help! here is for: ls -l /boot/dtb/overlay I don't have subdirectory dtb dmesg | grep serial cat /proc/device-..... (I don't have this folder) thank you for your help. I don't have much experience in linux but must do a project for thesis ;(
  13. Have tryed also with python but here I get nothing Have installed Serial lib from https://pypi.python.org/pypi/pyserial
  14. Hmm.. tryed but still get only one serial cmd : cd '/home/projekt/NetBeansProjects//TestCom'; '/usr/bin/java' -Dfile.encoding=UTF-8 -jar /home/projekt/NetBeansProjects//TestCom/dist/TestCom.jar ------------------------------- 1.7.0_121 Linux /dev/ttyS0 - Serial
  15. Ok! will this be fine? will try.. thank you verbosity=7 console=both machid=1029 bootm_boot_mode=sec rootdev=UUID=74434014-190f-406c-9b73-2c99c49383ba rootfstype=ext4 overlays=sun8i-h3-uart1 sun8i-h3-uart2 sun8i-h3-uart3
  16. Hi, In my project I want to use UART on GPIO pin (8,10). I wrote a simple Java app to decet serial ports on my orange PC but it return only /dev/ttyS0 - Serial Here is simple java code using rxtxlibrary.. package org.mbp; import gnu.io.CommPortIdentifier; /** * * @author Peter */ public class TestCom { /** * @param args the command line arguments */ public static void main(String[] args) { System.out.println("-------------------------------"); System.out.println(System.getProperty("java.version")); System.out.println(System.getProperty("os.name")); java.util.Enumeration<CommPortIdentifier> portEnum = CommPortIdentifier.getPortIdentifiers(); while (portEnum.hasMoreElements()) { CommPortIdentifier portIdentifier = portEnum.nextElement(); System.out.println(portIdentifier.getName() + " - " + getPortTypeName(portIdentifier.getPortType())); } } static String getPortTypeName(int portType) { switch (portType) { case CommPortIdentifier.PORT_I2C: return "I2C"; case CommPortIdentifier.PORT_PARALLEL: return "Parallel"; case CommPortIdentifier.PORT_RAW: return "Raw"; case CommPortIdentifier.PORT_RS485: return "RS485"; case CommPortIdentifier.PORT_SERIAL: return "Serial"; default: return "unknown type"; } } } Whe I run the code on orangepiPC I get only one UART which is /dev/ttyS0 ------------------------------- 1.7.0_121 Linux /dev/ttyS0 - Serial Is there some configuration file to enable / disable UARTS? thank you.
  17. Jap.. my goal is to have Arduino connected over Gpio to orangpi pc.. (using pin 8 and 10). I'am using arduino to measure frequency up to 15 kHz (have some temp/salinity sensors which gives me frequency on the output). The measured frequency is then send over serial port to "third" components in my case will be Orangepi.. I have experience with Java so I think I can use RxTx library to read data from serial port ( /dev/ttyS3)? $ sudo apt-get install librxtx-java
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines