Page 1 of 1

Move DslrDashboardServer to android

Posted: 03 Nov 2017, 11:30
by Steven
Move DslrDashboardServer to android, Is it possible?

Re: Move DslrDashboardServer to android

Posted: 06 Nov 2017, 11:34
by GonzoG
Such functionality is already in qDD but it might not work because Android has some restrictions.
Turn on "allow connection sharing" in qDD setting on device connected to camera then on remote device just enter IP address.
It works great on Windows but I haven't tried it on Android.

Re: Move DslrDashboardServer to android

Posted: 07 Nov 2017, 14:19
by Steven
I compile ddserver on android, using gcc for android/c4droid, some errors:

Code: Select all

src/main.cpp: In function 'void* udpThread(void*)':
src/main.cpp:35:1: warning: no return statement in function returning non-void [-Wreturn-type]
src/main.cpp: In function 'void* clientThread(void*)':
src/main.cpp:267:1: warning: no return statement in function returning non-void [-Wreturn-type]
src/main.cpp: In function 'void joinGroup(int, char*)':
src/main.cpp:280:59: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
src/main.cpp: In function 'void leaveGroup(int, char*)':
src/main.cpp:302:59: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
In file included from src/communicator.cpp:8:0:
src/communicator.h: In constructor 'Communicator::Communicator()':
src/communicator.h:66:24: warning: 'Communicator::mHandle' will be initialized after [-Wreorder]
src/communicator.h:65:17: warning:   'libusb_device* Communicator::mDevice' [-Wreorder]
src/communicator.cpp:10:1: warning:   when initialized here [-Wreorder]
src/communicator.cpp: In member function 'bool Communicator::readFromClient()':
src/communicator.cpp:103:34: error: 'le32toh' was not declared in this scope
src/communicator.cpp:110:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
src/communicator.cpp: In member function 'bool Communicator::processPacket(uint8_t*, int)':
src/communicator.cpp:195:39: error: 'le16toh' was not declared in this scope
src/communicator.cpp:206:34: error: 'le32toh' was not declared in this scope
src/communicator.cpp:223:47: error: 'le32toh' was not declared in this scope
src/communicator.cpp: In member function 'bool Communicator::processUsbPacket(uint8_t*, int)':
src/communicator.cpp:248:45: error: 'le32toh' was not declared in this scope
src/communicator.cpp:252:70: error: 'le16toh' was not declared in this scope
src/communicator.cpp: In member function 'uint8_t* Communicator::readUsbPacket(int&)':
src/communicator.cpp:325:46: error: 'le32toh' was not declared in this scope
src/communicator.cpp:326:46: error: 'le16toh' was not declared in this scope
src/communicator.cpp: In member function 'bool Communicator::processPacket(uint8_t*, int)':
src/communicator.cpp:243:1: warning: control reaches end of non-void function [-Wreturn-type]

Re: Move DslrDashboardServer to android

Posted: 07 Nov 2017, 16:53
by Steven
I compile ddserver by android g++ with no error, but much errors when linking:

Code: Select all

src/main.cpp: In function 'void joinGroup(int, char*)':
src/main.cpp:280:55: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if ((groupStruct.sin_addr.s_addr = inet_addr(group)) == -1)
                                                       ^
src/main.cpp: In function 'void leaveGroup(int, char*)':
src/main.cpp:302:55: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if ((groupStruct.sin_addr.s_addr = inet_addr(group)) == -1)
                                                       ^
In file included from src/communicator.cpp:8:0:
src/communicator.h: In constructor 'Communicator::Communicator()':
src/communicator.h:66:24: warning: 'Communicator::mHandle' will be initialized after [-Wreorder]
  libusb_device_handle *mHandle;
                        ^
src/communicator.h:65:17: warning:   'libusb_device* Communicator::mDevice' [-Wreorder]
  libusb_device *mDevice;
                 ^
