Bluetooth HC-06 @ 115,200baud to Propeller in Forth.
LoopyByteloose
Posts: 12,537
in Propeller 1
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.
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
One suggested on the forum is blue term for instance, but there are many options.
Massimo
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
My Linux laptops have the rfcomm channels for paired Bluetooth devices so they just automatically connect when in range to minicom.
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
Something is not quite right.
I also see BlueTerm2 and BlueTerm+ are available, but different sources.
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.
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.
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.
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.
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
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.
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