1

I'm looking to download images that i'm capturing on RPi to my Android Device using USB, or some wired interface that I don't know about. I'm trying to avoid using wifi, ethernet, or bluetooth.

I've had some success capturing images(jpg) on my RPi using OpenCV, and using SFTP (JSCH) on my android device to download said images. My problem is that it's way too slow. At 78Kb/image it takes way too long for the transfer to complete ~1fps. By compressing the images down to 3k using jpegoptim I can get the download rate to ~17fps but the images are useless at this point as they're pixelated and discolored.

If anyone knows about a different way to wire my RPi and Android Device to maybe avoid having to SSH or use encrypted based communication between RPi and Android, i'm all ears.

1
  • What kind of Android device? A cell phone is a lot different than a FireTV Box with a 100Mbps Ethernet connection
    – Christian
    Commented Dec 22, 2017 at 11:42

1 Answer 1

1

Using the RPi GPIO, you can access many communication protocols and use them to transfer raw data :

Serial Communication You can send datas from the RPi with the serial protocol to the android USB port. Transfert rate will be at best around 250kbps.

Here is a sample of implementation : Android side : http://www.instructables.com/id/Arduin-Adroid-USB-Serial-Communication/ RPi side : http://www.instructables.com/id/Read-and-write-from-serial-port-with-Raspberry-Pi/

I2C communication If your android device has a I2C interface, you can use also use this protocol, wich allows a transfert rate up to 3.2Mbits/s.
As this protocol is not specially designed for data transfer, you may face some unexpected hardware limitation.
Here a sample implementation : Android side : https://developer.android.com/things/sdk/pio/i2c.html Rpi side : http://www.raspberry-projects.com/pi/programming-in-python/i2c-programming-in-python/using-the-i2c-interface-2

SPI communication If your android device has an SPI interface, this may be your best option. This protocol will work only with short cable in order to enjoy the very high transfer rate, from 25 to 50 Mbps.
Here is the sample implementation : Android side : https://developer.android.com/things/sdk/pio/spi.html RPi side : https://github.com/doceme/py-spidev

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.