Programming BlinkyTape from Android?

edited December 2013 in BlinkyTape Fun
Has anybody yet created a way to program BlinkyTape from an Android device using e.g. ArduinoDroid? It seems like it would be very useful to be able to pull out one's phone and load a sketch from it, or program on a keyboarded tablet without the need to fetch a bigger laptop!

If not, can somebody point me to the specs and learning resources I'd need to start cooking something of the sort up? Context: I am a professional software dev, however my usual beat is miles from the metal. I really don't have any idea how one writes an Arduino-oid 'programmer', or what BlinkyTape's programming protocol is.

Comments

  • It's possible! The biggest challenge is that many Android devices don't have a USB port that can be a host device (USB OTG), so you will either need to find one that does, or have the Android device send the data back to a computer (which might defeat the point a bit).

    PatternPaint is written in C++ using the QT library, and it should be possible to compile it for Android (though I haven't tried yet, none of my phones have USB OTG).

    The protocol to send realtime data to the BlinkyTape is hopefully simple, and the Processing example has an explanation of how it works:
    http://blinkinlabs.com/blinkytape/docs/processing/

    To upload animations, the BlinkyTape actually does a little trick to combine the animation with a pre-compiled Arduino sketch, and uploads the whole thing using the bootloader as if it were a new sketch. I had a hard time finding documentation on this (it should be the avr109 protocol), and ended up reverse engineering it by looking through the bootloader source code.
  • Revisiting this - hoping for some help! I have a Samsung S5 with an OTG cable. It powers the BlinkyTape very well. I have ArdunioDroid running, with FastLED and BlinkyTape_Arduino libraries installed. I have told ArdunioDroid that the board type is Leonardo, and have tried the avrdude uploader (the internal is not supported by Leonardo or so it says). The sketch compiles just fine, but when I go to upload it, I am asked to press the Hardware Reset button within 30 seconds. I've tried the only hardware button I can find on BlinkyTape, to no avail. Has anyone had any luck with this?
  • Following up, once in a while I get the error "Permission to use USB device not received" even after I've granted permission and told my S5 to use that setting as default.
  • Hey techiechris - hmm, I don't think anyone else has been using this ArduinoDroid setup. Our boards don't have a hardware reset button. I think the best bet here is to start the upload process with the tape unplugged, and then immediately plug the board in after sending the command.

    Let us know if that works...
  • That sounds really cool! I'm hunting down an OTG cable and will see if I can get it to work with my phone. Bummer that auto reset isn't working.
  • I just tried EVERY board type listed in ArduinoDroid, and they all error out. Trying to upload the sketch without the BT plugged in gives an error that no USB device is found.

    Other board type (other being not Leonardo) actually make the BT pause for a moment, indicating some level of communication, then gives a USB Error.

    With a board type of UNO, ArdunioDroid errors: Error - Problem uploading to board.

    I remember reading somewhere that BT was close to Leonardo. I've tried timing tricks, but either get USB permission errors, or the Hardware Reset request.

    I am looking forward to seeing of anyone else has any luck. I've tried several Android Arduino apps now. I keep looking at Android Processing, but don't see any upload mechanism in them.

    Thanks!
  • The BT works like a Leonardo, so if the app is putting out USB permissions errors, it's probably an issue with the phone software. Do you happen to have a Leonardo to test with your setup?

    My understanding of Android OTG support is that it's not well supported, and varies by phone and by the Android version.
  • I don't have a Leonardo, nor any other Arduino board. But I think I'll have to pick one up! I'm on a Galaxy S5 (Verizon) with Lollipop.

    I will try to capture the output from ArduinoDroid to see if that is any help.
  • Ok, cool. I'm still looking for an OTG cable to try with my phone (a Oneplus One with Cyanogenmod Lollipop). Looking forward to what you find!
  • Keep me posted, Matt. I don't seem to be able to capture the error output from ArduinoDroid (without transcribing it by hand) and I've had no luck getting it to talk to BT. I am thinking an standard Arduino board might have to talk to Android and do the uploads to BT... I'll be interested in seeing how you fare, if you find a OTG cable. Heck, I'd be willing to donate one to your efforts if it would help! (As long as you have a USB3 plug on your One+ One)...
  • Followup here- I was able to track down a USB OTG cable, and it can power my BlinkyTape, however it seems that USB OTG isn't working with my phone and the ROM I'm running (an older Cyanogenmod nightly).

    I ran 'USB Host Diagnostics' from the Android store, and its diagnostic is that the hardware claims support, however the OS isn't configured properly (or something like that).
  • Hmm interesting. Thanks, Matt. I'll grab that app and see what it tells me about my Samsung S5 with Lollipop 5.0. Maybe I just need to go back to the drawing board... I have an rPi with the touchscreen hat and 4 i/o buttons. Wonder if there is an easy way to program it to load a new image to BT with each different button? Wish I had more of an aptitude for Python or Processing.. So far I haven't been able to even load images to the BT from the rPi in any way. Think I'll try a new, fresh image and start over there. Ideally I'd love to have a touch screen interface for tapping an icon and loading an image to BT. But got a lot of learning to do before I get there. Cheers and thanks for keeping me updated!
  • edited April 2015
    Can't seem to upload a screenshot here. So basically it says:

    Android API:
    Claims Support - Yes
    Classes Found - Yes
    Devices Detected - Yes

    Rooted API - n/a

    Kernel:
    Claims Support - Yes
    Device Detected - Yes

    Verdict:
    OS Support - Yes
    3rd Party Apps - Full
  • Oh, so you should be pretty much good to go. It would be interesting to see if you can program an Arduino Uno or Mega (or anything besides a Leonardo) using the phone; that would rule out if it's a problem with the serial reset sequence for Leonardo/BlinkyTape.
Sign In or Register to comment.