WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: connecting android mobile via usb to tiny core  (Read 1847 times)

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
connecting android mobile via usb to tiny core
« on: August 01, 2015, 03:42:44 AM »
hi
my mobile supports mtp & ptp
so , I installed libmtp.tcz then ran mtp-detect
I got following output

Device 0 (VID=22b8 and PID=2e82) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team

Also see attached file.

BTW the commands starting with mtp are

mtp-albumart      mtp-delfile       mtp-files         mtp-getfile       mtp-newfolder     mtp-reset         mtp-thumb
mtp-albums        mtp-detect        mtp-folders       mtp-getplaylist   mtp-newplaylist   mtp-sendfile      mtp-tracks
mtp-connect       mtp-emptyfolders  mtp-format        mtp-hotplug       mtp-playlists     mtp-sendtr        mtp-trexist


How to mount  mtpfs and read/write on it ?   
« Last Edit: August 01, 2015, 03:55:11 AM by manit123 »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 9969
Re: connecting android mobile via usb to tiny core
« Reply #1 on: August 01, 2015, 04:08:09 AM »
I guess you're using libmtp from tc-4.x, which is quite old - you might be better off compiling the latest version and trying with that?

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
Re: connecting android mobile via usb to tiny core
« Reply #2 on: August 01, 2015, 04:11:41 AM »
ok , mine is 4.7.7 . Say I upgrade to 6.3 .
Still , do  i have to  ./configure , make and make-install on extracted libmtp tarball ?  No simpler way ?
Also , I was asking about absence of mtpfs command in my previous post ?
 

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 9969
Re: connecting android mobile via usb to tiny core
« Reply #3 on: August 01, 2015, 04:19:51 AM »
Yes, if you upgraded to tc-6.x you would have to compile libmtp, but it shouldn't be difficult and perhaps the latest version has mtpfs in it.

Besides, think of the service you'd be doing for the tinycorelinux community by submitting an updated libmtp extension  ;)

Edit: the mtpfs source is here: http://www.adebenham.com/mtpfs/
« Last Edit: August 01, 2015, 04:22:45 AM by Juanito »

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
Re: connecting android mobile via usb to tiny core
« Reply #4 on: August 01, 2015, 05:15:45 AM »
ok
i am using 6.3
downloaded libmtp-1.1.9.tar.gz from  http://sourceforge.net/projects/libmtp/files/latest/download

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
Re: connecting android mobile via usb to tiny core
« Reply #5 on: August 01, 2015, 05:23:24 AM »
./configure in libmtp-1.1.9 said

configure: error: no acceptable C compiler found in $PATH

so i did
$ tce-load -wi gcc.tcz
gcc.tcz.dep OK
gcc_libs-dev.tcz.dep OK
Downloading: gcc_libs.tcz
Connecting to ftp.nluug.nl (192.87.102.42:80)
wget: server returned error: HTTP/1.1 416 Requested Range Not Satisfiable
gcc_libs.tcz: FAILED
md5sum: WARNING: 1 of 1 computed checksums did NOT match
Error on gcc_libs.tcz


Now , what should I do ?
(BTW i have selected fastest mirror after
tc@box:/tmp/tce/optional$ tce-load -wi gcc.tcz
gcc.tcz.dep OK
gcc_libs-dev.tcz.dep OK
cloog.tcz.dep OK
isl.tcz.dep OK
mpc.tcz.dep OK
mpfr.tcz.dep OK
Downloading: mpfr.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
wget: download timed out
md5sum: can't open 'mpfr.tcz': No such file or directory
mpfr.tcz: FAILED
md5sum: WARNING: 1 of 1 computed checksums did NOT match
Error on mpfr.tcz
)
« Last Edit: August 01, 2015, 05:25:59 AM by manit123 »

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1640
Re: connecting android mobile via usb to tiny core
« Reply #6 on: August 01, 2015, 05:47:03 AM »
Hi,
Load the  compiletc.tcz  extension.
Download a copy and keep it handy: Core book ;)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 9969
Re: connecting android mobile via usb to tiny core
« Reply #7 on: August 01, 2015, 05:48:26 AM »
It also looks like you may be using the same /tce folder as you used in tc-4.x for tc-6.x - if this is the case, you need to update all your extensions using the apps gui.

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
Re: connecting android mobile via usb to tiny core
« Reply #8 on: September 29, 2015, 01:14:04 AM »
finally I booted from tiny core 6.3
installed compiletc,libusb,libusb-dev

