Bafang SW102 Bluetooth LCD - OpenSource firmware and mobile app

geeksville said:
If there is a big problem with this release I'll quickly push out a new build ...

Thanks for the 'extra-mile/kilometer' support! I'll give it a try.
 
I just flashed my SW 102 according to the wiki. The log said everything went fine but the display does not come up at all.. is there any way to check if the display is working without connecting the motor? Should it come up when I connect the ST link v2 3.3v and GND or do I have to wire the display to the motor first?
 
geeksville said:
... This new release ... version is 0.5.0-beta-4. ... We look forward to your reports of great success (or failure, ahem) in this thread.

On initial testing, it appears that the SOC indication and automatic power off seem to be working properly. In addition, I found a couple new, hopefully unintended, features.
  • Info screen 2 has only once entered the configuration mode for me. Fortunately, I restored my preferred data display items this first time through, while exploring the new way the buttons function in this mode (which I presume was an intentional change!!!) Wanting to update my SW102 configuration document, I have tried multiple times without success to re-engage info screen 2 configure mode, even after an hour with system power off.
  • Under "Start Pwr", when the new attribute 'Need pedal' is set to 'always', start power is engaged, even though 'Feature disable' is selected.
On the subject of configuration, I thought that I had read some months back that settings were being retained across updates. They were not in my case with this update, and my memory of my preferred riding setting was strenuously tested. Lacking settings retention, a function to set the odometer value would be most excellent. I recall reading of such a function being available for one of the other displays.

I have yet to see any screen blobs from the cursor while navigating the settings configuration, as I have in past versions, and, so far, have not encountered the issue where some settings appear with a reversed background, nor the other screen irregularities from earlier versions.

So, it is really looking like a later stage Beta. Thanks Team!

P.S. In case you didn't know, anxiously waiting to see a SW102 interacting with V0.20. :wink:
 
stefkrger said:
I just flashed my SW 102 according to the wiki. The log said everything went fine but the display does not come up at all.. is there any way to check if the display is working without connecting the motor? Should it come up when I connect the ST link v2 3.3v and GND or do I have to wire the display to the motor first?

Presuming that this is the initial flash (of the bootloader and v0.19.x firmware via the wires). On the initial flash, after successful completion, it is supposed to start running a simulator and display as if it is connected to the motor, which it did for my case. If not, sounds like something went wrong.
 
I am excited about this new 0.5.0 beta! I just got eclipse working and building this repo so I can start tweaking my new build and contributing around here.

One of the first things I am working on is enabling the throttle, which I noticed might have already been done in this build.

I noticed in state.c that for case 8 in the switch for send_tx_package, the default is now l2_vars.ui8_temperature_limit_feature_enabled & 3;

I installed the update, but my throttle isn't working. It does still show the ADC response in the config menu, so i am sure it just needs to be coded in. I am going to try to dig a little deeper, but thought i would reach out in case there is a trick or something i haven't noticed yet.
 
windburner said:
Presuming that this is the initial flash (of the bootloader and v0.19.x firmware via the wires). On the initial flash, after successful completion, it is supposed to start running a simulator and display as if it is connected to the motor, which it did for my case. If not, sounds like something went wrong.

Thanks mate.. I hope I did not kill my display during soldering. I’ll try to flash it again later today. Is there any advantage having it connected to the motor power (like in the wiki) as opposed to the 3.3v from the stlink?
 
Info screen 2 has only once entered the configuration mode for me.

I have the same.

I also noticed that, when You press M button and return to main screen , the assist level digit dissapears.
You have to press ^ or v button to change .

gJqiEA.jpg
 
stefkrger said:
Is there any advantage having it connected to the motor power (like in the wiki) as opposed to the 3.3v from the stlink?

I used the 3.3v from the stlink. After having gone through the pain of making the other three connections, what's another one?
 
bikelpl said:
I also noticed that, when You press M button and return to main screen , the assist level digit dissapears.

:thumb: Yes, I saw that too. Since it has been a long term issue, I didn't think to report it.
 
So I've just tried the flashing again.
The device is still not coming up after the routine.

Everything looks pretty similar to the screenshot in the wiki entry, however I've noticed a slight difference (marked in the picture below). In the wiki screenshot this line says:
info : nRF51822-QFAC(build code: A1) 256 kB Flash

What could be the issue here?

screenshot.PNG
 
geeksville said:
windburner said:
Nfer said:
I tried to open the sw102 cutting the glue at sides of the keypad and I killed the down button contact. It was my fault, instructions are good. Is it possible to use the display without the down button?

The Down button is critical for the configuration process, as well as adjusting the Assist Level, so, I'd say no. Can you solder in a wire or something to bridge the break? (I know it is tight working, as I hope to never have to mess about inside my SW102 again.)

If you do need to fix your button, you can try removing the PCB (it comes out with a little connector on the back - just flip the black tab up to release the cable). This should give you better access to plug in a jumper. But if that won't work, yeah you'll need to plunk down another $35.

I was able to flash the display with the solder less method after several attempts. Just ordered a new display. I hope you will find a way to flash it without risk. Thanks for your effort in this amazing project. The sw102 looks fantastic
 
