ElectricMotorcycleForum.com

  • May 13, 2024, 04:44:08 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Electric Motorcycle Forum is live!

Pages: [1]

Author Topic: Using Putty to connect to MBB  (Read 787 times)

2020_SRS_Commuter

  • Sr. Member
  • ****
  • Posts: 250
    • View Profile
Using Putty to connect to MBB
« on: February 16, 2024, 09:08:39 AM »

I made up a USB to OBD2 cable as shown in the unofficial manual. So far I've not been able to get putty to open a serial window. I think the problem is in the laptop perhaps. Putty says its missing a file or some such.
The instructions in the Unofficial Manual say:

1.   Cut the connectors off the end of the green, white and black wires to expose bare wires.
2.   Solder the wires to the pins on the OBDII connector as follows:
•   Black wire (ground) to pin 5
•   White wire (RX) to pin 8
•   Green wire (TX) to pin 9
•   Red wire is not connected (+5V)
3.   Plug cable in to laptop computer; device should be recognized and driver installed successfully.

But... I don't understand this. If all this cable is is a ground, and two data lines to pin 8 and 9, how would it even know something was connected and install a driver? I tried it on two laptops, an old Vista one and a Windows 10  one. Neither one sees it as a "device" or installs anything and I don't know why it would. 

My background to help frame an answer is : I don't do much with PCs anymore but use them, however in the past I assembled, repaired, and upgraded PCs in a shop, and back in college we even constructed our own memory boards for Z80s, and used Edlin to communicate with them. I've written some code in C and Basic, and in Arduino IDE
« Last Edit: February 16, 2024, 09:14:00 AM by 2020_SRS_Commuter »
Logged

atomicdog

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Using Putty to connect to MBB
« Reply #1 on: February 16, 2024, 11:10:41 AM »

The PC OS knows when the dongle is plugged in (starts talking to the microcontroller in the cable) but doesn't know about or if anything is plugged in on the other side. The microcontroller in the cable translates the USB signal to UART (TTL).

On Win 10 the driver is probably already installed. If you go to the device manger you should see it under Ports (COM & LPT)

I also wasn't able to get putty to work for some reason.
I would try tera term instead; it also lists the available COM ports unlike Putty, so you don't have to look it up in the device manager.
Logged
23' SR/S

2020_SRS_Commuter

  • Sr. Member
  • ****
  • Posts: 250
    • View Profile
Re: Using Putty to connect to MBB
« Reply #2 on: February 16, 2024, 11:59:20 AM »

Thanks, I downloaded that and will look at it tomorrow.
Where is there a microcontroller in the USB cable? In the side that plugs into the PC?
I know for sure there is nothing in the OBD2 end of it as that was just a shell I bought from ebay, and I cut off the end of the USB cable and soldered to the pins in there.
Logged

atomicdog

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Using Putty to connect to MBB
« Reply #3 on: February 16, 2024, 01:49:25 PM »

Yeah, the side that plugs into the PC (similar to this).
Logged
23' SR/S

2020_SRS_Commuter

  • Sr. Member
  • ****
  • Posts: 250
    • View Profile
Re: Using Putty to connect to MBB
« Reply #4 on: February 16, 2024, 10:23:44 PM »

Thanks for your help. I did not read the instructions properly and used a normal USB power cable. Duh.
The article writer is explicit that a "USB to TTL" cable should be used, which contains a UART, and even shows a picture of it.
Ordered it today. I'll be back after I've assembled the cable correctly. Thanks again.
Logged

2020_SRS_Commuter

  • Sr. Member
  • ****
  • Posts: 250
    • View Profile
Re: Using Putty to connect to MBB
« Reply #5 on: March 04, 2024, 02:48:52 AM »

This project is taking forever. First I waited for an OBD2 conn to arrive from China, then I found out I had to order the correct cable, it showed up damaged, I had to order a replacement cable, and FINALLY, I hook it all up and.... nothing.


Things I believe are ok:
1) The cable is a "Dtech USB to UART TTL Cable" My UART is shown functioning normally in device manager, and I set its parameters there. The driver is up to date. Parameters COM1 Baud 115200  Data bits 8 / Parity None / Stop bits 1 / Flow control None

2) The laptop is a budget but functional HP I5 running windows10. I use it every day. It works. Using Putty 64bit.