Code: [Select]
tc@box:~/Downloads/libmtp-1.1.9$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether ln -s works... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/local/bin/sed
checking for grep that handles long lines and -e... /usr/local/bin/grep
checking for egrep... /usr/local/bin/grep -E
checking for fgrep... /usr/local/bin/grep -F
checking for ld used by gcc... /usr/local/bin/ld
checking if the linker (/usr/local/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/local/bin/nm -B
checking the name lister (/usr/local/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 32768
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-linux-gnu file names to i686-pc-linux-gnu format... func_convert_file_noop
checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/local/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/local/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/local/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for ld used by gcc... /usr/local/bin/ld
checking if the linker (/usr/local/bin/ld) is GNU ld... yes
checking for shared library run path origin... done
checking for iconv... yes
checking for working iconv... no
checking for iconv declaration...
         extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for doxygen... false
checking if the host operating system is Darwin... no
checking if the host operating system is Linux... yes
checking For MinGW32... no
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for LIBUSB... yes
checking for libgcrypt... checking for gcry_check_version in -lgcrypt... yes
configure: MTPZ functionality enabled
configure: *** using libusb 1.0.19 ***
checking for ANSI C header files... (cached) yes
checking whether time.h and sys/time.h may both be included... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking libgen.h usability... yes
checking libgen.h presence... yes
checking for libgen.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for string.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking byteswap.h usability... yes
checking byteswap.h presence... yes
checking for byteswap.h... yes
checking sys/uio.h usability... yes
checking sys/uio.h presence... yes
checking for sys/uio.h... yes
checking for an ANSI C-conforming const... yes
checking for off_t... yes
checking return type of signal handlers... void
checking for size_t... yes
checking for struct stat.st_blksize... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for working memcmp... yes
checking whether lstat correctly handles trailing slash... yes
checking whether stat accepts an empty string... no
checking for basename... yes
checking for memset... yes
checking for select... yes
checking for strdup... yes
checking for strerror... yes
checking for strndup... yes
checking for strrchr... yes
checking for strtoul... yes
checking for usleep... yes
checking for mkstemp... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for uint8_t in stdint.h... yes
checking whether byte ordering is bigendian... no
checking for le32toh in machine/endian.h... no
checking for ntohl in arpa/inet.h... yes
checking for swap32 in machine/endian.h... no
checking for bswap_32 in byteswap.h... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating src/libmtp.h
config.status: creating doc/Doxyfile
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating src/Makefile
config.status: creating examples/Makefile
config.status: creating util/Makefile
config.status: creating libmtp.sh
config.status: creating hotplug.sh
config.status: creating libmtp.pc
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
tc@box:~/Downloads/libmtp-1.1.9$ make
make  all-recursive
make[1]: Entering directory '/home/tc/Downloads/libmtp-1.1.9'
Making all in src
make[2]: Entering directory '/home/tc/Downloads/libmtp-1.1.9/src'
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -I/usr/local/include/libusb-1.0  -g -O2 -Wall -Wmissing-prototypes -MT libmtp_la-libmtp.lo -MD -MP -MF .deps/libmtp_la-libmtp.Tpo -c -o libmtp_la-libmtp.lo `test -f 'libmtp.c' || echo './'`libmtp.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include/libusb-1.0 -g -O2 -Wall -Wmissing-prototypes -MT libmtp_la-libmtp.lo -MD -MP -MF .deps/libmtp_la-libmtp.Tpo -c libmtp.c  -fPIC -DPIC -o .libs/libmtp_la-libmtp.o
libmtp.c: In function 'LIBMTP_Open_Raw_Device_Uncached':
libmtp.c:1873:17: error: 'PTPParams' has no member named 'cd_locale_to_ucs2'
   current_params->cd_locale_to_ucs2 = iconv_open("UCS-2LE", "UTF-8");
                 ^
libmtp.c:1873:3: warning: implicit declaration of function 'iconv_open' [-Wimplicit-function-declaration]
   current_params->cd_locale_to_ucs2 = iconv_open("UCS-2LE", "UTF-8");
   ^
libmtp.c:1874:17: error: 'PTPParams' has no member named 'cd_ucs2_to_locale'
   current_params->cd_ucs2_to_locale = iconv_open("UTF-8", "UCS-2LE");
                 ^
libmtp.c:1876:20: error: 'PTPParams' has no member named 'cd_locale_to_ucs2'
   if(current_params->cd_locale_to_ucs2 == (iconv_t) -1 ||
                    ^
libmtp.c:1876:44: error: 'iconv_t' undeclared (first use in this function)
   if(current_params->cd_locale_to_ucs2 == (iconv_t) -1 ||
                                            ^
libmtp.c:1876:44: note: each undeclared identifier is reported only once for each function it appears in
libmtp.c:1877:20: error: 'PTPParams' has no member named 'cd_ucs2_to_locale'
      current_params->cd_ucs2_to_locale == (iconv_t) -1) {
                    ^
libmtp.c: In function 'LIBMTP_Release_Device':
libmtp.c:2364:3: warning: implicit declaration of function 'iconv_close' [-Wimplicit-function-declaration]
   iconv_close(params->cd_locale_to_ucs2);
   ^
libmtp.c:2364:21: error: 'PTPParams' has no member named 'cd_locale_to_ucs2'
   iconv_close(params->cd_locale_to_ucs2);
                     ^
libmtp.c:2365:21: error: 'PTPParams' has no member named 'cd_ucs2_to_locale'
   iconv_close(params->cd_ucs2_to_locale);
                     ^
Makefile:506: recipe for target 'libmtp_la-libmtp.lo' failed
make[2]: *** [libmtp_la-libmtp.lo] Error 1
make[2]: Leaving directory '/home/tc/Downloads/libmtp-1.1.9/src'
Makefile:515: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/tc/Downloads/libmtp-1.1.9'
Makefile:377: recipe for target 'all' failed
make: *** [all] Error 2

Now what should I do ?


Searched a bit .
http://askubuntu.com/questions/178364/i-am-trying-to-build-libmtp-1-1-14-but-i-cannot-fix-this-error tells about gettext and libiconv .
installed gettext and gettext-dev . no effect .
libiconv not available .(http://forum.tinycorelinux.net/index.php/topic,17689.msg106251.html#msg106251)
« Last Edit: September 29, 2015, 01:27:25 AM by manit123 »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 9759
Re: connecting android mobile via usb to tiny core
« Reply #9 on: September 29, 2015, 02:24:54 AM »
One of those is a fault in libmtp source code (missing include for the iconv functions), the other may be as well. ptp.h comes from libptp2, which may be a part of libmtp now, I don't know.
The only barriers that can stop you are the ones you create yourself.

Offline labeas

  • Full Member
  • ***
  • Posts: 144
Re: connecting android mobile via usb to tiny core
« Reply #10 on: January 13, 2018, 03:23:03 PM »
My topic is similar: TC64 USB tethered to Android[mobile].
After plugging USB: TC64:Laptop to Android
-> dmesg |tail ==
usb 1-5.4: USB disconnect, device number 7
usb 1-5.4: new high-speed USB device number 8 using xhci_hcd
usbcore: registered new interface driver cdc_ether
cdc_acm 1-5.4:1.2: ttyACM0: USB ACM device
cdc_acm 1-5.4:1.4: ttyACM1: USB ACM device
cdc_acm 1-5.4:1.6: ttyACM2: USB ACM device
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
rndis_host 1-5.4:1.0 usb0: register 'rndis_host' at usb-0000:00:14.0-5.4,
 RNDIS device, 02:35:07:05:0b:0d <-?- IP6 ?
usbcore: registered new interface driver rndis_host  <-?-

=> see latest modules loaded:
-> lsmod -t |head ==
Module                  Size  Used by    Not tainted
rndis_host             12288  0
cdc_ether              12288  1 rndis_host <-? for ttyACM*
usbnet                 20480  2 rndis_host,cdc_ether
cdc_acm                24576  0
............
==> So it looks as if the connection would be by Ethernet ?.
Previously I was able to able to copy files between a PC & a rPi,
via an ETH-cable, using mc or nc.
Can the USB-cable and the rndis_host, cdc_ether, usbnet also
 communicate: linuxPC <-> AndroidTablet ?

=> mc > ......
To connect to a remote machine, you just need to chdir into a special directory
which name is in the following format:
sh://[user@]machine[:options]/[remote-dir] .......
eg: sh://joe@want.compression.edu:C/private

So what's the latest on file transfer between TC64 & AndroidMobile ?


Offline andyj

  • Hero Member
  • *****
  • Posts: 571
Re: connecting android mobile via usb to tiny core
« Reply #11 on: January 13, 2018, 04:34:33 PM »
In my experience simple-mtpfs is what it says it is. I've built an extension for 64-bit, I tested it with my Moto X in a VM and it works, so I'll upload it shortly.