Trouble with platform IO to upload to cell module

Hi everyone. I have trouble to upload the code to the cell module. I get the following error… The green LED starts to flash shortly but then the error appears. No clue what I’m doing wrong.

I get the following error…

CONFIGURATION: Redirecting...
PLATFORM: Atmel AVR (3.1.0) > Generic ATtiny841
HARDWARE: ATTINY841 8MHz, 512B RAM, 8KB Flash
PACKAGES:

  • framework-arduino-avr-attiny 1.3.2
  • tool-avrdude 1.60300.200527 (6.3.0)
  • toolchain-atmelavr 1.50400.190710 (5.4.0)
    LDF: Library Dependency Finder → …
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 14 compatible libraries
    Scanning dependencies…
    Dependency Graph
    |-- 1.4.0+sha.840272c
    |-- 1.3.1+sha.1792d23
    |–
    | |–
    | |-- 2.0
    |–
    |–
    Building in release mode
    Compiling .pio\build\attiny841_V400\src\diybms_attiny841.cpp.o
    Compiling .pio\build\attiny841_V400\src\main.cpp.o
    Compiling .pio\build\attiny841_V400\src\packet_processor.cpp.o
    Archiving .pio\build\attiny841_V400\libf6c\libPacketSerial.a
    Compiling .pio\build\attiny841_V400\liba96\FastPID\FastPID.cpp.o
    Compiling .pio\build\attiny841_V400\lib965\crc16\crc16.cpp.o
    Archiving .pio\build\attiny841_V400\libeba\libEEPROM.a
    Compiling .pio\build\attiny841_V400\lib070\settings\settings.cpp.o
    Compiling .pio\build\attiny841_V400\lib8a5\Steinhart\Steinhart.cpp.o
    Compiling .pio\build\attiny841_V400\FrameworkArduino\HardwareSerial.cpp.o
    Archiving .pio\build\attiny841_V400\lib965\libcrc16.a
    Archiving .pio\build\attiny841_V400\liba96\libFastPID.a
    In file included from lib\settings/settings.h:25:0,
    from include/packet_processor.h:9,
    from src\packet_processor.cpp:27:
    C:\users\papa.platformio\packages\framework-arduino-avr-attiny\libraries\EEPROM/EEPROM.h:145:20: warning: ‘EEPROM’ defined but not used [-Wunused-variable]
    static EEPROMClass EEPROM;
    ^
    In file included from lib\settings/settings.h:25:0,
    from src\main.cpp:51:
    C:\users\papa.platformio\packages\framework-arduino-avr-attiny\libraries\EEPROM/EEPROM.h:145:20: warning: ‘EEPROM’ defined but not used [-Wunused-variable]
    static EEPROMClass EEPROM;
    ^
    Archiving .pio\build\attiny841_V400\lib070\libsettings.a
    Archiving .pio\build\attiny841_V400\lib8a5\libSteinhart.a
    Compiling .pio\build\attiny841_V400\FrameworkArduino\Print.cpp.o
    Compiling .pio\build\attiny841_V400\FrameworkArduino\Stream.cpp.o
    Compiling .pio\build\attiny841_V400\FrameworkArduino\Tone.cpp.o
    Compiling .pio\build\attiny841_V400\FrameworkArduino\WInterrupts.c.o
    Compiling .pio\build\attiny841_V400\FrameworkArduino\WMath.cpp.o
    Compiling .pio\build\attiny841_V400\FrameworkArduino\WString.cpp.o
    Compiling .pio\build\attiny841_V400\FrameworkArduino\abi.cpp.o
    Compiling .pio\build\attiny841_V400\FrameworkArduino\main.cpp.o
    C:\users\papa.platformio\packages\framework-arduino-avr-attiny\cores\tinymodern\main.cpp:9:2: warning: #warning “This is the CLOCKWISE pin mapping - make sure you’re using the pinout diagram with the pins in clockwise
    order” [-Wcpp]
    #warning “This is the CLOCKWISE pin mapping - make sure you’re using the pinout diagram with the pins in clockwise order”
    ^
    Compiling .pio\build\attiny841_V400\FrameworkArduino\new.cpp.o
    Compiling .pio\build\attiny841_V400\FrameworkArduino\pins_arduino.c.o
    Compiling .pio\build\attiny841_V400\FrameworkArduino\wiring.c.o
    Compiling .pio\build\attiny841_V400\FrameworkArduino\wiring_analog.c.o
    Compiling .pio\build\attiny841_V400\FrameworkArduino\wiring_digital.c.o
    Compiling .pio\build\attiny841_V400\FrameworkArduino\wiring_pulse.c.o
    Compiling .pio\build\attiny841_V400\FrameworkArduino\wiring_shift.c.o
    Archiving .pio\build\attiny841_V400\libFrameworkArduino.a
    Linking .pio\build\attiny841_V400\firmware.elf
    Building .pio\build\attiny841_V400\firmware.hex
    Checking size .pio\build\attiny841_V400\firmware.elf
    Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
    RAM: [======= ] 70.7% (used 362 bytes from 512 bytes)
    Flash: [==========] 98.7% (used 8088 bytes from 8192 bytes)
    Configuring upload protocol…
    AVAILABLE: usbasp
    CURRENT: upload_protocol = usbasp
    Looking for upload port…
    Uploading .pio\build\attiny841_V400\firmware.hex