3) The OBD2 port on the bike works; I can connect my scanner, see the VIN and it ids as a ZeroMainBikeBoard or some such, and I can watch throttle position in real time.

4) I am certain I have the correct wires connected to the correct pins. My OBD2 shell has the numbers printed on it, reversed to correspond to an OBD2 port. I've double and triple checked.

5) I set putty to serial, Com1, baud 115200, and open a session. This shows a black command line box with a green square as a typing prompt, and nothing can be entered. Ok.

But what actually happens:
I connect the cable to my laptop, launch putty, connect the OBD2 end to the bike, power on the bike, then open a session with putty. What I see is exactly the same as if I had not connected to the bike... a green square for a cursor, not blinking, and no response to any keys, no menu, words, nothing.

Any ideas? I tried switching to Flow Control XON/XOFF, and tried reducing to Baud 9600 on both then gave up. I left everything else in putty as defaults, the Terminal Settings and stuff. 
Logged

atomicdog

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Using Putty to connect to MBB
« Reply #6 on: March 04, 2024, 06:27:12 AM »

I would try a different terminal emulator like Tera-tem.
I just tried again to get putty to work and changed a bunch of settings but still couldn't get it to work.
It does receive data from the MBB though, so if your not even seeing that I would triple check that the TX and RX lines aren't swapped.

Before you connect to the bike; you can do a loopback test of the OBDII cable you made by connecting pins 8 and 9 together. Then you should see what you type in the terminal.

You shouldn't need to key-on the bike either. The MBB will wake up when it detects a connection on the serial port.
Logged
23' SR/S

2020_SRS_Commuter

  • Sr. Member
  • ****
  • Posts: 250
    • View Profile
Re: Using Putty to connect to MBB
« Reply #7 on: March 04, 2024, 09:19:06 AM »

#1 Thanks for all your continued assistance. Last time I dealt with UARTs was in tech school and that was way back in prehistory, a decade before the internet was even a thing.

#2 Loop back worked.

#3 I checked the pinout and wire colors of the UART cable in its datasheet, then compared that to your pinout of OBD on the bike from your Github. Based on that, I had UART TX connected to bike RX, bike TX to UART RX. I assume that is the way it should be.

#4 I switched RX and TX on the soldered UART wires in my OBD2 adapter and badabing... text is there. Why? Because reality hates me, I guess. Or is it because RX should go to RX and TX to TX? Dunno.

Time for some coffee and I'll go play around with it.



Logged

LeverCommaJohn

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Using Putty to connect to MBB
« Reply #8 on: March 04, 2024, 10:49:24 PM »

Yeah, welcome to world of confusing nomenclature when it comes to SERIAL communications. Some devices actually label their PINS as to what THEY do (which is the way it *should* be done, IMHO), and other devices label their PINS as to what they should be plugged into on the other end. Thereby, leading to TX-TX and RX-RX connections. It's stupid. Glad you got it sorted!
Logged

Specter

  • Hero Member
  • *****
  • Posts: 1395
    • View Profile
Re: Using Putty to connect to MBB
« Reply #9 on: March 05, 2024, 06:06:19 AM »

wanna have some real fun?
plug in a serial cable when you should have used a null modem cable.

Aaron
Logged

2020_SRS_Commuter

  • Sr. Member
  • ****
  • Posts: 250
    • View Profile
Re: Using Putty to connect to MBB
« Reply #10 on: March 07, 2024, 07:34:23 AM »

I never was able to get the MBB prompt using Putty. Tried all the parameters I could think of. I was able to see messages appear when the bike arm/disable switch is turned, when you turn the bike on off, stuff like that. But not get or use the menu.
Next I tried TeraTerm and that worked fine. There are some settings for getting the text to format correctly in TeraTerms  dialog box. I'll post them up to save someone time, after I get back to my worksite where the laptop is.
Logged

2020_SRS_Commuter

  • Sr. Member
  • ****
  • Posts: 250
    • View Profile
Re: Using Putty to connect to MBB
« Reply #11 on: March 10, 2024, 09:15:10 AM »

Heres the setup for TeraTerm I used. Once you have it all set up, under the Setup tab, choose Save Setup, and name the file.
Next time you use TeraTerm, under the Setup tab, choose Restore Setup, and its all back like that again.
Logged
Pages: [1]