Shop OBEX P1 Docs P2 Docs Learn Events
Open Propeller Project #1: iPad to ActivityBot — Parallax Forums

Open Propeller Project #1: iPad to ActivityBot

Ken GraceyKen Gracey Posts: 7,392
edited 2014-04-15 17:36 in Propeller 1
OPP-iPad2AB.png

Open Propeller Project: iPad to ActivityBot
iOS Control of Propeller through TechBASIC

Welcome to our first Open Propeller Project! This project stems from a prior effort we launched in these forums - programming a Propeller from an iPad and a movement quietly underway by banjo, unsoundcode and Mike Cook. You loaded the original discussion thread with every possible solution and educated us about new possibilities we hadn't considered. Many alternatives suggested were quite interesting, including a Propeller web-based programming interface and the concept of a "configurable" robot that completes actions using a serial exchange over XBee S6B modules.

With that in mind, here are the goals for the first Open Propeller Project:
  1. Control an ActivityBot's direction and speed from an iPad using TechBASIC.
  2. Receive data from the Ping))) Ultrasonic Distance Sensor on the iPad and control the ActivityBot in a semi-autonomous fashion. While the robot would roam autonomously with the Ping))) sensor, the user would have the option to re-orient the ActivityBot's speed and direction anytime from the iPad.
And for a bonus round:
  1. Should anybody be so inspired, could the ActivityBot run a fixed set of firmware that is configured with a string of serial commands to define its behavior? As an example: play different wav files when different sensors are actuated.
This post will remain open until the project is mostly finished, at which time we'll change the tag to [completed]. Please put all of your development code on this thread.

The second post is reserved. This is where we will collect the mostly-final files so others can do this project on their own without combing through long threads. Even when the project is considered complete the thread will remain open for new posts, of course.

Will you join us in this effort?

Ken Gracey
600 x 250 - 121K
«13456711

