wifi firmware update on SBMS120

542 views
Skip to first unread message

Jim A

unread,
Dec 20, 2020, 5:27:55 PM12/20/20
to electrodacus

For those that have completed a firmware update on the SBMS120 wifi, I would appreciate some help on the procedure that you followed.  Robert's directions are for the SBMS0 and the 120 is different (I think).  More specific the better :)    thx,   jim

Dacian Todea

unread,
Dec 20, 2020, 6:33:32 PM12/20/20
to electrodacus
Programing of SBMS0 and SBMS120 will be the same

Jim A

unread,
Dec 20, 2020, 8:02:24 PM12/20/20
to electrodacus
The actual flashing I get, but the connections that Robert shows in his directions for the SBMS0 are for the wifi module.  Where do I connect (3.3v, gnd, rx, tx) on the SBMS120?

Wil N Stevenson

unread,
Dec 20, 2020, 8:13:11 PM12/20/20
to electrodacus
Jim, where would I find Robert's SBMS0 Wifi instructons?  Thx, Wil

Jim A

unread,
Dec 20, 2020, 8:16:38 PM12/20/20
to electrodacus

Harold

unread,
Dec 21, 2020, 1:57:58 AM12/21/20
to electrodacus
I think you can find the information on page 16 of the SBMS40-SBMS120 manual

The pin are accessible with female dupont wires. on the 16pin connector on the left side of the LCD of SBMS.

01 & 02 UART TX and RX pins are used for the WiFi module so if you want to use the USART for
something else then WiFi will be disabled (voltage levels 0 to 3.3V).
07 ESP Flash connected to GND will put the ESP32 WiFi module in programming mode.

Make sure your USB/UART converter is 3.3V compatible, (power supply AND TX/RX)
I found some cheap USB/UART converter that would provide 3.3V for power, but still 5V on TX/RX !

Le lundi 21 décembre 2020 à 02:16:38 UTC+1, Jim A a écrit :

Dacian Todea

unread,
Dec 21, 2020, 2:07:08 AM12/21/20
to electrodacus
Jim,

I did not realized that you were talking about that Robert. Those instructions are to program the WiFi module not the main microcontroller on the SBMS (what I understood)
To program the WiFi on the SBMS120 may be a bit more dificil and I never tried to do that.
But you should connect pin 5 BOOT0 to pin 12 3.3V this way the microcontroller will not run and not interfere with the WiFi module.
Then Pin7 ESPFLASH should be connected to GND pin 9 or 10 this will put the ESP32 in programing mode once it is powered up that ESP FLASH to GND can be disconnected
So now you can supply the SBMS120 through the USB  (SBMS120 not connected to battery for this).
The you should be able to use the pin 1 and 2 (and GND pin 9) to program the ESP32 
When you need to program the second part you will need to power cycle by removing the USB power and connect the ESPFLASH to GND again before that.

This should work but I have not tested as I always programed the ESP32 modules before soldering them to the SBMS120.

Jim A

unread,
Dec 21, 2020, 5:35:51 PM12/21/20
to electrodacus
Ok, that worked like a charm !! I've got it flashed with the new firmware.
I have a SBMS120... hardware v0.3d and software v3.0g. 
I have the wifi set up as client.
All is working well.
Is there a more recent firmware update for the microcontroller that I should be using?

thx,  jim

Dacian Todea

unread,
Dec 21, 2020, 5:48:29 PM12/21/20
to electrodacus
Jim,

Glad to hear all worked well.  There is version 5.0 but not much new for SBMS120 is mostly modifications for the newer SBMS0 versions. You can download that from here if you want  https://electrodacus.com/SBMS0/sbms120-v50d.bin.zip
Programing for this will requite an ST-Link V2.0 programer.

Murray Argo

unread,
Feb 17, 2021, 6:34:02 PM2/17/21
to electrodacus
So Jim, did you get the wifi firmware working by using the pins that dacian mentioned? did you run into anything else that was a little off, in terms of the installation process?

Jim A

unread,
Feb 17, 2021, 10:11:55 PM2/17/21
to electrodacus
Yes I did, followed Dacian's instructions exactly and it worked seamlessly.  No other issues at all.

Murray Argo

unread,
Feb 19, 2021, 6:51:58 PM2/19/21
to electrodacus
Jim, so you did the following:

connected pin 5 to pin 12 and pin 7 to pin 9. 

connected sbms to usb

remove pin 7 to pin 12

connect tx, rx and gnd 

Then how did you connect to the sbms for the flashing? does the ota still apply in this case?




Jim A

