Jump to content

Converting the MSuper board to BT LE?


Recommended Posts

Looking at pictures of the MCM4 PCB the PCB itself looks to be the same as the one for MSuper - only the components placed are different. Maybe there's also a difference in firmware to enable this features. It's only a different configuration.

So it must be possible to enhance the MSuper PCB with the functionality of lights and Bluetooth LE, if Gotway like to enable this on the current/ old MSuper. Does any one has high resolution pictures of the area labeled "lights" and the Bluetooth module itself?

What we know from the MCM4 iOS App is the connection to Sihaicorp (http://www.sihaicorp.com/). It looks like they supplied the Bluetooth module and software related items.

The MSuper comes with Sihaicorp SH-HC-06 (http://www.sihaicorp.com/product/html/?10.html - SH-HC-06) Bluetooth 2.0 EDR, powered by 3.3V

Some config information on the SH-HC-06 Bluetooth module can be found here:
http://www.instructables.com/id/AT-command-mode-of-HC-05-Bluetooth-module/?ALLSTEPS
http://www.tiny-labs.com/projects/electronics-projects/-part-hc-06-bluetooth-to-serial-adapter

Link to comment
Share on other sites

On 24.2.2016 at 9:38 PM, OliverH said:

Looking at pictures of the MCM4 PCB the PCB itself looks to be the same as the one for MSuper - only the components placed are different. Maybe there's also a difference in firmware to enable this features. It's only a different configuration.

So it must be possible to enhance the MSuper PCB with the functionality of lights and Bluetooth LE, if Gotway like to enable this on the current/ old MSuper. Does any one has high resolution pictures of the area labeled "lights" and the Bluetooth module itself?

What we know from the MCM4 iOS App is the connection to Sihaicorp (http://www.sihaicorp.com/). It looks like they supplied the Bluetooth module and software related items.

The MSuper comes with Sihaicorp SH-HC-06 (http://www.sihaicorp.com/product/html/?10.html - SH-HC-06) Bluetooth 2.0 EDR.

Some config information on the SH-HC-06 Bluetooth module can be found here:
http://www.instructables.com/id/AT-command-mode-of-HC-05-Bluetooth-module/?ALLSTEPS
http://www.tiny-labs.com/projects/electronics-projects/-part-hc-06-bluetooth-to-serial-adapter

I could be wrong, as I haven't got much experience with Bluetooth (Wheelemetrics was the first and only time I have used BT), but I suspect just changing the chip won't work. The "SPP" (Serial Port Profile) used with Bluetooth Classic (2.0) works entirely differently than Bluetooth LE "GATT"-profile, so I suspect the entire firmware must be changed to work with LE.

EDIT: Although, you'd expect the 4.0 LE-chips to be backwards compatible, so if it can use the SPP, it could also work just fine. ;)

Link to comment
Share on other sites

The current BT is supposed to be a pass through serial interface. Other BT LE seems to work the same way or can so. They cost close to nothing so it's worth to play with this stuff ;)

The chip of the HC-06 can be reconfigured in the first second. A serial sniffer can show if something will be initialized/ configured on power up. AT commands can show the configuration. So I'll play with this stuff. I'm curious how it works.

The PCB of MSuper and MCM4 are different in layout (Note: Maybe the same but there could be two different PCB versions in the MSuper (v1, v2))

Will have a chat with a colleague on Monday regarding the iOS App and what possibilities he imagine to get it working on a non unlocked iOS device with the well known stability of a typical iOS App.

Link to comment
Share on other sites

My kids using my old MacBook Pro mid 2009 with BT 2.1 EDR. I should borrow it for tests to connect with CoolTerm via Bluetooth ;) Should be possible if I pay for this with a nice tour on the wheels with daddy :D

14 hours ago, esaj said:

I could be wrong, as I haven't got much experience with Bluetooth (Wheelemetrics was the first and only time I have used BT), but I suspect just changing the chip won't work. The "SPP" (Serial Port Profile) used with Bluetooth Classic (2.0) works entirely differently than Bluetooth LE "GATT"-profile, so I suspect the entire firmware must be changed to work with LE.

EDIT: Although, you'd expect the 4.0 LE-chips to be backwards compatible, so if it can use the SPP, it could also work just fine. ;)

I would like to use a dual mode chip. That should work fine. I need to take a look on your cool work with your app and the reverse engineering behind.

11 hours ago, NevNutz said:

I don't anything about bluetooth, but according to GotWay, simply changing the bluetooth module will not work. But hey if your up to the challenge, by all mean, go for it. Just update date us if it worked. I would love to have all the wheels working on one phone app and one phone

Not sure to get it working out if the box with the latest app. Don't expect to much. For example the BT module will have a different MAC address (GW app may be couldn't connect) which needs to be tweaked and there could be more.

Link to comment
Share on other sites

The Bluetooth profile used by Gotway is SPP (serial port profile), mentioned by @esaj before. It can only used for products certified "made for iPhone (mfi)" with an Apple Authentication Coprocessor (up to BT 4.0 without low energy). That's the reason why the first iOS App never hit Apple App Store.

To get it working on iOS (with an own SPP profile) with a trusted Apple App Store App the mainboard needs to use a BT 4.0 mfi module with Apple a Authentication Coprocessor and corresponding API or a BT 4.x low energy module.

Bluetooth profiles supported by Apple out of the box: https://support.apple.com/de-ch/HT204387

This issue needs some further investigation. 

Link to comment
Share on other sites

40 minutes ago, OliverH said:

Took my old MacBook Pro my kids use today and did a connect to the MSuper. Need do have a closer look next week and get my memory on the good old days of Hayes AT commands back..

 

Bluetooth Connect.png

SPP_data.png

It looks like that's just showing you the ASCII printable characters.  Also, you don't need to use Hayes AT commands.  The Gotway just spits out the data.

You may already have this but this is a slightly modified version of @esaj's breakdown.

I've seen 3 packet types 00, 03, 04.  I don't know what 03 is used for.

Packet String Type = 00    i.e.    55 aa 17 1c 00 00 00 00 00 00 00 e0 f2 78 00 01 ff f8 00 18 5a 5a 5a 5a
55 aa = Header
17 1c = Voltage
00 00 = Speed
00 00 00 00 = Trip Odo
00 e0 = Current
f2 78 = Temperature
00 01 ff f8 = UNKNOWN
00 = Packet String Type
18 = Byte Count excluding the "55 aa"
5a 5a 5a 5a = Footer

Packet String Type = 04    i.e.    55 aa 00 00 ec f2 00 00 00 00 00 00 00 00 00 00 00 00 04 18 5a 5a 5a 5a
55 aa = Header
00 00 ec f2 = Odometer
00 00 00 00 00 00 00 00 00 00 00 00
04 = Packet String Type
5a 5a 5a 5a = Footer

 

Link to comment
Share on other sites

When you say commands do you just mean the Riding mode and turning the first 2 alarms off?  If so, that's easy to do as well.  Here are those commands (there's a CR after each command):

Madden mode:
h   
b

Comfort mode:
f
b

Soft mode:
s
b

Turn off level 1 alarm:
u
b

Turn off level 2 alarm:
i
b

Turn on speed alarm:
o
b

Or are there some other commands that I don't know about?

 

Link to comment
Share on other sites

3 hours ago, SirGeraint said:

When you say commands do you just mean the Riding mode and turning the first 2 alarms off?  If so, that's easy to do as well.  Here are those commands (there's a CR after each command):

