Hi I am trying to connect raspberry pi with MIT App inventor using Bluetooth, but is it unable to send text to the raspberry pi and it showing a pop up as MIT App is not responding.
See your computer's memory or RAM usage of chrome or any other browsers you are using.
If you are using windows:
steps:
1. Press CTRL+SHIFT+ ESC
2. A Task Manager window will pop up
3. Try searching for chrome.exe(If you are using chrome), see the memory usage, if it's above 70%, reboot your PC immedietly.
(**Note: Sometimes it's the problem with your network connection, so, try to check your connection too **)
Dear @Nagarjuna_Nagarjuna, in your blocks I see several things that can avoid a correct functioning:
- the Raspberry (at least the one I have) has a classic BT, therefore when you try to connect it, on app side, it's better to use simply the block below (instead of specifying the UUID):
- the connection shall be made only once, for example in the Screen1Initialize event, and not repeated in a clock.
- the clock is useful, instead, to poll every 'n' milliseconds if some message has been transmitted from the pI to the app. (typically 'n' can be about 100 ms).
- be sure that the message from pI is sent by closing it with a Linefeed character (0x0A = 10dec). In other words, the message shall be sent by using a Bt.println();
- Before the BT can work, you shall ensure appropriate permission to the app: the BT connection and the Location Sensor, too.
There are tenths of topics on this matter in the forum, and a specific FAQ section (Thanks to @abg). Link here below:
In addition, you can find many examples in the following PU's (@ChrisWard and @Juan_Antonio) web sites:
https://www.professorcad.co.uk/
http://kio4.com/index.htm
- I see that you open multiple screens: this approach should be avoided because when switching from screens the BT ceases to work (ulnless you reconnect it at every screen change !) and also variables shall be passed through the TinyDB. It's far better if you use the "virtual screen" method. To this purpose you can have a look to my example .aia here below;
MultipleScreen.aia (849.0 KB)
Best wishes.
The source of the coma:
That While loop has no place in an Event oriented architecture.
Here is a simple BlueTooth text receiver sample, for single value per line:
...
thanks for the quick replies, but for the Bluetooth connectivity we didn't used the In build libraries. I used the custom library for the Bluetooth connectivity from GitHub : GitHub - petzval/btferret: Python and C Bluetooth Library
can anyone please refer this GitHub custom library can just any changes in the MIT App code blocks.
I had a look to the GitHub address you provided, but I've seen that you modified a lot the AI2 blocks with respect to the one shown in the GitHub example: as I've already said in my previous post #2 it's pretty weird to allocate the Connection block in a clock: the GitHub example was allocating the Connection in a Button, instead. So, revert to the one they suggested and try the very "basic" example before doing any change.
Another question is: when you compile the C code, is it error free ?
Are all the libraries effectively resolved (in detail the bt server one) ?
And don't forget what @ABG has said in post #3: the "while do" test can remain stuck there forever if the pI does not send anything.
In my opinion by using someone else's code without knowing the internals, is like doing a "jump in the darkness" so, before trying something difficult, make it simple and try the standard pI libraries plus what @ABG suggests in post #4. When you are done with the basic communication, then you can add whatever you want.
Best wishes.