Trying to connect via Bluetooth.

General Topics for configuring, operating and tuning the Megajolt. Also see the <a href="http://www.autosportlabs.net/MJLJ_V4_Operation_Guide">Operation Guide</a>

Moderators: JeffC, rdoherty, stieg, brentp

bobclevenger
Posts: 99
Joined: Mon Mar 28, 2011 9:54 am
Location: Reno, Nevada
Contact:

Post by bobclevenger »

My USB-to-Serial TTL adapter arrived today. It seems to work, but nothing else does.
According to several sources on the net the command to change the BT module's baud rate to 38,400 is "AT+BAUD6" which raises more questions than it answers.
Is the command [AT] followed by [BAUD6]?
Or is it [AT] followed by [+BAUD6]?
Or is it [AT+BAUD6] all at once?
Are there any [enter] keystrokes?

I suppose it's all moot as none of the above seem to work.

I seem to be able to talk to the BT module with the terminal set to 9600,8,n,1.
When I type [AT] into the terminal it responds with [OK] immediately giving me no opportunity to enter anything else. When I type [AT] (getting the response [OK]) and then [BAUD6] I get no response.

I have tried connecting the VCC terminal to the Key terminal and then powering up the module, which is supposed to put the module into command mode. No change.

I'm about to give up again.
...Bob

tightwad
Posts: 46
Joined: Tue Sep 10, 2013 10:11 pm

Post by tightwad »

I have the same USB to Serial adapter. I was able, 1 time, to connect to the the MJ Lite and upload a curve. I have yet to get a BT connection to do anything but crash MJ Lite Configurator. I have no way to verify if the curve I uploaded is there, if the unit will function, etc.

The BT modules work with the computer but I don't think my MJ module is good. I get a 300 ohm resistance reading between the txt and the rxd pins on the chip. I get a direct to ground reading from pin 1 of the RJ11 jack to ground. I get no path from JR11 to the RS232 pins for txt and rxd.

bobclevenger
Posts: 99
Joined: Mon Mar 28, 2011 9:54 am
Location: Reno, Nevada
Contact:

Post by bobclevenger »

I was able to change the baud rate of my BT module with the USB to serial adapter.
It is absolutely necessary to use some sort of "batch" method of sending the data to the BT module since it doesn't wait for an enter command and only waits for around 500 msec. I used Tera Term and used the "script" feature or whatever it is called. I typed "AT+BAUD6" into the command line and then hit <enter> and got a "38,400" message back. It seems that all caps is required.

Note that the RJ-11 connector is connected to the RS-232 level output of the chip, NOT to the serial TTL level pins that are the input to that chip. The BT module should be connected to the serial TTL level input pins which are different from the output pins. Sorry if you already know this, but it's not obvious if you don't.

The photo that has been posted here that shows the wiring of the BT module show wires soldered to the TTL level serial input pins (which is where it should go) -- these pins should have no continuity to the RJ-11 jack.

That photo unfortunately does not show the polarity of the TXD and RXD lines (i.e. which wire goes to which pin).

If you have them switched from the way they belong, it will cause your software to do strange things and even crash. I had this figured out once, but I don't remember it. I THINK that the wires (RXD and TXD) need to "cross over" rather than going straight from the BT module to the MJLJ chip.

Right now I think my main problem is that I have soldered to those pins so many times that they are pretty screwed up. Does anyone here know of another point on the MJLJ board where I can connect to the TTL level TXD and RXD points?
...Bob

tightwad
Posts: 46
Joined: Tue Sep 10, 2013 10:11 pm

Post by tightwad »

bobclevenger wrote:I was able to change the baud rate of my BT module with the USB to serial adapter.
It is absolutely necessary to use some sort of "batch" method of sending the data to the BT module since it doesn't wait for an enter command and only waits for around 500 msec. I used Tera Term and used the "script" feature or whatever it is called. I typed "AT+BAUD6" into the command line and then hit <enter> and got a "38,400" message back. It seems that all caps is required.

Note that the RJ-11 connector is connected to the RS-232 level output of the chip, NOT to the serial TTL level pins that are the input to that chip. The BT module should be connected to the serial TTL level input pins which are different from the output pins. Sorry if you already know this, but it's not obvious if you don't.

The photo that has been posted here that shows the wiring of the BT module show wires soldered to the TTL level serial input pins (which is where it should go) -- these pins should have no continuity to the RJ-11 jack.

That photo unfortunately does not show the polarity of the TXD and RXD lines (i.e. which wire goes to which pin).

If you have them switched from the way they belong, it will cause your software to do strange things and even crash. I had this figured out once, but I don't remember it. I THINK that the wires (RXD and TXD) need to "cross over" rather than going straight from the BT module to the MJLJ chip.

