Shop OBEX P1 Docs P2 Docs Learn Events
Programming Propellers from iPad - Page 4 — Parallax Forums

Programming Propellers from iPad

1246718

Comments

  • David BetzDavid Betz Posts: 14,516
    edited 2013-10-31 12:29
    Ken Gracey wrote: »
    I've been an internal advocate of keeping USB FTDI hardware on each board, unless it's a consumable item (like a Propeller Project Board) where we shouldn't force the customer to buy the same thing over and over again.
    Is there a version of the Project Board that has a PropPlug connector instead of USB? That would make a good target for a Wi-Fi version of the PropPlug.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-10-31 12:37
    ctwardell wrote:
    While the onboard FTDI is nice for one-off users, all those USB Serial enumerations get out of hand when you have multiple boards.
    The multiple com port (serial enumeration) issue can be overridden in several ways. Here's an FTDI document that describes the various options:

    -Phil
  • tdlivingstdlivings Posts: 437
    edited 2013-10-31 12:38
    Ken
    To send the output of the compiler in the cloud to a Propeller would be the cloud sending
    a text file describing to the Propeller board what each byte is and the address in the memory
    map to put it at. Motorola SRec and Intel Hex files are examples.
    Right now the IDE wiggles the usb port and the bootloader puts the incoming
    bytes at the right address.
    Brainstorming we need airdrop( Wifi or Bluetooth) connection to the Prop Dev board that reads
    the text description of the application image coming in and loads the bytes into memory of the Prop.
    Maybe instead of airdrop direct to prop bootloader and airdrop to usb product that has a micro on it
    that watches the air(wifi or bluetooth) for an incoming text stream and sends it out a usb port that is
    plugged into the same usb port on the present development boards. A prop plug that receives the
    text description over the air instead of from the usb port of a PC.
    I keep saying text over the air because sending text is what the internet likes to send.

    Related to my earlier post Matlab appears to be sending text strings to their Matlab application running on
    another piece of hardware from the iPad application and receiving what to display back.

    Seems like an idea is an over the air IDE that receives text strings over the air and executes the IDE and compiler
    on server hardware and sends back the results. Results being the final output I describe above or maybe also
    screen images as the student is editing and sending that to the cloud IDE. Brainstorming here a command line
    version of the compiler but more advanced commands than just build.

    I do not like the idea of connecting the iPad to an experiment through the audio port or any other as the chance
    of bricking the iPad with a lethal voltage is to dangerous. iPad's are not repairable.

    My thoughts hope it helps
    Tom


  • David BetzDavid Betz Posts: 14,516
    edited 2013-10-31 12:39
    Would something like this work? Could Parallax make one of these except with a PropPlug connector and an onboard Propeller chip to handle the tricky timing required to program the target Propeller?

    https://www.sparkfun.com/products/12580
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2013-10-31 12:39
    David Betz wrote: »
    Is there a version of the Project Board that has a PropPlug connector instead of USB? That would make a good target for a Wi-Fi version of the PropPlug.

    No, I'm really referring to the Propeller Proto Board without USB http://www.parallax.com/product/32212. Even I get mixed up over the number of Propeller boards we offer.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-10-31 12:41
    Ken Gracey wrote: »
    No, I'm really referring to the Propeller Proto Board without USB http://www.parallax.com/product/32212. Even I get mixed up over the number of Propeller boards we offer.
    :-)

    Anyway, that would be a good target as well!
  • tdlivingstdlivings Posts: 437
    edited 2013-10-31 12:42
    David Betz wrote: »
    Is there a version of the Project Board that has a PropPlug connector instead of USB? That would make a good target for a Wi-Fi version of the PropPlug.

    Dave I was typing when you posted that is what I was thinking of in my previous post

    Tom
  • jazzedjazzed Posts: 11,803
    edited 2013-10-31 12:52
    David Betz wrote: »
    Are you suggesting to use something like a Spineret to actually program the target Propeller? In other words, the tablet sends an HTTP request to the Spineret and it talks to the target Propeller over a serial connection? Actually, that would limit the number of Propeller boards this would work with since most don't have PropPlug connectors these days but instead have the FTDI chip directly on them.

    As for transport, I was suggesting what Invent-O-Doc mentioned before. It could be done with a Spinneret and an Ethernet-Wifi dongle for a direct connection via a WiFi router.

    The other alternative was the SD WiFi card setup someone previously mentioned which would presumably be cheaper and much more compact. Where's that link?

    A Javascript SPIN compiler would be transparent. Performance? Who knows?

    Jeff's ideas with NaCl are very much worth exploring.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-10-31 12:54
    jazzed wrote: »
    As for transport, I was suggesting what Invent-O-Doc mentioned before. It could be done with a Spinneret and an Ethernet-Wifi dongle for a direct connection via a WiFi router.

    The other alternative was the SD WiFi card setup someone previously mentioned which would presumably be cheaper and much more compact. Where's that link?

    A Javascript SPIN compiler would be transparent. Performance? Who knows?

    Jeff's ideas with NaCl are very much worth exploring.
    Hmmm... Looks like I need to keep quiet and read the rest of the thread! Sounds like other people have already suggested the things I'm talking about. :-)
  • dnalordnalor Posts: 222
    edited 2013-10-31 13:03
    I'm not quite sure what you could do with this:
    http://electricimp.com/product/

    And if you have to use their servers. The company seems to be not far away from Parallax.
    Perhaps a collaboration?
  • Heater.Heater. Posts: 21,230
    edited 2013-10-31 13:04
    Ken,

    Glad to see you don't take offense at the "boo"s from the back row.
    Could compiled binaries be transferred over WiFi from device to Propeller, with some app to display data on the iPad over the same communication means?
    You do of course need a device connect via serial/USB to the Propeller board, a device that can make a WIFI connection.

    If that device were, say, a Raspberry Pi it could take binaries from the WIFI connection and load them to the Propeller. We have already done this, the loader that comes with propgcc works fine on the PI.

    Of course you could just send source code to that Pi and have the Pi compile and load the Propeller. propgcc and the Open Source Spin compilers both work fine on the Pi already

    Then of course if the IDE is WEB based it can be served up from that same Pi as well! I suggest looking at the "Cloud 9" IDE and ACE editor. See them in action here https://c9.io/

    This can for sure be done as the Beagle Bones already use Cloud 9 as an on board web based IDE.

    There you have it, a complete "cloud" based development system with browser interface all running on a Raspberry Pi !

    One Pi per student, $50 dollars each.

    Jazzed,
    For SPIN why not put both the editor and the compiler in the browser?
    Yes, and again yes!
    Someone might be able to port Roy's openspin to Javascript. Maybe that's impossible?
    There is no "porting" required. Simply use Emscripten to compile (translate, transcompile?) the existing C/C++ source code of Open Spin to JavaScript. See here: https://github.com/kripken/emscripten/wiki
    I managed to compile the fft_bench from C to JS and it runs in a page in FireFox about 6 times slower than native. Not bad.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-10-31 13:37
    Heater. wrote: »
    Ken,

    Glad to see you don't take offense at the "boo"s from the back row.

    You do of course need a device connect via serial/USB to the Propeller board, a device that can make a WIFI connection.

    If that device were, say, a Raspberry Pi it could take binaries from the WIFI connection and load them to the Propeller. We have already done this, the loader that comes with propgcc works fine on the PI.

    Of course you could just send source code to that Pi and have the Pi compile and load the Propeller. propgcc and the Open Source Spin compilers both work fine on the Pi already

    Then of course if the IDE is WEB based it can be served up from that same Pi as well! I suggest looking at the "Cloud 9" IDE and ACE editor. See them in action here https://c9.io/

    This can for sure be done as the Beagle Bones already use Cloud 9 as an on board web based IDE.

    There you have it, a complete "cloud" based development system with browser interface all running on a Raspberry Pi !

    One Pi per student, $50 dollars each.

    Jazzed,

    Yes, and again yes!

    There is no "porting" required. Simply use Emscripten to compile (translate, transcompile?) the existing C/C++ source code of Open Spin to JavaScript. See here: https://github.com/kripken/emscripten/wiki
    I managed to compile the fft_bench from C to JS and it runs in a page in FireFox about 6 times slower than native. Not bad.
    I really like the idea of using the RaspberryPi! It will give me an excuse to buy one finally! :-)
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2013-10-31 14:00
    Heater, what you're suggesting is we just make a Pi part of the development tools required to load code into a a Propeller. Then, all we're missing is some sort of user interface on an iPad which can be used to edit the code and get it to the Pi for compiling and download, right?
  • KyeKye Posts: 2,200
    edited 2013-10-31 14:03
    You know, the PI needs quite a bit of battery power... it draws 700 mA constantly.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-10-31 14:05
    Ken Gracey wrote: »
    Heater, what you're suggesting is we just make a Pi part of the development tools required to load code into a a Propeller. Then, all we're missing is some sort of user interface on an iPad which can be used to edit the code and get it to the Pi for compiling and download, right?
    If you add a USB hub you can probably get a single RaspiPi to serve multiple students.
  • mindrobotsmindrobots Posts: 6,506
    edited 2013-10-31 14:20
    Yep.....


    ......looks like we're all circling back to my post #13 from this thread.....


    ........ good to know, some ideas are classic! :lol:
  • RaymanRayman Posts: 14,659
    edited 2013-10-31 14:46
    I still think the FlashAir is going to be your easiest approach to this...
  • David BetzDavid Betz Posts: 14,516
    edited 2013-10-31 14:51
    mindrobots wrote: »
    Yep.....


    ......looks like we're all circling back to my post #13 from this thread.....


    ........ good to know, some ideas are classic! :lol:
    Sorry, I guess I didn't read the thread as thoroughly as I should have. I started reading your post 13 but thought it just dealt with programming languages and missed the idea at the end to use a BeagleBone or RaspPi as an interface to the Propeller.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-10-31 14:53
    Rayman wrote: »
    I still think the FlashAir is going to be your easiest approach to this...
    Will the FlashAir let you write data to the card from a tablet? The description of it that I found only talked about reading data from the card.
  • jazzedjazzed Posts: 11,803
    edited 2013-10-31 15:00
    Heater. wrote: »
    Jazzed,

    Yes, and again yes!

    There is no "porting" required. Simply use Emscripten to compile (translate, transcompile?) the existing C/C++ source code of Open Spin to JavaScript. See here: https://github.com/kripken/emscripten/wiki
    I managed to compile the fft_bench from C to JS and it runs in a page in FireFox about 6 times slower than native. Not bad.
    So, this requires LLVM output? There is an openspin.osx in the propeller-gcc release_1_0 branch that is compiled with Mac LLVM if you want to try converting that.
    https://code.google.com/p/propgcc/source/browse/?name=release_1_0#hg%2Frelease
  • RaymanRayman Posts: 14,659
    edited 2013-10-31 15:04
    David Betz wrote: »
    Will the FlashAir let you write data to the card from a tablet? The description of it that I found only talked about reading data from the card.

    Yes. It's not enabled by default though. There is a config text file on the card you have to edit to enable this.
    Then you can browse to upload.cgi to put files onto the SD card...
  • jazzedjazzed Posts: 11,803
    edited 2013-10-31 15:08
    Rayman wrote: »
    Yes. It's not enabled by default though. There is a config text file on the card you have to edit to enable this.
    Then you can browse to upload.cgi to put files onto the SD card...
    How many of these can you have running at once in the same room? Is it client-server, peer-to-peer, or other?

    Is there a way to talk to Propeller with it in some terminal window?
  • Heater.Heater. Posts: 21,230
    edited 2013-10-31 15:19
    Ken
    ...what you're suggesting is we just make a Pi part of the development tools required to load code into a a Propeller.
    Well, when I say "Raspberry Pi" I really mean any small cheap device that can:

    a) Accept a network connection, Ethernet, WIFI, whatever.
    b) Load the Propeller via serial/USB using the loader we already have.
    c) Run the Open Source Spin compiler and propgcc.
    d) Hopefully also host server for the browser based IDE.

    The Pi can do all that today. As can other ARM boards like Beagle Bone Black. There are a rash of cheap ARM boards like that now. As far as I can tell the Pi is still the cheapest.

    As has been pointed out, one could have a Pi connected to many student's Propellers if cost is an issue.
    Then, all we're missing is some sort of user interface on an iPad which can be used to edit the code and get it to the Pi for compiling and download, right?
    The user interface is the browser. The IDE is Cloud 9 or something home grown based on the ACE editor. Throw in tty.js for the terminal connection.

    Of course for Spin programming some work will need to be done on Cloud 9 or ACE for sytax highlighting. I belive C/C++ is supported already.

    If someone wants to add an Apple or Android specific IDE app then why not? Seems unnecessary.

    Kye,
    ...the PI needs quite a bit of battery power...
    True. who said anything about batteries?

    Rayman,

    I suspect those FlashAir or other WIFI SD cards will cost more than a decent Linux running ARM board. Also they are no use for getting data communication from a program running on the Prop back to a terminal or other data display in the browser (or anywhere).
  • John AbshierJohn Abshier Posts: 1,116
    edited 2013-10-31 15:26
    What are the chances of having the rug yanked from under Parallax's feet by the following: Apple, Google (Android), Linux, Microsoft (Windows)? I would favor a solution that is more resistant to the whims of one company. This group probably has a hard time really understanding the technical capabilities of classroom teachers. The teacher that mentors a FIRST team may be the exception. The solution should be at least as easy Lego. I agree that graphical representation of data back from the Propeller is important. As I read through over 100 posts, I break the problem down into 3 parts. 1. Edit and compile a program. I think this could be a native app on iPad or whatever. 2. Download to Propeller. I would go with a box that has wifi. Send program binary to box, box programs Propeller. 3. Data return for visualization. Write to an SD card. For anything but iPad, put SD card in device. For iPad, put SD card in box and box sends it to iPad via wifi. If you have money to burn, put the box on each Propeller device.

    John Abshier

    PS. For robots, batteries are essential. I see batteries being useful for non robotics applications, for example a new version of Applied Sensors
  • jazzedjazzed Posts: 11,803
    edited 2013-10-31 15:35
    I like the WiFly device that Mike Green mentioned.

    The feature list is very impressive: http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Wireless/WiFi/WiFly-RN-UM.pdf

    It has GPIO (Propeller-Reset?), Uart Support, AdHoc, Client Server modes.
  • Heater.Heater. Posts: 21,230
    edited 2013-10-31 15:35
    Jazzed,
    So, this requires LLVM output?
    No. Emscripten uses Clang and LLVM internally.

    Like GCC the Clang/LLVM compiler has many backend code generators for different machine architectures, x86, ARM, MIPs etc.

    Emscripten is a Clang/LLVM back end that targets JavaScript. It literally compiles C/C++ souce to JavaScript. It can output JS that is directly runnable on the command line under node.js or for use in a web browser.

    Now, as an aside, Emscripten generates a subset of JavaScript known as asm.js. asm.js is normal js but written in such a way that a JS engine can make some very agressive optimizations on it. The FireFox engine is especially good at this now. No matter it runs well enough under a regular JS engine.

    The nice thing about this is that as the C++ source is developed there is no continuous reworking of any "ported" JS to do. Just recompile it again with Emscripten.
  • Don MDon M Posts: 1,652
    edited 2013-10-31 15:42
    For all these ideas for connectivity I would have to agree with Heater on using the Raspberry Pi. It has ethernet connectivity and USB master. Could also be WiFi with a cheap adapter. That whole solution would be far less expensive than using a spinneret and limiting your connection to a "prop plug" or any other connection devices. Plus they are readily available.

    With the proper software packaged for the Pi you wouldn't even need a monitor or keyboard. Just load the software on SD card, add power supply and go. Then your web based IDE can be universal.
  • Don MDon M Posts: 1,652
    edited 2013-10-31 15:47
    Kye wrote: »
    You know, the PI needs quite a bit of battery power... it draws 700 mA constantly.

    So who uses batteries to program the Propeller board? Once the Prop is programmed the Prop board can run on a battery. The Pi would only be needed to do the programming.
  • Don MDon M Posts: 1,652
    edited 2013-10-31 15:50
    Rayman wrote: »
    I still think the FlashAir is going to be your easiest approach to this...

    Correct me if I'm wrong but then you'd need some bootloader or such in the tergat Prop. What if I don't have room for that? I would prefer something that is self contained and allows the Prop to have total freedom with code space memory and not be tied down to some operating system.
  • John AbshierJohn Abshier Posts: 1,116
    edited 2013-10-31 15:51
    Re batteries: Scenario, class goes to the park near the school to measure ground moisture and the ph of water in the creek. Need batteries there to get readings back to the iPad.

    John Abshier
Sign In or Register to comment.