SUCCESS!!! SimpleIDE, the RN-42 Bluetooth Module, and B4A Android App
idbruce
Posts: 6,197
Hello Everyone
I am currently waiting on a delivery of the ChronoDot V2.1 to complete the timestamp aspect of my current project. In the meantime, I would like to explore the possibilities of the RN-42 Bluetooth Module that I recently purchased, and of course, I suppose like most people, I want to be able to control my project with an Android device
With this in mind, I started exploring my options, and stumbled across the MIT App Inventor (appinventor.org/appInventor2). I am truly amazed that I have not seen any discussion about this in the forum. MIT App Inventor provides you with the capability of creating Android apps and allows you to test them as you build your app. All I can say is "WOW". I don't know how this will all work out, but I certainly intend to explore the possibilties, over the next several days or weeks. I am hoping that I can use this in my current project, in addition to another huge project which has been placed on hold
Anyhow, I will most likely start my adventure sometime later today. If you think I am barking up the wrong tree, then please let me know the drawbacks.
Bruce
I am currently waiting on a delivery of the ChronoDot V2.1 to complete the timestamp aspect of my current project. In the meantime, I would like to explore the possibilities of the RN-42 Bluetooth Module that I recently purchased, and of course, I suppose like most people, I want to be able to control my project with an Android device
With this in mind, I started exploring my options, and stumbled across the MIT App Inventor (appinventor.org/appInventor2). I am truly amazed that I have not seen any discussion about this in the forum. MIT App Inventor provides you with the capability of creating Android apps and allows you to test them as you build your app. All I can say is "WOW". I don't know how this will all work out, but I certainly intend to explore the possibilties, over the next several days or weeks. I am hoping that I can use this in my current project, in addition to another huge project which has been placed on hold
Anyhow, I will most likely start my adventure sometime later today. If you think I am barking up the wrong tree, then please let me know the drawbacks.
Bruce
Comments
https://forums.parallax.com/discussion/160748/drone-control
https://forums.parallax.com/discussion/159920/android-control-of-propeller-using-joystick-bt-commander-app-spin-code
I like what I have seen so far from App Inventor.
Santa came early, delivering new toys today
I posted the apk for the BASIC! interpreter in a recent thread.
This is their bluetooth sample code. I was talking to the Prop in minutes with this.
I ended up stripping a lot out and it boiled down to nothing.
I could be wrong , but I don't see talking with the Propeller as a major problem. My problem is the user interface, but isn't it always .
I have not totaled it all up, but I would imagine there are at least 1000 possible combinations of user settings, if not more. It will be a very in depth user interface for the App that I will be creating, all of which boils down to sending a short command sequence. At the moment, I am currently using a fairly complex html form, which is processed by a Perl script to create the short command sequence, however this intended for control from a remote location, over the internet. The bluetooth app will of course be intended for local control.
Just to give you an idea of the complexity of my undertaking, here is a snapshot of the user interface, with certain text being removed for proprietary purposes. This form is used for very specific motor control operations.
I may have to realign my thinking, just to make a bluetooth app possible, because MIT App Inventor, as far as I can tell so far, does not offer radio buttons, but I may have missed it at first glance.
Actually, with the exception of possible ACK and NACK, it will all be one way communication, with a string of (I think) 7 characters. It doesn't sound like a major issue at all, or at least from some of the stuff I have read so far. As I said, the problem will be the user interface.
Anyway, I hope you are doing well. It is good to see you participating more in the forum again. Even my participation has increased a bit lately. It is good to know that many of the members have just been lingering in the background. Mike Green's participation has picked up as well
Install BASIC!
Go to the link at the bottom
Look for the GW-lib
Load/run the demo
By the end of today, you will be making apps with radio buttons, menus, scrolling lists, sliders, pop-ups, etc.
However, I do understand what it's like when new toys arrive
http://mougino.free.fr/rfo-basic/
Do I have to write BASIC code? Or is it block oriented like App Inventor?
What I really want is the most powerful and option full app software for free, which does not require a memory hungry executable to be installed on my PC.
I will check it out But I must admit, BASIC was never really my programming language of choice and my skills in that language are certainly deficient
You can edit/run directly on the device or you can edit on the PC, hit a function key and the code jumps to the device and executes. No compiling.
You have the option of always running the script or if you want to distribute it, you simply convert it to an apk.
The apk doesn't compile the code, it bundles your code with the interpreter, along with any assets. It looks like any old Android app to others.
Just today, I pulled out a WiFi-485/422 device that I've had for ages but never played with. Connected the terminals for a loopback and used the "sockets" demo in BASIC!, voila, instant success.
https://www.b4x.com/
Bit more of a learning curve though.
B4R (BASIC for Arduino) uses the same syntax but now one can produce native code for the ESP devices.
B4J, same syntax to produce Java apps.
B4i, same syntax for iOS but it's the only one that isn't free...yet.
Shouldn't be a problem. I use it on my shop-floor Toughbook which has one of the low (dog) power Pentium chips and B4A works fine.
I will now be attempting to delve into the world of creating apps, by downloading B4A
Hopefully it won't turn my PC into a boat anchor
Yep.... That was a pretty extensive install, but the IDE is now ready.
As for me, it looks like I have a lot of studying to do.
Did you download B4A-Bridge to your device (Google Play)? It will also prompt you to download the Designer which is a great way to build your UI.
Yea, I also have B4A-Bridge installed, however it did not prompt me to download Designer. Designer appears to be part of the B4A IDE.
I just wish I had a good grasp on it already
Thanks Jon. Thanks Mickster.
Propeller controlled machinery run from custom made GUI apps
This (B4X) interests me a lot- please keep us informed of your progress and any hints for the newbe for pitfalls to avoid etc.
Dave
I wasn't really sure how I was going to respond to your post and request, but after a lot of thought, this is what I have to say.
Whenever I try to learn something new, I almost always have a particular goal that I am trying to achieve or some type of problem that I am trying to solve. In this particular case, I want to learn how to control the Propeller microcontroller with mobile devices, and of course, the B4X platforms will allow me to do this, but there must also be a means and method of communication between the microcontroller and the mobile device. For my purposes, Bluetooth will provide the method of communication. I already have an Android phone, a RN-42 Bluetooth Module, and several Propeller boards to experiment with. Additionally, I have the B4A platform and all accessories installed and ready to go on my PC and mobile device. At this point, I am ready begin my journey into the unknown
As mentioned, I like to start with a goal or have a problem to solve. In this particular case, at this specific moment, I have a machine that I would like to be able to control with my phone, through a Graphical User Interface (GUI) hosted on the phone. I already know what I want and need on the GUI, and this will greatly assist me in my endeavor to learn the B4X platform. To begin my journey of learning the B4X platform, I will start by designing my GUI and make sure that it has everything that I want and need for controling my machine. After I have the GUI designed, then I will research and write the code necessary to make the GUI fully functional. This is just my method of learning at my pace, while achieving a goal or solving a problem. Everyone learns differently. By attacking several different projects, in the same manner, I will eventually become a fairly versatile programmer of the B4X platforms.
That being said, not every mobile app needs a GUI, a Propeller, Bluetooth communication, or a problem to solve Only you can determine what you want to learn, how you want to learn it, and how well you want to know the subject. You may become the person telling me the pitfalls during your journey of learning
Not everyone is comfortable with wireless communications.
That is quite an understatement.
There are a lot of libraries available, for many different things. You can do a lot of different things with the B4X platforms and mobile devices. I really started digging around this morning and was amazed at some of the stuff I had found.
You may already know this or perhaps maybe not, but I am seeking an answer, and perhaps you may know that as well. This morning, I downloaded and installed the "B4A Object Browser", which is a stand alone application, and can be found here: https://b4x.com/android/forum/threads/b4x-b4a-b4i-b4j-and-b4r-api-documentation-b4x-object-browser.25682/
After providing the path to the libraries folder in the "Options", the B4A Object Browser loaded itself with a lot of wonderful information contained within that libraries folder. However, after a quick glance, I did not notice any information pertaining to the libraries listed on this web page: https://b4x.com/android/documentation.html
So my question is, are those libraries buried deep within the B4A Object Browser, and if not, how do I get access to those libraries?
I will investigate and re-read your question in a few hours. Been a long day here and I'm nodding off.
You are correct, additional libraries should go to a different location and folder. The B4A software as well as the B4A Object Browser, both allow you to specify paths to additional libraries.
I suppose the real questions are:
Are the libraries listed at https://b4x.com/android/documentation.html installed with the B4A software, but located in a different library folder, or do they have to be downloaded seperately and individually, or can they be downloaded as a massive library upgrade
If you don't know the answer, that is okay, I can do the research. I just thought you might know.
Yea, it looks as though you have to download the libraries after searching for them.
Okay... Curiousity risen What is BT?
I think that you already stated that you have selected a BT module but if you ever consider the ESP32 as an alternative, you can program it using B4R (same syntax as B4A).