Shop OBEX P1 Docs P2 Docs Learn Events
Bluetooth HC-06 @ 115,200baud to Propeller in Forth. — Parallax Forums

Bluetooth HC-06 @ 115,200baud to Propeller in Forth.

Well, I got this working awhile ago in my EEEpc Netbook, then I forgot exactly how to reach the Propeller.  I have an HC-06 Bluetooth slave board that has its RX and TX appropriately connected to Pins 30 and 31 of the Propeller.  Everything works fine in 3.3VDC.

On the Propeller side, the HC-06 is quite easy to wire up and deploy. But providing a Bluetooth serial terminal in Linux was a bit confusing until I located a Debian BluetoothUSER page that is quite helpful.  My searches seemed to either divert to Ubuntu solutions or Raspberry Pi solutions... neither were very clear.

Try this instead.
https://wiki.debian.org/BluetoothUser

One should skip the Bluetooth Developer page at the Debian wiki and go directly to the Bluetooth User page.  I didn't see this at first.

I strongly suspect that anyone can also use the Bluetooth to wirelessly download binaries to the Propeller, but I have yet to try that as well. 

I am using Minicom to work interactively with pfth and Tachyon. PUtty should work as well.  But one must limit the HC-06 baud rate to 115,200 maximun as it is not able to keep up with anything higher.  Everything is 8-N-1 and no additional flow control of any sort.

+++++++
Having finally got the Debian Wheezy solution working just right, I am also trying to get an Android 4.4 Bluetooth solution to connect.

I have a Terminal application in Android that allows me to go into the file system and work with utilities.  And I also have had success (actually easier that Debian) with locating and pairing with the HC-06.  But I still have yet to install and succeed with an Android-to-Serial Port link.

Here is what I am about to investigate.  http://code.google.com/p/android-serialport-api/wiki/android_to_rs232_guideline?tm=6

It claims in "Solution 1" to offer a 'Bluetooth-to-Bluetooth' link that should work, but I will have to report back what really occurs.  Having an Android cellphone handy as a wireless terminal to your Propeller strongly appeals to me.