src/communicator.cpp:10:1: warning:   when initialized here [-Wreorder]
 Communicator::Communicator() : mSocket(0), mCtx(NULL), //mIsInitialized(false), mIsUsbInitialized(false),
 ^
src/communicator.cpp: In member function 'bool Communicator::readFromClient()':
src/communicator.cpp:110:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (r == (packetSize - 4)) {
         ^
src/communicator.cpp: In member function 'bool Communicator::processUsbPacket(uint8_t*, int)':
src/communicator.cpp:268:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (writen != letoh32(header->packet_len))
                ^
/data/local/gcc/bin/../lib/gcc/arm-linux-androideabi/5.2.0/../../../../arm-linux-androideabi/bin/ld: warning: liblog.so, needed by /system/lib/libusb-1.0.so, not found (try using -rpath or -rpath-link)
./ccsGhP2V.o: In function `__static_initialization_and_destruction_0(int, int)':
main.cpp:(.text+0xaf0): undefined reference to `std::ios_base::Init::Init()'
main.cpp:(.text+0xb38): undefined reference to `std::ios_base::Init::~Init()'
./ccm2F0o9.o: In function `std::vector<ImagingUsbDevice, std::allocator<ImagingUsbDevice> >::_M_check_len(unsigned int, char const*) const':
communicator.cpp:(.text._ZNKSt6vectorI16ImagingUsbDeviceSaIS0_EE12_M_check_lenEjPKc[_ZNKSt6vectorI16ImagingUsbDeviceSaIS0_EE12_M_check_lenEjPKc]+0x54): undefined reference to `std::__throw_length_error(char const*)'
./ccm2F0o9.o: In function `__gnu_cxx::new_allocator<ImagingUsbDevice>::allocate(unsigned int, void const*)':
communicator.cpp:(.text._ZN9__gnu_cxx13new_allocatorI16ImagingUsbDeviceE8allocateEjPKv[_ZN9__gnu_cxx13new_allocatorI16ImagingUsbDeviceE8allocateEjPKv]+0x40): undefined reference to `std::__throw_bad_alloc()'
/system/lib/libusb-1.0.so: undefined reference to `pthread_setspecific@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `strtol@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `strtoul@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `__errno@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `__cxa_finalize@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `strrchr@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `pthread_cond_wait@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `atoi@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `strlen@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `strcmp@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `strdup@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `pthread_cond_timedwait@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `__cxa_atexit@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `ioctl@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `free@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `__stack_chk_fail@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `clock_gettime@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `calloc@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `fdopen@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `sscanf@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `bind@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `strchr@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `realloc@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `pthread_cond_init@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `pthread_mutex_trylock@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `gettid@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `pipe@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `pthread_key_create@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `pthread_mutex_unlock@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `pthread_key_delete@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `abort@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `strerror@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `memcpy@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `pthread_cond_broadcast@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `pthread_join@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `setsockopt@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `strncmp@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `raise@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `pthread_create@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `write@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `snprintf@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `fclose@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `stat@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `poll@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `pthread_mutex_init@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `__android_log_write'
/system/lib/libusb-1.0.so: undefined reference to `munmap@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `mmap@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `closedir@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `fcntl@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `strncasecmp@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `recvmsg@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `__stack_chk_guard@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `close@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `pthread_cond_destroy@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `nanosleep@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `asprintf@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `readdir@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `opendir@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `pthread_mutex_destroy@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `vsnprintf@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `fscanf@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `pthread_getspecific@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `open@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `pthread_mutex_lock@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `socket@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `malloc@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `uname@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `read@LIBC'
/system/lib/libusb-1.0.so: undefined reference to `getenv@LIBC'
collect2: error: ld returned 1 exit status

Re: Move DslrDashboardServer to android

Posted: 07 Nov 2017, 17:08
by Steven
Or, do static link on RPI3, then copy ddserver to android?
How do static link on RPI3?