MIT App Inventor, mBot Robots, and App Inventor Extension 1.9

137 views
Skip to first unread message
Assigned to nis...@cavedu.com by farzeen....@gmail.com

deliot

unread,
Apr 23, 2018, 12:32:03 PM4/23/18
to mitappinv...@googlegroups.com
I'm hoping somebody has some wisdom regarding this issue.

Last year, we used MIT App Inventor with mBot robots and the mBot 1.9 extension.  Everything worked great, and we had no issues.

http://learn.makeblock.com/en/use-mbot-with-app-inventor-v-1-9/

This year, we are using the same phones, with the same mBots, with the same mBot 1.9 extension for app inventor and everything is frustrating and terrible.

App Inventor is constantly crashing saying something to the effect that "Unfortunately App Inventor has Stopped working".


Things we've tried:
(1)  Flashing the phones with the default factory ROM.
(2)  Turning Bluetooth on/off again.
(3)  Restarting phones
(4)  Updating robot firmware
(5)  Updating phone software
(6)  Putting fresh alkaline batteries in the robot
(7)  Using different backup phones


After all of this, I just get the feeling that it's somehow App Inventor's Bluetooth connection process.  So, what I'm  asking is, does anybody have any suggestions?  Anything simple that I've missed trying?

As you all know, debugging is difficult with App Inventor, since the messages aren't very specific. "Unfortunately App Inventor has stopped working" doesn't give a lot of breadcrumbs.

Any advice or suggestions would be appreciated.

For what it's worth, here's some example code.  The crashing seems to happen at the Bluetooth connection point.








blocks.png

Taifun

unread,
Apr 23, 2018, 2:14:54 PM4/23/18
to MIT App Inventor Forum
to find out more about the Runtime Error, you can use Logcat

I normally use Eclipse and Logcat there, but if you have installed the App Inventor Software (see also http://appinventor.mit.edu/explore/ai2/setup-emulator.html), you already have everything you need to use logcat...

How to use Logcat
  1. connect your device using USB with your computer
  2. in File Manager go to the App Inventor directory, which is  C:\Program Files\App Inventor or similar
  3. press Shift and right mouse click the subdirectory commands-for-Appinventor to get the context menu
  4. select "open command window here" and you will get a command window of that subdirectory
  5. enter adb logcat *:E and the logcat will start running and log all errors
  6. start your app to elicit the error
  7. copy the log (see below)
To copy your log, right click, click "select all" and enter to copy the complete log into the clipboard, then open Notepad and paste it using ctrl-v.

Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 

Chris Ward

unread,
Apr 23, 2018, 9:24:13 PM4/23/18
to mitappinv...@googlegroups.com
Hi deliot

Actually your code snippet does not include an AI Bluetooth connection.........

In App Inventor, please check that you have the latest releases:

App Inventor: nb166
Companion: 2.46

Edit: Also, did you need to install the App Inventor BLE extension last time? 

deliot

unread,
Apr 25, 2018, 11:32:30 AM4/25/18
to mitappinv...@googlegroups.com
>>Actually your code snippet does not include an AI Bluetooth connection.

Bluetooth connection is the first line of the blocks image below the global values, using the Extension "call MbotExtension.ConnectToRobot".


>>Also, did you need to install the App Inventor BLE extension last time? 

No.  That's not how mBot connection works.  This code worked without incident  one year ago, now it crashes randomly, that's the issue.

Chris Ward

unread,
Apr 25, 2018, 11:57:17 AM4/25/18
to MIT App Inventor Forum
Hi deliot

I see, the extension itself must be delivering a Bluetooth Low Energy connection - perhaps because, at the time of creating their extension, App Inventor did not support BLE. The reason I asked of course was:

 I just get the feeling that it's somehow App Inventor's Bluetooth connection process

So, can you post the Logcat log here?


Ghica

unread,
Apr 26, 2018, 8:48:39 AM4/26/18
to MIT App Inventor Forum
Hi deliot,
Did you contact the mBot people? Maybe they offer some support for their extension?
Cheers, Ghica.

Chris Ward

unread,
Apr 29, 2018, 10:30:05 PM4/29/18
to MIT App Inventor Forum
Hi Deliot

Have you been able to make any progress?
Reply all
Reply to author
Forward
0 new messages