Right now I think my main problem is that I have soldered to those pins so many times that they are pretty screwed up. Does anyone here know of another point on the MJLJ board where I can connect to the TTL level TXD and RXD points?
This is VERY helpful! Knowing that connectivity between the RJ11 and the chip on the board is not expected makes me feel better...maybe mine isn't a lost cause. I would expect that my USB-Serial cable needs to connect to the RJ11, where the BT module needs to connect to the chip directly? According to the instructions for connecting to the chip:
jestes wrote:In the second picture below you see 2 wires soldered to the driver, the pin on the left is receive and the pin on the right is transmit. Solder the wire connected to Transmit on the JY-MCU to the Receive pin Receive to Transmit. If there are arrows printed on the back of your JY-MCU, ignore them and pay attention to the transmit and receive labels instead. Some of the arrows are printed from the perspective of the JY-MCU, others are printed from the perspective of the device you are connecting it to.
Regarding the BAUD rate and adjusting it via TeraTerm:

How is the adjustment in the Com Port settings on the computer different from adjusting it using a USB-Serial adapter and the AT+BAUD6 command? I adjusted it on the computer thinking that was all I needed to change. I then tried doing it via the command but I am not sure I am doing the connection from the USB-Serial adapter (I have the same one you have) and the adjustment right. Which color wire(green and white) goes to which pin on the Bluetooth module?

I was able to connect and to send some commands but not Baud changes...Just name change (which I never could see reflected anywhere)...can you offer step-by-step how-to to connect and change the rate?

brentp
Site Admin
Posts: 6282
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

An alternative module is this unit from Roving Networks:

http://ww1.microchip.com/downloads/en/D ... 240-DS.pdf

It will let you configure for the 38400 rate needed by Megajolt.
http://ww1.microchip.com/downloads/en/D ... 240-DS.pdf
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

bobclevenger
Posts: 99
Joined: Mon Mar 28, 2011 9:54 am
Location: Reno, Nevada
Contact:

Post by bobclevenger »

Tightwad, be aware that there are two sets of RXD and TXD connections on that chip. The ones that the BT module (HC-05 or HC-06) connects to are not connected to the RJ-11 jack. The other pair is connected to it (one way or another).

Also be aware that if the BT module is connected to the MJLJ board it just may drop the signal level so low that the RS-232 output to the RJ-11 jack disappears. You can't use both at the same time, or so it looks.
...Bob

bobclevenger
Posts: 99
Joined: Mon Mar 28, 2011 9:54 am
Location: Reno, Nevada
Contact:

Post by bobclevenger »

OK, regarding changing the baud rate for an HC-06 BT module:

1. Connect your USB-to-Bluetooth adapter to one of your computer's USB ports. Let it install the driver. If you need to, download the driver from the eBay listing ( http://www.ebay.com/itm/310742466145?ss ... 1497.l2648 ) for that adapter and install it.

2. Connections on the adapter are:
Black = ground
Red = VCC (+5 volts)
White = RXD
Green = TXD