Comments

  • max72max72 Posts: 1,155
    If you check the play store you can find many BT terminals.
    One suggested on the forum is blue term for instance, but there are many options.
    Massimo
  • So far, I haven't found the Android BT terminal that works well for me. I admit that I am refusing to pay for one. Maybe that will be necessary to get the degree of control that will work.

    My HC-05 and Propeller 1 has been up and running 24/7 for several weeks now and the hardware configuration is stable.

    Two platforms are involved as terminals.
    1. ZenFone with Android 4.4 as BT terminal
    2. Asus EEEpc with Debian as a BT terminal

    The whole project may be easier with a notebook in Debian. One just has more input options to the HC-05
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-11-01 07:25
    Blueterm works well, and there are variations too that allow you to paste. I use this all the time to talk to various devices from my phone, to check logs, change settings, etc.

    My Linux laptops have the rfcomm channels for paired Bluetooth devices so they just automatically connect when in range to minicom.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-11-01 14:35
    Well, minicom in Debian works for me as well. In fact, I use minicom for just about everything that requires a serial port, except SSH. Then I use PuTTY.

    I will give Blueterm another try. May even pay for a full version if required. Android seems to require that I buy full funcitonality. What i attempted to use seems to remove the spaces before transmission and those are critical to Forth.

    Thanks
  • Tried getting BlueTerm from Google apps. It installs, but says no connection. Elsewhere I see my HC-05 is recognized by Android 4.4.

    Something is not quite right.

    I also see BlueTerm2 and BlueTerm+ are available, but different sources.
  • prof_brainoprof_braino Posts: 4,313
    edited 2015-11-01 17:06
    I had Blueterm on my Samsung Captivate Glide Android 4.4 (I think). It worked well enough to display diagnostics from the app while out and about. But I did not have a lot of luck writing new code from android. Blueterm backspace key did not work, it always gives a junk character and requires the line to be retyped. And there was no convenient way to copy/paste from/to another source, since my android only displayed one screen at a time. So development using blueterm from android COULD work, but I would have to change my habits.

    I have Blueterm on a Nexus 6. But this does not have a slide out keyboard like the Captivate glide did. So a dedicated keyboard MIGHT do the trick, but still does not allow for mouse select and paste as I am accustomed. So I guess my experineces from the previous device have put me off android as a wireless forth development terminal for thetime being.

    I have dinky Acer Aspire D270 which is about the same a s a chromebook with a hard drive. This is running linux mint 17.2 so supports everything my main PC does, in particular has my prefered terminal program minicom. But the screen is WAY tiny, and while it allow mouse copy / paste, its too cramped compared to my 27" HD monitor. Again, deleopment anywhere other than my main PC is unapplealing for now.

    Perhaps I'll have a class where all the students have phones instead of PC's that would motivate me to "make it work". For now the bluetooth options exist, and function correctly, but are not convenient enough to be my mainstream development tool.

    One thing I noticied, the HC-05 is easier to get working. It your issues are with the HC-06, there might be that extra step to choose master or slave. Maybe check if Blueterm can connect to the HC-05, the HC-06 might be the problem.

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-11-01 22:17
    You must pair with the device first if necessary (from your phone's settings menu) and it also helps to install "Terminal IDE" keyboard too which you can afterwards select from Blueterm when you have a keyboard up. IIRC the keyboard outputs a $08 for backspace but nonetheless I also allow $7F in Tachyon as that's the sensible thing to do.
  • Well. I am still interested in making BlueTerm work if it can. I have a Terminal app that lets me do some things at the command line in Android 4.4, but all suggestions come from websites and not from BlueTerm itself.

    I guess I should change the title as I am using the HC-05, not the HC-06. I do have both and am aware of the differences.

    From what I can tell, I either have to do some command line configuration to get rfcomm to see the software, OR there is a set of Java libraries that require designation, OR both.

    My phone's setting menus does clearly see the HC-05 as available. And another App does actually reach it, but has worse behaviors than BlueTerm.. much worse. I can't seem to do the 'pairing' from the Android Menu system. I can't get any configuration menus from within BlueTerm. That may be the Java bug that I saw mention of.

    BlueTerm simply comes up with 'no connection' and offers no way to resolve that.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-11-03 11:00
    Ho ho ho...
    I removed BlueTerm and my other BT Serial Term to clean up the Android device. Then I loaded BlueTerm2 which comes from a different source than BlueTerm.

    End result, I get what looks almost exactly the same as BlueTerm (the name is BlueTerm2 and that seems to be the only change), and the same 'no connection'.

    So my Blue Tooth installation on Android seems to lack some detailed configuration instructiosn. I will compare what the web suggests for BlueTerm and BlueTerm2 as it seems the same situation.

    Yes, my Android OS is has pair with my HC-05.
  • BTW, I do have a cheaper Android phone that pairs but doesn't seem to support the serial service. You have tried another device haven't you?

    BlueTerm2 is "one" of those variations I alluded to, it allows pasting text basically. The BlueTerm settings menu is available when the keyboard is hidden which you can do by tapping the blue screen away from the keyboard. Did you install the Terminal IDE keyboard too? I primarily use HC05s.
  • Loopy,
    When I was trying to interface a QuickStart board to my android tablet using pfth I had to use "SENA BTerm" BlueTooth Terminal. It is a very basic terminal. There is a manual for it on the web. Once I got it to send and receive characters, I was able to write some forth that let me communicate using "Joystick BT Commander" on my tablet, JSBTC has a joystick, 6 buttons, and 3 data items. That app has a more complicated data format, so I wanted to make sure I was communicating correctly using the simple character send/receive. Both apps are free on google play.

    My adventures in bluetooth and forth start on page 10 of Dave Hein's pfth thread. My code where I use SENA BTerm to just get and receive characters is in the post below (with Dave's correction in a following post.)

    forums.parallax.com/discussion/comment/1251023/#Comment_1251023

    The tablets I've used are Samsung Tab 3 and Tab 4. Note that I am using an RN42 BT device from sparkfun (because it has the same formfactor as an XBEE, but I believe the HC-06 also uses the RN42.

    By the way, I was using pfth since I was new to the Prop, and it was essentially "standard" forth (which I had a basic knowledge of) with a minimal of Prop words. I had started taking the exercises in the Propeller Education Kit and porting them from Spin to forth (to essentially learn both languages). The interactive nature of forth together with the 8 cogs of the prop work great together where I can launch some code in a new cog, write some words (in cog 0 - the cog that communicates with terraterm) that interact with that code to test some of the props features, display the results on the terminal, and if necessary shut down the other cog if I get a program hang.

    I was able to use that method to get a better understanding of how to start/stop/restart multiple cogs, and how the different prop counter modes work.

    Tom
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-11-03 16:20
    I can easily use BlueTooth on my Linux Asus EEEpc notebook to reach the same HC-05 and do things with Forth via minicom.

    I did have a BlueTooth connection on the ZenFone in Android 4.4, but it seemed to remove spaces. Nonetheless, it did recieve serial from Forth on the Propeller when I reset the Propeller. And it could work if I just was careful to enter each item separatedly. (That meant I couldn't program, but I could do math.)

    Having said all that....
    I can't make heads or tails out of how to establish a connection in BlueTerm or BlueTerm2.

    I have looked at YouTube demos and it seems a menu pops up to connect a BT device. But that never happens with either version that I install.

    I think I will go back to wifi on the Android for awhile. My BlueTooth does seem to have much range anyway, and wifi does. I only have the Android phone and the Asus notebook with BT.
  • MJBMJB Posts: 1,235
    just got a HC-06 on a little baseboard with voltage regulator
    it reads as 3.6 to 6 volts input on the backside.
    when I power it up with 5V, I can see a HC-06 on my phone.
    BUT it runs really hot, burns my fingers touching it
    without any serial trafic and before any configuration

    IS THIS NORMAL ??

  • MJB wrote: »
    just got a HC-06 on a little baseboard with voltage regulator
    it reads as 3.6 to 6 volts input on the backside.
    when I power it up with 5V, I can see a HC-06 on my phone.
    BUT it runs really hot, burns my fingers touching it
    without any serial trafic and before any configuration

    IS THIS NORMAL ??

    Wot? burning your fingers? Maybe..... :)

    NO

Sign In or Register to comment.