unread,
Feb 21, 2021, 12:21:03 PM2/21/21
to electrodacus
Yes, make those connections (follow Dacian's instructions).  When ready to flash, connect your serial converter to your laptop USB port. Make sure that you're powering your laptop from it's own battery and not the SBMS120 battery. That's all there is to it.  It worked for me... good luck!

I don't know about the OTA.  I think once you have the wifi firmware upgraded, then in the future you can use OTA, but not 100% positive.  

Murray Argo

unread,
Feb 21, 2021, 8:33:00 PM2/21/21
to electrodacus
im running in some issues at the platformio run step. It says bash: platformio: command not found

Jim A

unread,
Feb 21, 2021, 8:55:54 PM2/21/21
to electrodacus
Did you follow these instructions on Robert's Github site?  
--------------------------------------------------------------------------------------------------------------

Installation / Flashing

Open a terminal or cmd window.

  1. Clone the repository by either downloading the zip file manually or running:
git clone https://github.com/armageddon421/electrodacus-esp32.git

And enter the directory

cd electrodacus-esp32
  1. Install PlatformIO
pip install -U platformio
platformio update
  1. Compile the code. Platformio will automatically install any missing dependancies. Check for any errors.
platformio run

If all goes well, you should see memory usage bars like these and a line below that reading [SUCCESS] in the middle.

RAM:   [=         ]  13.5% (used 44224 bytes from 327680 bytes)
Flash: [=======   ]  74.3% (used 973461 bytes from 1310720 bytes)
  1. Flash! Platformio will usually find the right serial port to use automatically.
platformio run --target upload

Note: For OTA updates add -e ota --upload-port [IP/hostname] to the end of the commands. 5. After the process is finished, replug your USB (or power supply) to reboot the ESP32 and make sure the GPIO0 is still connected to GND so you can flash again. 6. Upload the filesystem

platformio run --target uploadfs
  1. After the process is finished, disconnect GPIO0 and replug your USB (or power supply) to reboot the ESP32. That should be it.
--------------------------------------------------------------------------------
This is what I did, and all worked flawlessly.

Murray Argo

unread,
Feb 21, 2021, 11:18:52 PM2/21/21
to electrodacus
yeah, what were you running on? I was originally on windows but went over to a pi.

Jim A

unread,
Feb 22, 2021, 1:46:49 PM2/22/21
to electrodacus
I was running Windows 10 on my laptop. Didn’t try the pi.

Murray Argo

unread,
Feb 23, 2021, 6:51:28 PM2/23/21
to electrodacus
I'm receiving this when I run Platformio "Error: Detected a whitespace character in project paths"

Murray Argo

unread,
Feb 23, 2021, 10:45:33 PM2/23/21
to electrodacus
Update I am on step 4 and get this "Error: Please specify `upload_port` for environment or use global `--upload-port` option" 
did you have to specify the port?

Jim A

unread,
Feb 23, 2021, 11:37:20 PM2/23/21
to electrodacus
Sorry Murray, I'm not a programmer, just good at following directions.  I have no idea what those errors are.  Maybe Robert can help. Or someone who knows how to use a raspberry pi better than me. Or try using a Windows computer to flash the update on the SBMS.   Hope someone chimes in on this.   jim

Murray Argo

unread,
Feb 23, 2021, 11:54:09 PM2/23/21
to electrodacus
Thanks Jim.

Hopefully so. I am actually on a windows laptop. That is how I got to step 4. For some reason platformio is not finding the correct port. 

If anyone that is more experienced wants to chime in then I am all ears.


Robert Tagscherer

unread,
Feb 24, 2021, 2:21:21 AM2/24/21
to electr...@googlegroups.com
Hi Murray,

What kind of usb to serial adapter are you using? Does it show up correctly in the windows device manager? Are there any other serial devices there and which com numbers do they have?
If you find the correct device and port, you can try adding --upload-port=COMx to the upload commands

Murray Argo

unread,
Feb 24, 2021, 11:21:36 AM2/24/21
to electrodacus
Hi Robert,

I figured out the issue with this part. The serial adapter needed a driver. 

now it is finding the correct port. Although now I am running into an issue with connecting to the esp from there. It is timing out when trying to connect. I have tx rx and gnd connected. (as dacian mentioned for the sbms40) also the boot0 (pin 5) to 3.3v (pin 12) is still connected.  

here are the last 2 lines:

Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header

Dave Festing

unread,
Feb 24, 2021, 11:53:37 AM2/24/21
to electrodacus

Robert Tagscherer

unread,
Feb 24, 2021, 11:55:22 AM2/24/21
to electrodacus
The boot pin should be connected to ground and not to 3.3v. also, if you have removed the wifi module from the sbms you have to supply 3.3v yourself.

Dave Festing

unread,
Feb 24, 2021, 11:56:55 AM2/24/21
to electrodacus
Also, how is the ESP32 getting its main supply power?  Trying to power an ESP32 or ESP8266 via the serial to UART converter is problematical.

Murray Argo

unread,
Feb 24, 2021, 11:59:28 AM2/24/21
to electrodacus
here is what dacian said earlier in this thread about instructions related to the sbms120. Jim got it to work this way.

Robert Tagscherer

unread,
Feb 24, 2021, 12:12:38 PM2/24/21
to electrodacus
Yes this seems accurate. Sorry for the boot pin confusion.

Murray Argo

unread,
Feb 24, 2021, 1:51:38 PM2/24/21
to electrodacus
If these pin connections are accurate then what could be causing the esp to not connect?

Dacian might have to chime in on this part. I will lay out what I have done this far. 

1) disconnect SBMS40 from battery
2) connect pin 5 to pin 12
3) connect pin 7 to pin 9
4) connect usb power and then remove pin 7 to pin 9 connection
5) run cmd (1-3)
6) CP2102 Connections to SBMS40: connect pin 1 to rx, connect pin 2 to tx, connect pin 9 to GND
7) Connect CP2102 to laptop and run cmd 4 (platformio run --target upload)
This is the point where it times out, trying to connect to esp.