Madden mode:
h   
b

Comfort mode:
f
b

Soft mode:
s
b

Turn off level 1 alarm:
u
b

Turn off level 2 alarm:
i
b

Turn on speed alarm:
o
b

Or are there some other commands that I don't know about?

 

There's a command mode in the data mode and the real command mode where you get access to th Bluetooth device firmware direct with AT commands and may be more.

I've two things in mind:

I would like to have an iOS App. The current BT device talks BT 2.x EDR with SPP, a protocol which replaced serial wire connections, If migrating to a SPP compatible BT 4.0 device (dual mode BT4.0/ BLE) this can only be a private dev App. This can't be put in App Store because of requirements (SPP) with the Apple security chip which is not on the Bluetooth modules you can buy. If using GATT with BLE device we need a converter from this xml stuff to SPP commands (e.g. Arduino) or the firmware needs to be changed. The App stuff needs to use a legacy protocol to keep load low for the CPU.

I would like to look under the hood.

 

/edit

The conversion using an Arduino opens possibilities to do lights (with auto detect/ auto switch on) and MP3 playback who needs it. Separating modules from the main PCB makes it easier to have a safety analysis (if needed and us than the key to get a SIL/ ASIL level) later as you can define the scope better and look on the functions and interface only.

Link to comment
Share on other sites

