RN-42 bluetooth for Board of education
HindsVo-Tech
Posts: 5
Hello, I am trying to locate the necessary instructions to integrate an RN-42 Bluetooth module with the Board of education series BOE-BOT. The goal is to make a boe-bot function via cellphone or tablet with one of the available applications on the android market. We are having troubles locating any code or instructions to do so. If you could please provide us with either a resource link or instructions on how to make this build it would be greatly appreciated. If this build is not possible then if you could provide us with the information on what type of hardware would make it possible. We have seen this idea work in a couple of videos but none of them had any links with information and schematics. Any help you could give us on this issue would be greatly appreciated.
Comments
The biggest barrier I have found with this is not so much in the code on the BOE-Bot, but rather the Bluetooth App for the phone. The way some of them deal with what is sent to the remote end makes it difficult sometimes to work with the BASIC Stamp 2, however I will dig out my BOE-Bot tomorrow and see if I can at least get it working to demonstrate. Please follow-up if you would like me to do this.
This may help if you want to write it.
Basic4android is the simplest and most powerful Rapid Application Development (RAD) tool available for the Android platform
http://www.basic4ppc.com/
RN-42 Bluetooth
http://www.basic4ppc.com/android/forum/threads/bluetooth-microcontroller-communication.24604/#content
http://www.basic4ppc.com/android/forum/attachments/bluetooth-zip.15147/
I would really appreciate that demonstration Mr. Savage.
@ Mr. Lawerence:
I am looking into the software that you posted. It looks promising, so thank you for that.
Right now I am using Itead Studio and it is working with Boe-Bot. The issue that I am having is that the the code of the program only works in short bursts and only after you release the "buttton". For instance, if you press the forward "button", the Boe-Bot will go forward in a short jerk. The problem here is that I am looking for something that will continue to go forward until I release the "button". I've read what Mr. Savage said about his code not being smooth due to the fast nature of the data speed. Would this have something to do with not finding any software compatible with the features I am looking for? I have looked around the Google Play store looking for applications compatible with RN-42, do you have any other recommendations that may give me what I am looking for. I also am not adverse to trying to create an application, though I would definitely need some ground code to work from. P.S. I really appreciate any help you could give me.
Please note that this BOE-Bot has the High-Speed Servos and the Lithium Ion Battery Pack for the BOE-Bot. Here is a video of this code in action on this robot. If you have any questions please let me know.
The next thing I am going to try is the following Android App called, Robot Control. I have not tried this one yet, but it has a stop button, which means the code can be made more robust.
Thank you for this code and "how to". I am sure it will help a lot of folks who purchased the RN-42 having visions of a truly remote controlled robot. I will look to adapt your code to function via a Bluetooth enabled laptop computer.
Once again, thank you for your efforts.
Tried out your code on my BOE-Bot without success. I am assuming that the computer transmits the code [via its Bluetooth connection] to the Stamp via the RN42 module. What are some of the reasons for a “No BASIC Stamps found” error other than low batteries. Here is what I have done so far:
- Paired the RN42 Module to the Bluetooth connection on my Sony Vaio laptop running 32-bit Vista. Passkey used was 1234.
- Device name is RN42-6055. Service Class is Serial Port and Service Name is SPP. Port is COM40, which is my Bluetooth port [only port shown] in Device Manager.
- RN42 Bluetooth module mounted on BoeBot per Chris Savage images. [ RN42 module GND to Vss; Vin to Vdd; RTS and CTS jumpered; TX to P0].
- Turned BoeBot switch to Position 1 and observed Green LED in configuration mode. Then it went into Discoverable/Idle mode.
- Connected laptop to RN42-6055. Now shows as connected in the laptop dialog. Green LED on RN42 still blinking in Discoverable/Idle mode.
- Under Edit/Preferences Terminal #1 COM Port is COM40. There is only this port shown in the Serial Port search list.
- Ran Chris Savage’s Bluetooth BOE-Bot Demo.bs2
- Green LED and Blue LED ON solid.
- Download Progress shows COM40 with Loopback [NO] and Echo [YES]
- Communication Error “No BASIC Stamps found”
- Click Okay.
- Green and Blue LEDs still on solid.
- Disconnected the Bluetooth connection from the laptop.
- Blue LED turned off. Green LED is once again in Discoverable/Idle mode.
- Going back through the forum, I replaced the batteries with a fresh set.
- No change from above sequence of events in many attempts after the fresh set of batteries.
I am missing something very obvious I think. My plan was to run Chris’ software and then use another Terminal to control the BOE-Bot. But the “No BASIC Stamps found” has thrown me off track. Should I run the code with the USB cable connected to the BOE-Bot as a first step and then attempt to go wireless? Any suggestions to make this work? Thanks.Also note that every PC I tested pairing the RN-42 Bluetooth Module to produced two COM port entries. Only one worked, but two were listed for each RN-42 I paired up.
Thank you for nudging me in the right direction. I had wrongly assumed that the RN42 module would carry the code to the Stamp. All is well now and the BOE-Bot can now move about on its own thanks to your code. Regarding the ports, I observed that BT Port (COM40) is the only port available in Device Manager. When I plug in the USB cable to download the code to the Stamp, it creates a USB Serial Port (COM30). I disconnected the USB cable after the code tokenized and downloaded [Green and Blue LEDs ON solid]. The USB Serial Port no longer appears in Device Manager. After this, however, the BOE-Bot responds wirelessly to commands [w, a, s, d] from a Terminal. So a very big thank you for helping me to get it right.