Although it does find the correct port
 
 

Robert Tagscherer

unread,
Feb 24, 2021, 2:05:34 PM2/24/21
to electrodacus
How are you powering the device?

Murray Argo

unread,
Feb 24, 2021, 2:27:29 PM2/24/21
to electrodacus
The usb on the sbms as dacian mentioned. Unless I misunderstood him

Jim A

unread,
Feb 24, 2021, 3:34:19 PM2/24/21
to electrodacus
OK, I think I figured it out.  I had flashed 2 SBMS120's before with no problem.  But, just now I tried the process again... start to finish, and I kept getting the same error you get.  Then I reversed pins 1 & 2 and it seemed to work then.  I don't remember doing that initially, but that was a while ago.  Hope that works for you as well.  jim

Murray Argo

unread,
Feb 24, 2021, 5:48:05 PM2/24/21
to electrodacus
Jim, did you have the follwoing connections: 
USB to the SBMS micro usb port  

RX, TX, GnD connected to the usb to TTL. t

 pin 07 to pin 12? 

Jim A

unread,
Feb 24, 2021, 7:18:46 PM2/24/21
to electrodacus
No, 

pin 5 should be connected to pin 12

and pin 7 should be connected to 9 or 10, then disconnected once USB power is connected (you should have a white screen)

Jim A

unread,
Feb 26, 2021, 9:10:14 AM2/26/21
to electrodacus
Hi Murray,  Just wondering if you were able to get this working?   jim

Murray Argo

unread,
Feb 26, 2021, 9:39:16 AM2/26/21
to electrodacus
I had pin 7 to 10. That was just a typo on my part. 

I get the white screen. The correct port is found. It still times when trying to connect. I tried to switch rx and tx. No luck. not really sure what's going on. I assume the white screen means that the esp is in pairing mode?

Jim A

unread,
Feb 26, 2021, 9:48:01 AM2/26/21
to electrodacus
That's correct.  I have no idea.  Have you tried connecting to 192.168.4.1?  As I mentioned, I was able to replicate it again the other day, so I know it's working.  I'll continue to investigate.  jim

Murray Argo

unread,
Feb 26, 2021, 10:35:04 AM2/26/21
to electrodacus
I have not tried to connect to 192.168.4.1. Does your wifi still show up as SBMS-040?

Jim A

unread,
Feb 26, 2021, 12:55:12 PM2/26/21
to electrodacus
Murray, After the firmware update I have it set up as a client with an IP address on my network.  So no, it doesn't show up as a connection like that anymore. Also, I don't have a SBMS40 only the 120.  But I don't think that should be any different.  I honestly don't have any idea why yours isn't working.

Murray Argo

unread,
Feb 26, 2021, 1:07:05 PM2/26/21
to electrodacus
Jim, I appreciate your help. I figured it out. something was wrong with my cp2102. Luckily I found another one around the house and it worked. 

It was odd that it was showing up in ports on device manager and the drivers were updated. Not entirely sure what was wrong with it but its working now. Set up as client,

I really appreciate your effort.
Reply all
Reply to author
Forward
0 new messages