DIYBMS v4

next step:

where the $#@$^&@yb8q!!! find the hex files???

Programming the module

Programming the module takes around 12 seconds.

1. Identify which module/board you have using the details found at the end of this document.
2. Copy the required “.hex” file to the same folder where you extracted the avrdude tool to.
3. Now we shall program the module, run the command line similar to below, replacing the “diybms_module_firmware_400” filename where applicable.
4. The fuse settings are important, and are in the filename for example “eF4_hD6_l62” - means efuse=0xF4, hfuse=0xD6, lfuse=0x62

right…
We already know platfornIO no longer functions.
yet, instructions are:

Open the module code, navigate to platformio environment “env:attiny841_VXXX”, (where XXX is the version from above). Connect your USBASP programmer to the module and select “Upload”

I know i take baby steps, so please take me by the hand and tell me where I can find the hex files!!
they aren’t available @ GitHub - stuartpittaway/diyBMSv4Code: Software for diyBMS v4

I can’t compile. visual basic / platform IO combination no longer works for DIYBMS…

I’m probably the dumbest here, as I have zero Arduino experience, and also no arduino related software pre-installed.

when i read " Copy the required “.hex” file " I’m dumb enough to expect to find somewhere a hex file, and not required to compile…
Blond, I know…

Perhaps someone who have created the hex file can send me for 4.21 and 4.40?
(send me PM)

I’ve downloaded all files from Stuart on Github, extracted and made a search for “.hex” and came up blank.
Manually browsing all the files and folders give me nothing to work with.

I guess one would need visual and IO.
perhaps old versions of both might work…
I doubt I’m the only person having this trouble.

Except for the experienced users, who compile on daily base…
update:

BLOND it is…

This release removes the need to manually compile the code yourself, instead GITHUB Actions are now used to build the code for you automatically.

The files you will need are held as a ZIP file in Releases

Download the ZIP file named “Compiled_Firmware_YYYY-MM-DD-HH-MM.zip” and extract its contents and inside the folder you should find:

https://github.com/stuartpittaway/diyBMSv4Code/releases/download/Tag-2021-03-29-15-35/Compiled_Firmware_2021-03-29-15-35.zip

Thank you all for your patience.
Reading is always difficult, and especially to remember 3/4down the page.

@stuart , perhaps you can place the instruction to download the hexfiles also in the section where you describe on how to use Avrdude ?

Between " Setup the programmer" and " Programming the module" would be a good location to point (again) to the location of the files.

Thank you!

Thanks Stuart
I will keep my eyes peeled

Take it you got it working and found the files in the end!

1 Like

I’m affraid test code doesn’t work. Just the red LED on the ESP flashing. And this output on the serial port:

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371

hmmm that doesn’t sound good. Maybe @stuart knows what is going wrong.

To get you going and to recap. What happens if you only connect power to a module? Is the blue light flashing?

1 Like

Yes, the blue light flashes twice every few seconds.

I was looking back at the pictures you posted before, and I can’t see anything that might give you trouble. The flashing led on the module looks fine also.

Can you make a picture of your controller without the display mounted and a screenshot of the NODEMCU flasher screen when you program your ESP32?

This is the picture of one of the controllers not completely assembled. But the situation is the same on the other controller also.

And the screenshoot:

1 Like

I still don’t see anything strange. Only thing in NODEMCU I never go higher than 115200 Baud.
Can you check the orientation of the optocoupler near the TX1 Connector the dot need to be where the 1 is printed on the circuit board. Al you not able to get the test file running can you also check if the connection of the 2 traces highlighted in the images below is 0 ohm.


[EDIT] Measure them with the ESP32 seated on the board.
[EDIT2] now we are measuring also check the resistors R2 (2k2) and R3 (180R)

2 Likes

I think you found the problem! :clap: :clap: :clap:
The Optocoupler seems to be mounted upside down.

The two tracks have 0 ohm between them.

The problem with the test code must be something different.

Thanks a lot for your time and help. I’ll turn around this component.

Oke that sounds great let us know if it works after turning arround the optocoupler.

@Vince the test code cannot be programmed to the ESP32 using the NodeMCU flash tool, either use PlatformIO directly or use the “esphome flasher” tool - the instructions for this are on the ESP8266 version of the controller here [GitHub - stuartpittaway/diyBMSv4Code: Software for diyBMS v4]

Using platformIO I’m able to flash either the complete controller code or the test code. But then the ESP32 complains about not been able read the filesystem. More than probably I’m missing some step to build or upload the firmware.

Anyway, I’ll turn around the optocoupler on the controller and try again to flash with NodeMCU. It looks like it is directly related to the module communication problem.

@Vince In platformIO you also need to upload the filesystem image
image

1 Like

Great. I’ll try.

Looks like there is something else to the optocoupler.

Sometimes programming the module fails. Wifi settings are lost after an undefined number of reboots.

I’m enjoying a lot trying to make this baby work the way it should :sweat_smile:

@Vince just try programming with the ESP32 disconnected from the board.

Ok, when the controller is running,. You can hold down the BOOT button to wipe the WiFi settings. I’ve seen more than 1 esp32 which has the boot button wired differently to standard devkit devices. This could be the problem you see. The led should also light up (Cyan from memory)

Finally! :sweat_smile:

Thanks for the support!

3 Likes

Wifi settings are lost seemingly ramdom and without pressing the boot button. I’ll check the led color if it happens again.