After some investigation/ evaluation I got to the point not using a simple Bluetooth module with BT 4.0/ LE capability. It's said that  the firmware must be changed which makes sense because LE is using a different Bluetooth profile. So I need a device connecting to Rx/ Tx on the Gotway mainboard, having a Bluetooth 4.0/ LE capability and some CPU power doing a conversion from BT LE with GATT over the radio to the smartphone and converts the GATT messages to SPP to the Gotway mainboard. 

Beside the connect/ convert function such a board can handle lights.

So I ended with the Adafruit Feather M0 Bluefruit:

https://www.adafruit.com/products/2995

 

Link to comment
Share on other sites

2 hours ago, OliverH said:

After some investigation/ evaluation I got to the point not using a simple Bluetooth module with BT 4.0/ LE capability. It's said that  the firmware must be changed which makes sense because LE is using a different Bluetooth profile. So I need a device connecting to Rx/ Tx on the Gotway mainboard, having a Bluetooth 4.0/ LE capability and some CPU power doing a conversion from BT LE with GATT over the radio to the smartphone and converts the GATT messages to SPP to the Gotway mainboard. 

Beside the connect/ convert function such a board can handle lights.

So I ended with the Adafruit Feather M0 Bluefruit:

https://www.adafruit.com/products/2995

 

I'm still not sure on this (as I haven't investigated it much), but it looks like what that does is use two GATT-characteristics that "match" the simple input- and output-streams of SPP:

https://learn.adafruit.com/adafruit-feather-m0-bluefruit-le/uart-service

What I was wondering is if these would work (BT LE -modules advertising SPP-capabilities):

http://www.aliexpress.com/item/HM-13-4-0-Dual-mode-Bluetooth-Module-BLE-SPP-LE-Serial-Port-BT-Version-V4/32211025659.html  (just an example, this one seems to be without a base board)

I don't know much about those really, none of the images of the "HM-13" modules I've seen are clear enough to see the chip markings (so I could look up data sheets). There are also HM-10, 11 and 12  (I think the module Michael Vu posted about was HM10 or 11).

It could also mean that these modules just can support both Bluetooth 2 and 4, but not act as a "bridge" between them.

Link to comment
Share on other sites

8 hours ago, esaj said:

I'm still not sure on this (as I haven't investigated it much), but it looks like what that does is use two GATT-characteristics that "match" the simple input- and output-streams of SPP:

https://learn.adafruit.com/adafruit-feather-m0-bluefruit-le/uart-service

What I was wondering is if these would work (BT LE -modules advertising SPP-capabilities):

http://www.aliexpress.com/item/HM-13-4-0-Dual-mode-Bluetooth-Module-BLE-SPP-LE-Serial-Port-BT-Version-V4/32211025659.html  (just an example, this one seems to be without a base board)

I don't know much about those really, none of the images of the "HM-13" modules I've seen are clear enough to see the chip markings (so I could look up data sheets). There are also HM-10, 11 and 12  (I think the module Michael Vu posted about was HM10 or 11).

It could also mean that these modules just can support both Bluetooth 2 and 4, but not act as a "bridge" between them.

The original BT module will be removed and the Adafruit is connected with Rx/ Tx to the 4 PIN header of the BT module port on the Gotway board. The Bluetooth should talk LE with GATT to the smartphone. The Arduino should convert the GATT calls/ messages to the protocol used on Rx/Tx. That's the basic idea. So the Arduino should talk on Rx/ Tx the "language" which the Gotway board understand.

Link to comment
Share on other sites

  • 1 month later...

Ordered yesterday an Arduino board with BT LE to start a "rainy day" project to get the stuff working as a BT LE GATT bridge to the serial port protocol from BT 2 as on the MSuper V2 mainboard. I don't understand that Gotway never offered an upgrade/ conversion kit for iPhone 4s and beyond users.

Lights are also on the list to be controlled from the Arduino board.

Link to comment
Share on other sites

Where's the best place to connect the Arduino to power? First I thought using the battery power with a DC/ DC converter. The  Gotway main board has 3.3V on the port of the BT module and also on the 2 PIN port opposite on the main board. I've no idea how much load this ports can handle. Looks like the Adafruit Feather can take 500 mA peak and is advertised with V_in of 3.7-4-2V and will not run with 3.3V.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...