avrdude: Version 6.3, compiled on Sep 12 2016 at 17:24:16
Copyright © 2000-2005 Brian Dean,
Copyright © 2007-2014 Joerg Wunsch

     System wide configuration file is "C:\Users....\.platformio\packages\tool-avrdude\avrdude.conf"

     Using Port                    : usb
     Using Programmer              : usbasp
     Setting bit clk period        : 16.0

avrdude: seen device from vendor →
avrdude: seen product ->USBasp<-
AVR Part : ATtiny841
Chip Erase delay : 4500 us
PAGEL : P00
BS2 : P00
RESET disposition : possible i/o
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       eeprom        65     6     4    0 no        512    4      0  4000  4500 0xff 0xff
       flash         65     6    32    0 yes      8192   16    512  4500  4500 0xff 0xff
       signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
       lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

     Programmer Type : usbasp
     Description     : USBasp, ....

avrdude: try to set SCK period to 1.6e-005 s (= 62500 Hz)
avrdude: set SCK frequency to 32000 Hz
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.

avrdude done. Thank you.

*** [upload] Error 1
=============================================================================================== [FAILED] Took 2.65 seconds ===============================================================================================

Environment Status Duration

attiny841_V400 FAILED 00:00:02.650
========================================================================================== 1 failed, 0 succeeded in 00:00:02.650 ==========================================================================================
The terminal process “C:\Users…platformio\penv\Scripts\pio.exe ‘run’, ‘–target’, ‘upload’, ‘–environment’, ‘attiny841_V400’” terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

Have you tried uploading to any other modules?

Not yet. That was the first one I’ve built.

I realised that I made a mistake. I accidently swapped C2 and C3. After soldering them right atleast I come a bit further but still get an error…

Reading | ################################################## | 100% 0.00s

avrdude: verifying …
avrdude: 1 bytes of efuse verified
avrdude: reading input file “.pio\build\attiny841_V400\firmware.hex”
avrdude: writing flash (4976 bytes):

Writing | ################################################## | 100% 14.82s

avrdude: 4976 bytes of flash written
avrdude: verifying flash memory against .pio\build\attiny841_V400\firmware.hex:
avrdude: load data flash data from input file .pio\build\attiny841_V400\firmware.hex:
avrdude: input file .pio\build\attiny841_V400\firmware.hex contains 4976 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 9.62s

avrdude: verifying …
avrdude: verification error, first mismatch at byte 0x0010
0x69 != 0x68
avrdude: verification error; content mismatch

avrdude: safemode: hfuse reads as D6
avrdude: safemode: efuse reads as F4
avrdude: safemode: Fuses OK (E:F4, H:D6, L:E2)

What do I wrong?

It looks like you’re trying to install the V400 firmware, what boards have you got? If it’s the JLCPCB boards then you should select V421.

I spotted this issue with mine, the other options in PlatformIO just aren’t there any more. Not sure what changed.

@stuart is there a reason the other board options are no longer visible in PlatformIO?

Hi Ian,

thanks for the reply! I managed to get everything work with a massive help from Stuart. In the end there were various issues.

  • Bad soldering of the 6 pin connector
  • Trouble with the programmer - I Updated the FW on the progrmmer and used various USB ports. In the end I had to reconnect the programmer after every flash action to a different USB port. Otherwise there was a “no reply warning” during flash
  • I used the latest package from github for platformIO. As you mentioned I was also wandering where all the other module revisions were gone…
  • In the end I used the precompiled FW with avrdude which worked fine!

I’m using 24pcs V4 cell modules which I soldered myself, which was a stupid idea! In the end I think the modules were more expensive compared to the JLCPCB boards and the risk for a soldering f*ck up is high in my case :slight_smile:

1 Like

Awesome, glad you got it sorted. I’ve also just used avrdude with success so far.

No @Ian_Jordan , the options should still be there. However I now recommend that you don’t use platformio, just use the precompiled binary files from GITHUB and AVRDUDE or the new controller to program the boards.

image

Hmm, this is how it looks now, I’ve just downloaded it fresh and opened it on a different Laptop to check.

Same here. The newest download does not have ESPController to download. Could you fix and repost please.

So… I made a little test rig before I install everything on my VW batteries and basically all seem to work fine. Just 2 issues.

  • I can’t receive anything with mqtt
  • I can’t save any module settings

Any idea what could cause this?

Update: “Save” & mqtt issue solved! did not work with chrome but with microsoft edge. So it looks like you have to be carefull which browser you use… :slight_smile:

Unless you are editing the code, stay away from platformio - just use the precompiled versions from GITHUB and follow the instructions there to program the ESP and modules.

1 Like

I generally only use Chrome for building and testing - what was the problem/error?

What language is your web browser normally set to? I’ve had a report that the web interface didn’t work properly when set to Spanish language.

Problem was that I could not save the changes I made on the module config page.

There was always the error “failed to save settings”. I set German language.

Ignore the mqtt error. This was more a user error. It definitely helps when you type in the correct up address. :crazy_face:

That’s a security feature of the web interface. All you need to do is refresh the web page F5. And try again.

Yes, that was the solution! Thanks!