I've just ordered sw102 and while looking for the instructions how to flash it initially I've noticed that instructions how to open sw102 from the side, without destroying keypad waterproofing are nowhere to be found. I clearly remember seeing it on github but it's not there anymore. Am I missing something?
 
hefest said:
I've just ordered sw102 and while looking for the instructions how to flash it initially I've noticed that instructions how to open sw102 from the side, without destroying keypad waterproofing are nowhere to be found. I clearly remember seeing it on github but it's not there anymore. Am I missing something?

https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/Open-SW102-by-cutting-a-side-part-and-solder-SWD-wires
 
geeksville said:
... new release ... version is 0.5.0-beta-4. ...

So far, on the OSF for the SW102, the Trip Meter and Odometer values on Info Screen 2 display without a decimal point, i.e., 0.1 miles displays as 01, 1.1 as 11, and I don't recall what happens >=10.0 miles given the resets with the version updates (I wish I knew for 5-beta-4, but, the snow/cold is in my way). Is it planned that the display of these values (especially Trip) will eventually get the decimal point? If not planned, can it be considered? Thanks
 
stefkrger said:
So I've just tried the flashing again.
The device is still not coming up after the routine.

Everything looks pretty similar to the screenshot in the wiki entry, however I've noticed a slight difference (marked in the picture below). In the wiki screenshot this line says:
info : nRF51822-QFAC(build code: A1) 256 kB Flash

What could be the issue here?

screenshot.PNG
I would say you have no connection on SWD pins. Verify again your connection on SWD pins to the SW102 and try again.
 
casainho said:
I would say you have no connection on SWD pins. Verify again your connection on SWD pins to the SW102 and try again.
I just removed the soldered wires and tried with the solderless method using a 2mm 1x4 pin header. With that method I could not get a connection. Then I soldered the wires again and now I‘m seeing the same log output as in the screenshot I posted earlier.

It seems it does flash something and the connection check works as well. It’s just that my display does not turn on..
 
stefkrger said:
casainho said:
I would say you have no connection on SWD pins. Verify again your connection on SWD pins to the SW102 and try again.
I just removed the soldered wires and tried with the solderless method using a 2mm 1x4 pin header. With that method I could not get a connection. Then I soldered the wires again and now I‘m seeing the same log output as in the screenshot I posted earlier.

It seems it does flash something and the connection check works as well. It’s just that my display does not turn on..
Then I would say you have a faulty unit.
 
Don't want to spam, but if anyone is considering flashing their unit -- could you please dump the FW using the method nick / geeksville mentioned first?

I'm the idiot that didn't realize this FW isn't compatible with the BBS02... :lol:

Thanks in advance! :bigthumb:
 
casainho said:
Then I would say you have a faulty unit.
I’m afraid so.. however it will be quite hard to return with the cut open side :lol:

It could also be that something went wrong during the first flash attempt. I remember it failed with some weird error message. Maybe it corrupted some part of the firmware?

Update:
I ordered a new SW102 which arrived today.. opened it, soldered the wires, flashed it, and it worked. Guess I was really unlucky and the first display I got was just broken.
 
Will it work on any SW102 to reflash it over bluetooth (when that method is ready), or will we need one with a specific firmware to start with? I assume it needs to have a bootloader with bluetooth enabled, but it's unclear if they all use the same bootloader at the moment?
 
obcd said:
Will it work on any SW102 to reflash it over bluetooth (when that method is ready), or will we need one with a specific firmware to start with? I assume it needs to have a bootloader with bluetooth enabled, but it's unclear if they all use the same bootloader at the moment?
As far as we know, should work in every SW102 coming from the factory.
 
Opened sw102 and about to solder the wires and flash it for the first time.

At the moment i have some older 0.19.x version of the firmware on the motor. Can I flash latest 0.19.x sw102 and will it be compatible with the current firmware on the motor?
 
hefest said:
Opened sw102 and about to solder the wires and flash it for the first time.

At the moment i have some older 0.19.x version of the firmware on the motor. Can I flash latest 0.19.x sw102 and will it be compatible with the current firmware on the motor?

Latest SW102 firmware is only compatible with 0.19.x firmware. 0.20 motor firmware isn't yet supported
 
Well crap. Wired sw102 wire color to wire color to the jack where ktlcd3 was wired. I think i fried the sw102 .

PS: connected P+ batt voltage to uart tx on sw102, definitely fried.
 
I am trying to get throttle working on the SW102 and noticed in configscreen.c in the define section for SW102, there is only two options for the ADC (temp sensor or off):
Line 80:
FIELD_EDITABLE_ENUM("Feature", &l3_vars.ui8_temperature_limit_feature_enabled, "disable", "enable"), // FIXME, share one array of disable/enable strings

Is there some reason we cannot have all three options like 850C?
Lin 204:
FIELD_EDITABLE_ENUM("Feature", &l3_vars.ui8_temperature_limit_feature_enabled, "disable", "temperature", "throttle"), // FIXME, share one array of disable/enable strings

Thanks for any tips!
 
Back
Top