Shop OBEX P1 Docs P2 Docs Learn Events
Running S2 GUI on a Mac in after school robotics program — Parallax Forums

Running S2 GUI on a Mac in after school robotics program

jphilljphill Posts: 4
edited 2014-08-25 21:12 in Robotics
I'm starting a robotics program at a school using the Scribbler S2. Unfortunately, the school's computers are all Macs, and I can't seem to install the GUI there. Some kids have PC Laptops they can bring in and share, and the Mac users can use Brad's Spin Tool (BST) as they learn spin, but it's still not ideal. I was hoping to use the GUI to teach them spin.

It seems like one solution would be to install VMFusion onto the Macs. That would allow the Mac basically to run Windows, which would allow it to run the GUI. The problem is money. The VMFusion software is about $60, and then I'd have to get a Windows license. I'm not sure how much that is. And there are five computers I'd want to put it on.

Do any of you know any other solutions?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-09-16 17:58
    jphill,

    I feel your pain.

    I'm the author of the S2 GUI. It's written in Perl/Tk. Unfortunately, the "Tk" part has never adequately been ported natively to OS/X without also requiring the X11 window manager. Early this Spring, I had a glimmer of hope, in that there was a purported Perl module that interfaced to the native OS/X version fo the Tcl/Tk library. Unfortunately, it proved less than suitable for the S2 GUI.

    I'm currently investigating a way to redo the S2 GUI such that it interfaces to a standard internet browser to handle the GUI part. The idea is that it would run with a local server program to handle the file operations and serial-port interfacing and use HTML5 and Ajax techniques for the GUI part. It would have to be an almost complete rewirte, though, so I can't offer any hope of a quick roll-out.

    Rest assued, however, that Parallax and I are acutely aware of the need to multi-platform this program. I'm just sorry that I cannot offer a more immediate solution that doesn't cost money for your school district.

    -Phil
  • ElectrodudeElectrodude Posts: 1,644
    edited 2013-09-16 18:12
    Try Wine. It's free but has bugs i.e. is somewhat incomplete. Get Fink or Macports and tell that to install wine for you; otherwise it's an absolute headache because it just has too many dependencies. I experimented and found I could install the S2 gui on it and it ran and I could edit the program, but I don't know if you'll be able to get it to compile or program to the Scribbler. It wouldn't show SPIN output like it's supposed to for me. The normal Parallax Spin Tool seems to work, but I got it to crash by clicking on the file browser on the left. Either way, I'd recommend BST even on a PC.

    (Disclaimer: this is based of of my experiences messing with the Scribbler 1 Gui; I've never had a real Scribbler, 1 or 2) The Scribbler 2 Gui won't teach your kids SPIN. If it's anything like the Scribbler 1 Gui, (and I have no idea because it won't show SPIN output), the SPIN output it makes will be for experts only.

    electrodude

    EDIT: @PhiPi: It would probably be pretty easy to make a Wine/Mac version of S2.exe - just get the Windows one, fix whatever doesn't work on a Mac in wine, and run it in Wine.
  • dgatelydgately Posts: 1,628
    edited 2013-09-16 18:37
    Well, you can run VirtualBox on a Mac, which should allow you run "some" version of Windows that would support the S2 app. You would still need to figure out how to get legal versions of Windows for the Macs.

    https://www.virtualbox.org


    Or, try these other options which do not require a licensed Windows installation.

    Mono:OSX - Mono

    http://wineskin.urgesoftware.com/tiki-index.php?page=Downloads

    http://www.playonmac.com/en/ <== I've used this one and the only problem was in getting the Windows/USB serial ports to work. The problems have been resolved by others, so you'll need to research on the Play On Mac forums.


    Let us know if any of these work out for you.

    dgately
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-09-16 19:22
    jphill,

    I have merged your duplicate threads and deleted the duplicate top post. Duplicate threads are not permitted in this forum, but you're new here and probably did not know.

    Thanks for your understanding.

    -Phil
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-09-16 19:35
    Electrodude,

    I looked at the Fink and Macports webpages. It appears that they provide a way to make installation packages for X11-dependent Unix-style software. (I'm not sure I get what the Wine connection is, however.) In any event, if they can turn an X11-dependent program into a native OS/X install package that does not require a separate X11 install, I might consider using one of them. A separate X11 install is almost always a deal killer for school system sys admins, though.

    -Phil
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2013-09-16 22:45
    jphill,

    I'd like to welcome you to the forums - I can see you have a small number of posts. I work at Parallax and I'm in agreement with you about the need to get the S2 GUI running under Mac, without VMFusion and a Windows license. In fact, even the developer of the software (PhiPi, above) agrees with you and has looked into this several times at our request. When the GUI design was initially started Macs were out of favor in schools, and now it seems to be the reverse. About the same time we catch up with trends it's time to target our tools to another OS.

    I also use the S2 with middle school students. My early experiences are here http://forums.parallax.com/entry.php/833-Parallax-President-Ken-Gracey-gets-Hands-on-Teaching-Robotics but now I'm in my third year of working with the middle school students and the S2. There's so much you can do with the S2, and so easily. The combination of the GUI with the precision motor control makes this robot a very capable tool for a student's first experience with programming.

    Last week I ran a course at Parallax for teachers to learn the S2. The teachers had a fairly diverse teaching background: after school robotics club; foster care programs in Los Angeles; physics teacher; retired mechanical engineer who volunteers in high school; and robotics instructor.

    You can see that I really have a special place in my heart for this robot.

    But to your question. As I see it you've got four options [or three, really]:
    1. The VMFusion with Windows option isn't all bad. It works reliably, probably even better than Windows. See below.
    2. Get some Windows netbooks for $250 or $300.
    3. Wait for us to develop an open system for Mac, Windows and Linux. This is our preferred long-term alternative but it won't happen fast. The GUI is a fairly complex piece of software, taking over a year to develop as you see it today. Some other things we might look into with a future release are a GUI which generates C code and programming under Scratch.
    4. 12Blocks http://onerobot.org/products/12blocks/ runs under Mac/Win/Linux.
    You chose a great robot for your class and we're sticking with it for the long term. Changes with this robot happen slowly since the hardware is part of a high-volume production process.

    Ken Gracey

    Screen Shot 2013-09-16 at 10.34.46 PM.jpg
  • David BetzDavid Betz Posts: 14,514
    edited 2013-09-29 14:36
    Ken Gracey wrote: »
    But to your question. As I see it you've got four options [or three, really]:
    1. The VMFusion with Windows option isn't all bad. It works reliably, probably even better than Windows. See below.
    2. Get some Windows netbooks for $250 or $300.
    3. Wait for us to develop an open system for Mac, Windows and Linux. This is our preferred long-term alternative but it won't happen fast. The GUI is a fairly complex piece of software, taking over a year to develop as you see it today. Some other things we might look into with a future release are a GUI which generates C code and programming under Scratch.
    4. 12Blocks http://onerobot.org/products/12blocks/ runs under Mac/Win/Linux.
    Isn't there actually another option that uses VirtualBox but doesn't require a Windows license? Couldn't you install Linux under VirtualBox and run the S2 GUI under Linux? Any Linux install will come with X11 so you won't have to install that separately. Also, Linux is free so you won't have to find a way to acquire a Windows license.

    Phil: Would that work?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-09-29 14:58
    The GUI source would have to be modified to run under Linux, but it has been done successfully with the S1 GUI (not by me). In addition to Tk, there are Windows-specific serial port calls, sound-generation routines, and file dialogs.

    I'm contemplating the possibility of porting the GUI to a Chrome app. By using the Chrome API, one has control over things like serial I/O and file saves, while still taking advantage of Javascript and HTML5's portability. It would be a huge undertaking, though, invovling a complete rewrite. But Chrome's API wrapper does seem to be portable across most OSes.

    -Phil
  • David BetzDavid Betz Posts: 14,514
    edited 2013-09-29 17:45
    The GUI source would have to be modified to run under Linux, but it has been done successfully with the S1 GUI (not by me). In addition to Tk, there are Windows-specific serial port calls, sound-generation routines, and file dialogs.

    I'm contemplating the possibility of porting the GUI to a Chrome app. By using the Chrome API, one has control over things like serial I/O and file saves, while still taking advantage of Javascript and HTML5's portability. It would be a huge undertaking, though, invovling a complete rewrite. But Chrome's API wrapper does seem to be portable across most OSes.

    -Phil
    Have you considered using Qt like Steve did with SimpleIDE?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-09-29 17:57
    If I went the Qt route, I would want to retain as much of the original Perl code as possible. Unfortunately, PerlQt for Windows requires Cygwin, and the distro for OS/X is still unstable.

    -Phil
  • David BetzDavid Betz Posts: 14,514
    edited 2013-09-29 18:01
    If I went the Qt route, I would want to retain as much of the original Perl code as possible. Unfortunately, PerlQt for Windows requires Cygwin, and the distro for OS/X is still unstable.

    -Phil
    I have to admit that I haven't done much Perl coding. I should take a look at your source archive. Is all of the source needed to build the S2 IDE in the source archive?

    Edit: Never mind. I answered my own question. I also need to run the binary installer which means I'll have to wait until I use my Windows machine again to take a look at this.
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2013-09-29 21:26
    Suppose it turned out that a ground-level rewrite were necessary to achieve a fully open S3 GUI (you know, the futuristic yellow robot we've not yet specified or started) that runs on Mac, Win and Linux. It would also need to generate C code for viewing and editing in SimpleIDE. Put aside for a moment the very significant investment we already have in Tk and Perl.

    If starting fresh, what tool sets might be used to achieve this very generally-described goal?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-09-29 23:37
    Ken,

    Pursuant to HTML5, a Chrome Packaged App is one approach. Another would be a local background server written in Perl, which might preserve some of the current investment, with the UI switched to HTML5 via a web browser. If it were possible to recast the Tk library to produce a web-sytle interface, even more of the current investment could be salvaged. I doubt, however, that there is good correspondence between Tk's geometry manager and what HTML5 is capable of.

    Reconsidering Qt, I see that the Python bindings are all cross-platform ready, so writing the GUI in Python is also a possibility, but with little or nothing salvageable from the current version.

    For pure portability, the Chrome App approach seems quite appealing at the moment, but this is from the vantage point of having read about it and with no hands-on experience.

    In any event, the choice of dev tools is entirely independent of the output language, whether it be Spin, C, Forth, or ... ?

    -Phil
  • David BetzDavid Betz Posts: 14,514
    edited 2013-09-30 03:39
    Ken,

    Pursuant to HTML5, a Chrome Packaged App is one approach. Another would be a local background server written in Perl, which might preserve some of the current investment, with the UI switched to HTML5 via a web browser. If it were possible to recast the Tk library to produce a web-sytle interface, even more of the current investment could be salvaged. I doubt, however, that there is good correspondence between Tk's geometry manager and what HTML5 is capable of.

    Reconsidering Qt, I see that the Python bindings are all cross-platform ready, so writing the GUI in Python is also a possibility, but with little or nothing salvageable from the current version.

    For pure portability, the Chrome App approach seems quite appealing at the moment, but this is from the vantage point of having read about it and with no hands-on experience.

    In any event, the choice of dev tools is entirely independent of the output language, whether it be Spin, C, Forth, or ... ?

    -Phil
    I haven't ever tried writing a GUI in HTML5 but I suppose it might be a good idea. I know that TV settop boxes are starting to use HTML5 partly because the UI can be hosted in the cloud making updates easier than when it is hosted on the local machine. I'm not sure if that is something you'd want to do with a robot GUI though since you'd probably need to be able to run the GUI without being connected to the internet. However, a local HTML5 app is certainly a possiblity. Is HTML5 up to the fancy drag-and-drop interface that you use for the current S2 IDE?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-09-30 09:26
    David Betz wrote:
    Is HTML5 up to the fancy drag-and-drop interface that you use for the current S2 IDE?
    I'm not sure. At least, running as a local app, it would not be subject to the latency that a cloud-hosted app would exhibit.

    -Phil
  • David BetzDavid Betz Posts: 14,514
    edited 2013-09-30 09:40
    I'm not sure. At least, running as a local app, it would not be subject to the latency that a cloud-hosted app would exhibit.

    -Phil
    Well, I think the logic of the app would run locally even if it was hosted in the cloud. I think local vs. cloud mostly has to do with the URL used to fetch the app in the first place. However, I may be wrong about that. As I said, I haven't written an HTML5 app yet (although I'd like to sometime!).
  • sisc0brsisc0br Posts: 4
    edited 2014-08-24 19:41
    I teach robotics to elementary age children in an after-school program. My program is low budget and so I have installed Ubuntu Linux a seven older laptops. The GUI coding software is ideal for the young children I teach. I am very interested in the possibility of a future S3 that would have a GUI enabled to run in the Linux environment with generation of C Code. Has the S3 become an initiative that is scheduled?
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2014-08-25 21:12
    sisc0br, the S3 design is underway as documented here http://forums.parallax.com/showthread.php/153786-Open-Propeller-Project-2-Envision-the-S3-Robot. The completion date is "as soon as possible" in my view, which means we could see these as early as April 2015. The S3 would be programmable from a Google Blockly style interface in a browser, so downloads should work from any operating system that has FTDI driver support. C code generation is a possibility, but it's not finalized at this stage. We could have Spin/ASM and C, or one of the languages but not the other.

    Ken Gracey
Sign In or Register to comment.