So connect the black wire to the ground pin on the BT module.
Connect the red wire to the VCC pin on the BT module.
Connect the white wire to the TXD (no that's not a mistake) pin on the BT module.
Connect the green wire to the RXD pin on the BT module.

3. Open up Device Manager (it can be found in Control Panel) and click on the + sign nest to Ports (COM & LPT).
You should see a new COM port that is labeled "Prolific USB-to Serial Comm Port (COMx)" where 'x' is the number of the COM port. Make a note of this COM port number. If you are using a different brand USB-to-Bluetooth adapter the port label will be different.

4. Open Tera Term and select the "Serial" option.

5. Click on the "down arrow" next to the "Port" box and select the COM port that you noted in step 3.

6. Click on "OK".

7. Click on the "Setup" button and then on "Serial port..."

8. Make sure that the port is configured for 9600 baud, 8 bit, no parity, 1 stop bit, and no flow control. Transmit delays should both be zero.

9. Click on "OK".

10 Click on the "Control" button and then on "Broadcast command"

11. Uncheck "Realtime mode".

12. Check "Send to this process only".

13. In the top window type in "AT+BAUD6" without the quotes. Yes, in all capitals.

14. Click on "Submit".

That should do it. you should get a response saying "OK38400".

If that does not work, you may have an HC-05 chip. In that case in step 13 type in "AT+UART=38400,0,0" and the response should be "+UART:38400,0,0. Note that I do not have an HC-05 chip to try this out on. It is data from that wiki page I gave you.


Another thing -- changing the port settings in Windows does not change them in the BT module. Do both.

Good luck.
...Bob

tightwad
Posts: 46
Joined: Tue Sep 10, 2013 10:11 pm

Post by tightwad »

Thanks...I figured it out before reading this, except the real time mode change, that would have helped...for my module I had to also solder in a pin at the Key terminal and pull it high to enter AT mode...I could get an OK but couldn't change the Baud rate without it.

I was then able to attempt a read from the MJ...I got an error about the max timing allowed, I didn't write it down however and I am not at home...more to come!

tightwad
Posts: 46
Joined: Tue Sep 10, 2013 10:11 pm

Post by tightwad »

Success!!!....Kind of...so close I can taste it...

After getting the BT Module to be in 38,400 Baud and connecting to the MJ unit (jumper from 3rd pin in to RXT, jumper from 4th pin in to TXD, jumper from 2nd pin from MAP sensor to VCC, jumper from 3rd pin on MAP to GND) I was able to write my map, I thought. I did get a "timeout writing ignition config" error followed by a timeout reading runtime data and the BT module goes back to blinking so I thought it had finished and then wouldn't reconnect. I would powercycle the MJ unit as a "reset".

When the connection was reestablished I tried to read the map back I got the attached error indicating the was a bad advance value. The readings that came back were crap as well with the Load Values bins all saying 85 except Bin 7 that said 165. All RPM buckets were 8500...weird stuff like that.

What I discovered is that WRITING to the MJ takes much longer than I expected. If I waited ~38 seconds the bluetooth connection led would go steady again and I could now read the new values! Does anyone know how long it should take to write to the unit? I thought it would be faster than 38 seconds.

I still can't do a powercycle and then read the values...it's like it gets corrupted somehow. I can usually tell because the 2nd load bucket in the 1st RPM column will be green. This means I have no way of knowing if the values stored are correct and are getting corrupted on the connection OR if the values stored are bad/corrupted on power down.


[/img]
Attachments
Ignition Advance Error.PNG
Ignition Advance Error.PNG (80.14 KiB) Viewed 64422 times

tightwad
Posts: 46
Joined: Tue Sep 10, 2013 10:11 pm

Post by tightwad »

More updates:

At some point my map is getting corrupted. It only appears to happen in conjunction with a power cycle...I have no way to determine if it is during the power being shut down and the power being restored. At some point the Loan Bins and the RPM buckets get set to values that are impossible to save within the interface. You can see in the photo how the bins are set to the same values. The system won't allow these to be saved.

If I close the Configurator I don't get the error...unless power is lost to the MJ unit. Powering down the BT and then restarting it makes no difference. Any idea if the feature to save the RPM Bins can be made to work?
Attachments
Load Bins Error after powercycle.PNG
Load Bins Error after powercycle.PNG (88.69 KiB) Viewed 64421 times

bobclevenger
Posts: 99
Joined: Mon Mar 28, 2011 9:54 am
Location: Reno, Nevada
Contact:

Post by bobclevenger »

Well, the good news is that you seem to be communicating. The bad news is that you seem to be communicating gibberish.
I hope that Brent or someone else here that understands the MJLJ side of things can help.
...Bob

tightwad
Posts: 46
Joined: Tue Sep 10, 2013 10:11 pm

Post by tightwad »

I realized my last post was a bit muddled...it was very late!

It appears that when power is lost the map is not retained correctly. I haven't yet verified with a serial cable if the initial connection being made could be what is causing the corruption or if it is really just the power loss. I am really hoping it is the connection being made as otherwise this unit won't work unless power is constantly applied, which obviously wouldn't be feasible.

tightwad
Posts: 46
Joined: Tue Sep 10, 2013 10:11 pm

Post by tightwad »

I believe I found the problem. Per the manual:
MJ COnfigurator Manual wrote: Writing the Ignition Configuration

After editing the ignition map or controller options, you may write the changes to the controller. To do this, click the Write Ignition Configuration toolbar icon Mjlj write config toolbar.png to send your changes to the controller.
These changes are made to the Controller's volatile Random Access Memory Memory (RAM), which is used for the actual runtime operation. Therefore, the changes you make will affect the engine's operation. For example, if you are tuning the idle region and you alter ignition advance values in map where the engine is idling, you should observe a change in the engine's behavior once you write the configuration to the controller.
Important Note: Writing the ignition configuration only updates the Controller's RAM.
If changes are not persisted to the controller's Flash memory, the changes will be lost
if the controller loses power (e.g. ignition key turned to 'off').

This behavior is by design. Persisting the data to flash requires a significant amount of time
and momentarily pauses the controller's operation while the Flash memory is written.
Commit to Flash
To make the changes permanent in the Controller's Flash memory, Click the 'Commit configuration to Flash' toolbar icon Mjlj flash config toolbar.png. The controller will write the configuration to flash memory, and changes will be preserved across controller power-cycles.
The icon to commit to flash memory never shows up, even after the write process is complete. How do I activate the icon?

brentp
Site Admin
Posts: 6282
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

The icon to write to flash button is always on the tool bar. Are you saying it is not visible or it is not enabled for pressing?
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

tightwad
Posts: 46
Joined: Tue Sep 10, 2013 10:11 pm

Post by tightwad »

brentp wrote:The icon to write to flash button is always on the tool bar. Are you saying it is not visible or it is not enabled for pressing?
The icon is greyed out, which is why I overlooked it.

Post Reply