Comments

  • Ken GraceyKen Gracey Posts: 7,392
    edited 2014-01-14 16:35
    Reserved for source code.
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-01-15 03:40
    I am definately interested to see this work, but alas no time at the moment. I have aniPad Mini Retina for when I get time.

    Meanwhile I am followingthe other thread with the work heater, jazzed and others are doing. They are learning a great deal of useful info.
  • RaymanRayman Posts: 14,659
    edited 2014-01-15 03:51
    I'm not familiar with techBASIC... Is this it?

    http://www.byteworks.us/Byte_Works/techBASIC.html
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2014-01-15 05:43
    @Rayman, yes thats the link.

    There is a thread in these forums where banjo successfully connected to an iPad using a Xbee wifi module http://forums.parallax.com/showthread.php/153072-XBee-Wifi-amp-Propeller-Activity-Board-how-to-connect

    There is a thread with info and video on Chris's Savage//Circuits where a Sparkfun Wifly is used. http://www.savagecircuits.com/showthread.php?258-Mac-OS-and-iOS-Coding/page2

    TechBasic has its limitations but has the potential to create some really nice GUI's for the Prop or Basic Stamp.

    Jeff T.
  • MikeW50MikeW50 Posts: 15
    edited 2014-01-15 08:26
    If you'd like a head start, check out the tutorial blogs on the Byte Works web site. You can find them on the DIY Blogs page. There is also an O'Reilly book that shows how to use techBASIC to connect to other devices. It's available from O'Reilly, among other sources.

    cat.gif
    180 x 236 - 20K
    cat.gif 20.4K
  • MikeW50MikeW50 Posts: 15
    edited 2014-01-15 08:29
    Hi Rayman,

    Yes, that's techBASIC. There's a lot there on the site. Be sure to check out the DIY Blogs page; there is a lot there to get you started.

    Mike
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2014-01-15 08:31
    MikeW50 wrote: »
    If you'd like a head start, check out the tutorial blogs on the Byte Works web site. You can find them on the DIY Blogs page. There is also an O'Reilly book that shows how to use techBASIC to connect to other devices. It's available from O'Reilly, among other sources.

    cat.gif

    Thanks for joining in, MikeW50! I take it you're from Byte Works. I've perused the resources you've identified and ordered the book myself.

    Many of our customers are familiar with and appreciate BASIC languages of all kinds, so I've seen a pretty quick adoption of techBASIC by some of the people above. The ease of making a quick WiFi or Bluetooth connection were exciting, too, as the iOS world has felt like it was under total lockdown until I saw those examples.

    Feel free to check back in with us, and welcome to the forums!

    Ken Gracey
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2014-01-15 08:57
    I'll admit it.. I'm still snickering a bit about using the words, "iPad" and "Open" in the same sentence.

    Not all of us have access or have made investment in Apple "i" products, opting for the more inexpensive alternatives. Any chance that there is an Android version of this "techBASIC" in the works, so that not only can other non-apple users participate, or at least expand the potential for this project outside of it's current target?

    Jeff
  • David BetzDavid Betz Posts: 14,516
    edited 2014-01-15 09:48
    I have been working on a PASM driver for the Xbee Wi-Fi module as part of a Wi-Fi program loader. If the driver itself can be of use then I'm happy to share it here.

    One question though, how are you planning to connect from the iPad to the Xbee Wi-Fi module? Are you going to use the Xbee "Soft AP" or Wi-Fi Direct mode or will you just let the Xbee get an IP address through DHCP from a local router and then use that IP address to talk to the Xbee through the router from the iPad?
  • tdlivingstdlivings Posts: 437
    edited 2014-01-15 09:50
    I have ordered the Wifi modules from SparkFun, Ken said they were not for sale yet at Parallax.
    I bought an iPad last year and have enjoyed learning about it and using it .
    I have a Mac Mini and have been playing around with Xcode and Objective C learning for my own
    knowledge something about writing apps for iPhone and IPad.
    While following the programming the propeller with iPad thread I saw TechBasic and my first thoughts
    were here is someone who has been thru some of the issues to what was trying to be accomplished.

    I have the book from TechBasic and just starting to read it, seeing this thread last night caused me to look
    at it again.

    @Jeff and Chris
    I did not know SavageCircuits was back up.
    Jeff, good comments on your recent iPad and TechBasic project there.

    Tom
  • Brian_BBrian_B Posts: 842
    edited 2014-01-15 10:39
    Hi,
    Fully agree with Jeff about the apple and open.

    I looked into buying and programming a iPad a couple of years ago ,but was scared off by the fact that you need to own a apple computer to write programs for the iPad .Did some playing around with the android and the propeller though.

    Brian
  • David BetzDavid Betz Posts: 14,516
    edited 2014-01-15 10:54
    Brian_B wrote: »
    Hi,
    Fully agree with Jeff about the apple and open.

    I looked into buying and programming a iPad a couple of years ago ,but was scared off by the fact that you need to own a apple computer to write programs for the iPad .Did some playing around with the android and the propeller though.

    Brian
    Jazzed is working on a web-based project that will run under Android as well as the iPad and is planning on using the same Wi-Fi module on the Propeller end. That's what I'm hoping my Wi-Fi loader will get used for.
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2014-01-15 11:45
    I'll admit it.. I'm still snickering a bit about using the words, "iPad" and "Open" in the same sentence.

    Not all of us have access or have made investment in Apple "i" products, opting for the more inexpensive alternatives. Any chance that there is an Android version of this "techBASIC" in the works, so that not only can other non-apple users participate, or at least expand the potential for this project outside of it's current target?

    Jeff

    Hey Jeff, whatever we can make open around our collective efforts, we shall. While we can snicker about Apple's closed system and complain about it, they're common in schools and Parallax's future depends on a higher level of integration than we have today. We're getting requests for iPad support with our products. Basic communication with iPad is one step, and program downloads is another lying somewhere in the future.

    You are not the ultimate target audience for anything related to iPad, so I wouldn't expect you to embrace this project.

    iPads were handed out at my son's public school. Their homework is distributed, collected and assessed using iTunes University. The benefit to him is tremendous - school days are shorter, class time is more productive, and less paper is shuffled around. It's a whole ecosystem around the iPad. I like what I see, and apparently others do as well.

    Would be great if there were an Android version of techBASIC (not sure) as I know this OS is quickly gaining speed on iOS in the general user market (not sure of schools).

    If you want to participate, we'd love to have you! I want to keep the tone and effort as productive as possible.

    Ken Gracey
  • mindrobotsmindrobots Posts: 6,506
    edited 2014-01-15 11:59
    The iPad just happens to be one component of this multi-part system. It happens to be the human interface device (it and TechBasic) making a WiFi connection eventually to the remote Propeller (robot or whatever). As long as nothing proprietary or iDevice specific is used to talk across this link, there shouldn't be any reason that the human interface device can't be replaced by a myriad of choices (Android, Prop2 RoboRemote, etc.). If all the pieces are made to work together with open standards, then as long as it is properly implemented and documented, the pieces should swap in an out.
  • Courtney JacobsCourtney Jacobs Posts: 903
    edited 2014-01-15 12:56
    Hello everyone,

    Just a heads up that the Parallax store now has the new Wi-Fi XBee modules in stock and available for purchase:

    XBee Wi-Fi Wire Antenna (#32412)

    XBee Wi-Fi PCB Antenna (#32413)

    Clicking on the links above will take you directly to their product pages on www.parallax.com.

    Enjoy!
  • Brian_BBrian_B Posts: 842
    edited 2014-01-15 13:09
    Ok,
    I see techBasic is a programming environment that is on the iPad ,that makes it a little easier to start programming them.

    Brian
  • banjobanjo Posts: 447
    edited 2014-01-15 13:13
    Let me then start with some very rudimentary code.
    The setup is that I have a brand new Propeller Activity Bot (PAB) and iPad (3?) with TechBasic. Only the XBee Wi-fi S6B and a Parallax Ping sensor are added to the standard configuration.

    What I've more or less succeded with is controlling the bot by tilting my iPad. Somewhat successful in receiving data from the Ping sensor back to iPad

    As mentioned in http://forums.parallax.com/showthread.php/153072-XBee-Wifi-amp-Propeller-Activity-Board-how-to-connect?p=1234690&viewfull=1#post1234690 I've some of the bits and pieces in place.

    On Propeller side I have this code:
    /*
      XBee & iPad Example.c
    */
    
    #include "simpletools.h"
    #include "fdserial.h"
    #include "abdrive.h"
    #include "ping.h"
    
    fdserial *xbee;
    char response[10];
    char ch;
    
    int xbcmd(char *cmd, char *reply, int bytesMax, int msMax);
    
    int main()
    {
    // Initializing the XBee through AT-commands, some settings are router specific
      xbee = fdserial_open(11, 10, 0, 9600);
      pause(1000);
      print("cmd = +++\n");
      int bytes = xbcmd("+++", response, 10, 6000);
      if(bytes == 0)
        print("Timeout error.\n");
      else
      {
        print("reply = %s", response);
    
        print("cmd = Replace this with your SSID\n");
        xbcmd("Replace this with your SSID\r", response, 10, 20);
        print("reply = %s", response); 
    
        xbcmd("ATEE1\r", response, 15, 2000);              // setting WPA encryption
        print("reply = %s\n", response); 
    
        print("cmd = Replace this with your security code to the router\n");
        xbcmd("ATPK8482769243\r", response, 10, 2000);
        print("reply = %s", response); 
    
        xbcmd("ATMY\r", response, 15, 200);                 // showing the XBee's IP-address
        print("reply = %s", response); 
    
        print("cmd = ATDE2616\n");                               // ensuring the port is 2616 (hex)
        xbcmd("ATDE2616\r", response, 10, 20);
        print("reply = %s", response); 
    
        print("cmd = ATIP1\n");                                      // setting IP protocol to TCP
        xbcmd("ATIP1\r", response, 10, 20);
        print("reply = %s", response); 
    
        print("cmd = ATAI\n");                                      // showing 0 if the connection was successful, otherwise another connection status indicator is shown
        xbcmd("ATAI\r", response, 10, 20);
        print("reply = %s", response); 
    
        print("cmd = ATCN\n");                                    // exiting command mode
        xbcmd("ATCN\r", response, 10, 20);
        print("reply = %s\n", response); 
    
    
      int x, y;
      int cm;
      int tx_result;
      short int ping_now = 0;
    
      drive_setRampStep(7);                       // 7 ticks/sec / 20 ms
     
      while(1)
      {
        if (ping_now == 0)                        // only ping every second time
        {
          cm = ping_cm(8);
    //      writeChar(xbee, cm);                  // should send the distance to iPad, is not working correctly for me
          ping_now = 1;
        }
        else
          ping_now = 0;
    
        print("%c", HOME);                        // debug info when running through SimpleIDe
        print("x y cm: %d %d %d\n", x, y, cm);
    
        x = fdserial_rxChar(xbee);                // receiving x (speed) from iPad
        print("%c", CLS);
        print("%c", HOME);
    
        if(x != -1)
        {
          y = fdserial_rxChar(xbee);            // receiving y (direction) from iPad
          if(y != -1)
            if(x > 124 && x < 130)              // "dead zone" to avoid jittering speed
              drive_speed(0, 0);
            
            if(x > 129)
            {
              drive_rampStep((0 - (x - 127) - (y - 127)), (0 - (x - 127)) - (127 - y));
            }    
            if(x < 125)
            {
              drive_rampStep((127 - x) + (y - 127), (127 - x) + (127 - y));
          }
        }
      if(cm < 20)                              // if too close, then reverse
        drive_speed(-15, -15);
      }
    }
    }
    
    int xbcmd(char *cmd, char *reply, int bytesMax, int msMax)
    {
      int c = -1, n = 0;
      writeStr(xbee, cmd);
      memset(reply, 0, bytesMax);
    
      int tmax = (CLKFREQ/1000) * msMax;
      int tmark = CNT;
    
      while(1) 
      {
        c = fdserial_rxCheck(xbee); 
        if(c != -1)
          reply[n++] = c;
        if(CNT - tmark > tmax)
          return 0;
        if(c == '\r')
          return n;
      }
    }
    
    ...and this is the code on iPad & TechBasic:
    Comm.openTCPIP(1, "192.168.1.17", 9750)
    
    sensors.setAccelRate(0.01)
    system.showGraphics
    
    ! Create a button 
    DIM quit AS Button quit = Graphics.newButton(10, 600, 600)
    quit.setTitle("This simulates the obstacle") System.showGraphics
    
    while 1=1
      a = sensors.accel
    
      x~ = (a(1) * 128) + 127
      y~ = (a(2) * 128) + 127
      z = a(3)
      
      REM Sending accelerator info to Propeller
      put #1,,x~
      put #1,,y~
    
    rem Remove below comments if sending distance or other data from Propeller
    rem  if not eof(1) then
    rem    GET #1,,b~
    rem  END IF
    
      rem Writing debug info to the console
      system.clearconsole
      print x~; " "; y~; " ";
      print b~
    
      ShowDist
    WEND
    
    rem Simulating the distance graphically by moving the obstacle on the screen
    sub ShowDist
      quit.setFrame (10, 650 - (b~ * 2), 600, 20)
    end sub
    
    rem Below sub not in use at the moment
    SUB nullEvent (time AS DOUBLE)
      !IF NOT EOF(1) THEN
      !GET #1,,b~
      !print chr$(b~)
      !END IF
    END SUB
    
    SUB touchUpInside (ctrl AS Button, when AS DOUBLE) 
      STOP
    END SUB
    

    Now, keep in mind that this is so far only a proof of concept and the code needs a bit cleaning and lots of comments. I'd anyway be glad to hear if others are able to get the concept working.

    Do also note that I still have some issues:
    1. Quite often I'm not able to connect between Propeller/XBee and iPad/TechBasic.
    I'm then rebooting Propeller and sometimes TechBasic to eventually get a working connection. Currently I have no clue where the root cause is, it might also be something with my router.
    2. When the Propeller is sending back the distance from a Ping sensor, what is sent on Propeller side is not received the same on TechBasic side. I'm still looking into this.

    OK, when writing this my router died completely (no power LED on, only Ethernet LED is on), so my connection issues might very well have been because of it...hmm where can I find a new router close to midnight in a small city in a small country.
    Luckily I have a bunch of iGadgets connectable through 3G.

    -Thomas
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2014-01-15 14:28
    Thomas, I've got all the hardware to duplicate your setup. All I'm missing is a bit of time - my hands are full at Parallax and I'm not that good of a programmer anyway. However, as this progresses you can count on me jumping into the mix and testing the same hardware setup. So far, you've got the lead on our efforts. Unsoundcode is wandering around somewhere, and I could send him an XBee WiFi unit so he could help us out. I'll try to track him down.

    You mentioned that your router failed. I've pulled out my hair over slow-failing, sloppy-to-configure routers in the past. You're in Finland, so maybe go here https://foursquare.com/v/verkkokauppacom/4adcdb27f964a520cc6121e3 if you are in Helsinki tomorrow morning.

    And with techBASIC developers on the forum I'm thinking they'll jump in and help us troubleshoot, too.

    Ken Gracey
  • dgatelydgately Posts: 1,630
    edited 2014-01-15 17:05
    Just as an addendum to this thread...

    I've built an iOS app (iPhone and iPad compatible) that runs a version of openspin. At this point, my project is just a proof of concept for editing, compiling and loading of .spin-based projects.

    The current status is that the app can:
    • create new .spin files and edit them
    • upload previously created .spin files as well as .spin libraries (from eMail, websites, other apps, etc.)
    • compile .spin sources and included libraries
    • display compiled results data (binary or eeprom type, file size, etc...)
    • send all file types (.spin, .eeprom, .binary) to other apps (such as eMail) for transport to other devices
    • communicates via Bluetooth LE to a modified Bluetooth Xbee (upgraded with a Bluetooth LE HM-10 module), attached to an Activity Board
    • compiled projects have been tested, though loading took place from a MacBook Pro


    Current work "in-progress"
    • working on transport of compiled binary to RAM
    • working on transport of compiled eeprom to EEPROM
    • requires iOS 6.1 or newer, using CoreBluetooth Framework

    Future work:
    • port application to Bluetooth LE enabled Android devices
    • provide other transport support (XBee WiFi type devices)
    • provide a terminal for display of running program output/input

    As a proof of concept, the project will provide a simple 'app' as a Propeller IDE on iOS devices initially, with possible port to Android tablets. I do not want to de-rail existing projects, so I'll provide a thread for the project once a complete edit-compile-load-exec can be demonstrated.

    Having said all that, I'm here to help with this open source project... I'm available for any Mac/iOS testing and development work as the need comes up!

    Thanks,
    dgately
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2014-01-15 17:19
    Hi,

    @banjo, I have your techBasic source on my Ipad and browsing through it right now. I am looking with the intent of getting the steering and speed ironed out first then ping second, I like your use of accelerometer for the controls.

    @Ken, I am using the Sparkfun Wifly at the moment in a point to point configuration, I have exchanged ASCII data with a Propeller and now I intend to use binary with banjo's program source. I am not truly familiar with some of the concepts of wifi but thought if the principal is the same then I will just stick with Sparkfun for now rather than go through configuring a new connection. Can you see this being a problem in the short term?

    Jeff T.
  • jazzedjazzed Posts: 11,803
    edited 2014-01-15 18:04
    Great work Dennis!

    Perchance, might you have time for a Video?
    dgately wrote: »
    Just as an addendum to this thread...

    I've built an iOS app (iPhone and iPad compatible) that runs a version of openspin. At this point, my project is just a proof of concept for editing, compiling and loading of .spin-based projects.

    .... snip to save bits ....
  • dgatelydgately Posts: 1,630
    edited 2014-01-15 18:27
    jazzed wrote: »
    Perchance, might you have time for a Video?

    Once I get the loader working, I'll make a video... May take some time, though.

    dgately
  • David BetzDavid Betz Posts: 14,516
    edited 2014-01-15 18:32
    dgately wrote: »
    Once I get the loader working, I'll make a video... May take some time, though.

    dgately
    Your project sounds very impressive! I look forward to trying it out!

    I'm curious as to what approach you plan for the loader? How much space does the Bluetooth code take? Can it run entirely in a COG so you can have the loader fill all of hub memory with the user program? Also, how will you provide a console link back to the iPad after the user's program starts? I'm working on something like this for an Xbee Wi-Fi module but haven't gotten as far as you have. My plan is to have the Xbee frame driver and loader run entirely in a COG once the download starts and to have it act as a console interface after the user program starts. I'm not sure there is enough space in a COG to do this but I'm optimistic. Can you share your approach with Bluetooth?

    Thanks,
    David
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2014-01-15 18:46
    @dgately, that sounds awesome can't wait to see it.

    @banjo, I'm still perusing the code and have a stripped down copy that I'm building a little at a time which I'll post here. I did away with the While/Wend because it was eating all the processor time and slowing things down greatly for me. The event sub routine named "nullevent" is designed to handle misc. events that include some changes in sensor values so that is where I put all the update stuff. I also have two bytes going to the Prop but have run out of time for today to try and receive anything. Check this out and see if it helps any, I will be back on tomorrow.
    Comm.openTCPIP(1,url,port)
    
    sensors.setAccelRate(0.01)
    system.ShowGraphics
    
    DIM quit AS Button
    quit=GraphicsNewButton(10,10)
    quit.setBackGroundColor(1,1,1)
    quit.setGradientColor(0.7,0.7,0.7)
    
    DIM debug AS TextField
    debug=Graphics.newTextField(Graphics.width/2,10,100)
    
    System.ShowGraphics
    
    Sub nullevent(time AS double)
    
    a=sensors.accel
    
    x~ =(a(1)*128)+127
    y~ =(a(2)*128)+127
    
    REM sending accelerator info to Propeller
    put #1,,x~
    put #1,,y~
    
    debug.settext(str(x~) & "   " & str(y~))
    
    End Sub
    
    Sub touchUpInside(ctrl AS Button,time AS double)
    
    If ctrl=quit Then
    STOP
    End If
    End Sub
    

    Jeff T.
  • John KauffmanJohn Kauffman Posts: 653
    edited 2014-01-15 20:02
    iPad to ActivityBot could be the hit of the USA Science and Engineering Festival robot zoo: Quote from site below.
    http://www.usasciencefestival.org/newsletter-volume-3-number-13/3rd-usa-science-engineering-latest-festival-news.html

    I'm in DC. If any of you are coming we can meet for coffee - PM me.

    - John

    Bring Your Robot To The Expo!
    Do you have a robot that you would like to showcase at the largest celebration of STEM? The USA Science & Engineering Festival is hosting our first ever "Robot Zoo" at the Expo Finale at a premiere location inside the Washington, D.C. Convention Center!

    We expect over 250,000 attendees to once again fill the halls of the Convention Center and we would like to offer them a futuristic zoo experience like no other! Do you want to share your robot design with the public? Do you like to interact with others? Would you like to show Festival attendees what makes your robot unique?

    The Festival Team will choose a group of robots to feature in our "Robot Zoo" at a special booth inside the Convention Center. Attendees will be able to meet the robots and talk with the robot creators.
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2014-01-15 20:25
    Hi,

    @banjo, I have your techBasic source on my Ipad and browsing through it right now. I am looking with the intent of getting the steering and speed ironed out first then ping second, I like your use of accelerometer for the controls.

    @Ken, I am using the Sparkfun Wifly at the moment in a point to point configuration, I have exchanged ASCII data with a Propeller and now I intend to use binary with banjo's program source. I am not truly familiar with some of the concepts of wifi but thought if the principal is the same then I will just stick with Sparkfun for now rather than go through configuring a new connection. Can you see this being a problem in the short term?

    Jeff T.

    Probably not a problem, but I don't know for certain.

    My experience with embedded WiFi was both challenging and disappointing by watching our engineers work on a project for several years that never saw completion. The Wifly and XBee S6B devices likely operate similarly as far as techBASIC is concerned, but I really wouldn't know. Perhaps the most important reason to use the XBee devices is because that's what we're selling and supporting at Parallax. Drop me an e-mail kgracey@parallax.com and I'll get you the XBee S6B (choose chip or wire antenna) so you're using the same hardware.

    Even if you have an XBee WiFi, I think it's good to have that SparkFun Wifly device as well. We really don't know if either of these devices have issues. And if our efforts serve both hardware platforms that'd be great.

    I think it'd be best if you had both pieces of hardware. Drop me your info.

    Ken Gracey
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2014-01-15 20:38
    iPad to ActivityBot could be the hit of the USA Science and Engineering Festival robot zoo: Quote from site below.
    http://www.usasciencefestival.org/newsletter-volume-3-number-13/3rd-usa-science-engineering-latest-festival-news.html

    I'm in DC. If any of you are coming we can meet for coffee - PM me.

    - John

    Hey John! I'll be there this year, so let's connect! This time we should be able to get together for dinner, too.

    Also, I received your message about taking one of our bots to the Robot Zoo. I'm interested and will reply to your PM as soon as I can.

    Ken Gracey
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2014-01-15 20:43
    dgately wrote: »
    Just as an addendum to this thread...

    I've built an iOS app (iPhone and iPad compatible) that runs a version of openspin. At this point, my project is just a proof of concept for editing, compiling and loading of .spin-based projects.

    Dan, this is most interesting and I had to read your post twice just to make sure I've got it all straight. What I'm not clear on is whether or not you've actually downloaded code to a Propeller from iOS over WiFi. Can you confirm? And Spin/ASM only, which is actually probably just fine. You might have the backbone of what we need for the S3 robot revision.

    If so, you're pretty far down the road with this project. Is it being done for personal or professional purposes? Would it helpful to have us get behind your effort as an Open Propeller Project?

    I'd like to know a bunch more, if you can share.

    Thanks,

    Ken Gracey
  • dgatelydgately Posts: 1,630
    edited 2014-01-15 22:49
    Ken Gracey wrote: »
    What I'm not clear on is whether or not you've actually downloaded code to a Propeller from iOS over WiFi. Can you confirm? And Spin/ASM only, which is actually probably just fine. You might have the backbone of what we need for the S3 robot revision.

    If so, you're pretty far down the road with this project. Is it being done for personal or professional purposes? Would it helpful to have us get behind your effort as an Open Propeller Project?

    I'd like to know a bunch more, if you can share.

    It's 'Dennis' :thumb: but, basically, I've not yet been able to load the Propeller from the iPad. I am able to send serial text data from the iPad to the Activity Board, but binary data transfer is what I'm working on now. The iPad app uses the Apple's Core Bluetooth framework, which allows communication to a Bluetooth LE (HM-10) module that I've shoe-horned onto a Bluetooth XBee board after removing the Bluetooth 2.0 module (HC-06). The pinouts of these two modules are similar, though not exactly the same. That board is plugged into the Activity Board's XBee socket and wired like any XBee device. (http://www.jnhuamao.cn/bluetooth.asp?ID=1)

    The BTLE device I am using is built by Jinan Huamao technology Co,. Ltd. The onboard firmware, labelled HMSoft version 5.21 and greater handles the BTLE connection as a peripheral device, responding to Core Bluetooth API on an iOS device. The company provides sources for an example application that runs on iOS devices. They have Android examples as well!

    To answer Dave's question: On the Propeller side, the Bluetooth device is just another UART connection. The HMSoft firmware responds to AT+ type commands to set up the UUIDs and modes needed to communicate to a "central" Bluetooth device, such as an iPhone, iPad or Android device. There is so far, very little code on the Propeller side. I send about 8 commands to the device to create an LE server (peripheral). It appears that a method very similar to previous XBee loader methods is needed. Right now, my issue is sending binary data rather than textual data.

    After reading Ken's post on iPad as development device, I remembered that I had been planning on developing an iPad/iPhone app for similar purposes. Since there are already some great open source tools available (specifically, openspin), it was just a matter of getting sources to re-compile inside an iOS project.

    Loading the binary code to the propeller is an area where I could definitely use help (Thanks to Jazzed for giving me pointers to get this far!). I'm open to any help as I think once I have this basically working from edit to loading, the app will need help in making it acceptable as an AppStore level app.

    BT LE module: http://www.ebay.com/itm/wireless-MBTV4-bluetooth-4-0-module-Low-Energy-BLE-module-Serial-port-module-ios-/271371192418?pt=LH_DefaultDomain_0&hash=item3f2efbc862


    dgately
  • banjobanjo Posts: 447
    edited 2014-01-16 00:36
    @dgately, that sounds awesome can't wait to see it.

    @banjo, I'm still perusing the code and have a stripped down copy that I'm building a little at a time which I'll post here. I did away with the While/Wend because it was eating all the processor time and slowing things down greatly for me. The event sub routine named "nullevent" is designed to handle misc. events that include some changes in sensor values so that is where I put all the update stuff. I also have two bytes going to the Prop but have run out of time for today to try and receive anything. Check this out and see if it helps any, I will be back on tomorrow.

    Jeff T.

    Jeff, thanks for the information and new code, learning something new every day. Might be that the WHILE/WEND was sometimes eating too much resources and causing some of the issues I've had.
    I'll try your code hopefully later today if I get a new WLAN ADSL-router (the old died yesterday, got resurrected this morning, but will anyhow be retired)

    -Thomas
Sign In or Register to comment.