-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't flash ATMega328P #19
Comments
I use “Arduino Uno” as board type. Also, you can try flashing it via the serial header using an USB2UART programmer. Check this post about the Sonoff SC. |
Hi I have the same error here. @xoseperez What is the correct commandline-command to do this? This saves us setting up both systems (with more potential traps) (used your platformio-file to build & upload, pulled both jumper, connected all 5 cables and even switched RX and TX for testing) |
Hi Guys, I received my sonoffsc and flashed ESP in few minutes but struggled 2 days with ATMEGA. Nothing worked! I tested ATMega and saw it was not dead by connecting serial terminal and seeing AT+STATUS? from original firmware being sent over (be aware of the baud rate). I first bet reset pin was not working but multi-meter show everything ok. Finally I downloaded the original source code to try put some light and read something like "first flash bootloader" in the readme file. Immediately thought "Are they flashing with ISP without arduino bootloader?"; grabbed my ArduinoDUE that was with ArduinoISP firmware, wired everyting (3v3, so do not put sonoffsc on the USB or DUE will fry), burned bootloader and voilá, not it flashes ok but fail reading (fuse issue). Worked! Maybe you have a sample like mine? Mine is a V2 PCB with DHT11 soldered (I removed it and put headers so I can change sensor every time it fails - DHTxx fails a lot). BR, |
@jrbenito Thanks, I saw your post on comments thread. I'll use my Uno as ISP... I've planned to do it later next week, but now... I want to try! 👍 |
I don't have any Uno. What could I use as an alternative for ISP? (esp8266 / esp32) ? If I access the 'atmega' by
Ideas? Couldn't find anything in the internet. I don't have any DHT** connected. |
Can somebody get me on the way ? i am flashing my SC for the second time de Atmega328p but when i try now i get this error. Who has the solution ? 38588 106 1020 39714 9b22 .pioenvs/sonoffsc/firmware.elf
|
Hi,
Your firmware is too big
Em 4 de nov de 2017 23:15, "Wieg" <[email protected]> escreveu:
… Can somebody get me on the way ? i am flashing my SC for the second time
de Atmega328p but when i try now i get this error. Who has the solution ?
38588 106 1020 39714 9b22 .pioenvs/sonoffsc/firmware.elf
Error: The program size (38694 bytes) is greater than maximum allowed
(32256 by
tes)
*** [.pioenvs/sonoffsc/firmware.elf] Explicit exit, status 1
========================== [ERROR] Took 14.03 seconds
=========================
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAH6IrVJ3foovsrWcqLoL8YfkC3H6QOgks5szQwVgaJpZM4PpDho>
.
|
its the standard download 1.1.1.1 from here .... what to do ? platformio project ... i dont get it ... it worked .... |
Didn't you add nothing? The firmware size you reported is 38k while
atmega328 only has 32k (31k if you use arduino bootloader).
Em 4 de nov de 2017 23:21, "Wieg" <[email protected]> escreveu:
… its the standard download 1.1.1.1 from here .... what to do ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAH6IpNBKNadvh53HFQfOmmsdwKkgyiRks5szQ2tgaJpZM4PpDho>
.
|
Yes i know ..... 32k ... strange thing is ... i didn't change anything I tried, download, unzip open atom/platformio connect the atmega328 and flash - Size to big Followed tinkerman and xoseperez .... and get this result ..... Hardware wise i added the DHT22, LED ring, detection sensor .... i am sooooo close in making it all work i looked at the libaries ... they are all needed, so i am a bit stuck in the final fase of making it work. i need some tips from guys who did this project ................. |
I am far from my computer today to test anything. If you can't solve it
later I will try to reproduce.
In my case I discovered I could not flash atmega328 because it was shipped
without arduino bootloader. After using isp instead of usb/ttl everything
was OK.
Em 5 de nov de 2017 09:39, "Wieg" <[email protected]> escreveu:
… Yes i know ..... 32k ... strange thing is ... i didn't change anything
I tried, download, unzip open atom/platformio connect the atmega328 and
flash - Size to big
(flashed the 8266 also with the firmware, no problems at all)
Followed tinkerman and xoseperez .... and get this result ..... Hardware
wise i added the DHT22, LED ring, detection sensor .... i am sooooo close
in making it all work
i looked at the libaries ... they are all needed, so i am a bit stuck in
the final fase of making it work.
i need some tips from guys who did this project .................
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAH6IgASsk7vXed5uieB_wrIAYzqpWwJks5szZ5ggaJpZM4PpDho>
.
|
I have Sonoff SC Rev.2.0. I tried to flash ATMega328P for about two months. Tried many options. First I used FTDI USB to TTL with a lot of different drivers. Then I bought another FTDI USB to TTL and again tried different options. Then I bought USBASP and again tried a lot of drivers. Using Platformio and Arduino IDE. Nothing helped. But I was able to reflash ATMega328P only after I updated the firmware on the USBASP, using the following instruction (in Russian): http://xdomus.ru/usbasp-upgrade. After that, everything worked. Hooray!!! |
I have exactly the same problem as @Wieg: SonofSC V2.0 w/ DTH11 soldered and no other sensor mounted, freshly downloaded v1.1.1 and getting the error:
I'll try to downgrade |
Let me know how it goes @maur8ino .... pulled my hairs out, left it for a moment .... now doing some homeassistant scripts too "clear" my mind |
I was able to compile it and flash it only by commenting out all the references to the Adafruit NeoPixel and WS2812FX which brings down the size to 10176b. Since I have no led connected, I don't really need them, but other might need them. @Wieg if you want I can fork the project and just commit the change I've in local 😄 |
yes please @maur8ino ..... ill start flashing ..... and thinking about my led solution .... i still need some of those function voor my led ring ..... |
@Wieg here's the temporary fix https://github.com/maur8ino/sonoffsc! @xoseperez is this normal? Thanks! 😄 |
great ... have a beer on me ! |
hahaha i am still thinking ... i built in the presence sensor, dht22 and the LED .... stiil don't get how tinkerman and XO did the firmware for that. |
Maybe some library upgraded recently? I just cloned project did a "pio run"; since the computer I am using never compiled this project it downloaded all libraries and did compile resulting same 38694 bytes binary. As soon as I get back home tonight I will recompile the firmware there since it worked about a month ago. Than I will try upgrade source code (I don´t believe it changed since I cloned) and after, upgrade libraries. Let´s see. |
@jrbenito mmm I just did a fresh clone and I'm still getting the error
the size is 118.1% 😢 |
It is what I just said, I cloned fresh new code and downloaded libraries (platformio does it for you) and got oversized firmware. However, I do believe that code at my home computer compiles so the only thing I can think about is some library update that made code size exploded. Checking here with fresh cloned code, I checked out later version of @xoseperez code and give me exact same code size as you got. So, the issue is not in sonoffsc code but in some library. I opened platformio.ini and checked library dependency and:
-Adafruit_NeoPixel -WS2812FX -Ticker So, I clone WS2812FX but checkouted it to a later version (SHA 069139b9340e14cd46d8fafe14972b6c056273ec) and compiled with code size 29948 bytes. Checked out at sha b31c3fbcffa510afe46897cb2261bbcd6c892249 and code size compiled 38694 bytes. Every sha between those above gave me compilation error. Hence, the guilty is WS2812FX library, if you want to correct it by hand (workaound) do:
Now your code will, hopefully, compile with manageable size. BRs, |
Filed an issue to the library owner: kitesurfer1404/WS2812FX#50 |
@jrbenito awsome ........ ill be checking in to this in a few hours ........ can't wait :) great community here .... thank you very much |
@jrbenito thanks for the explanation! 😄 |
@jrbenito even better you can pin a library to a specific git hash in your lib_deps =
DHT sensor library
Adafruit NeoPixel
- WS2812FX
+ https://github.com/kitesurfer1404/WS2812FX#069139b
Ticker
https://github.com/xoseperez/seriallink#0.1.0 I updated my fork pinning the WS2812FX library to the latest working hash. |
Perfect!!!
|
it worked great .... now to play with it in homeassistant ;) |
Hi, I've the same problem :/ |
@maur8ino I'm trying to use your releases with pio and im getting the foloowing issues when project is open; I this project still alive? Thanks Pablo |
@pablobolomey I just tried to do a You could get away with removing the - https://bitbucket.org/xoseperez/justwifi.git#1.1.4
+ https://bitbucket.org/xoseperez/justwifi.git but I dunno if it's gonna work. Let me know if it worked! |
Thanks, I finally work that out and solved that issue but now it’s shows other complied warnings and errors.
Regards,
Pablo Bolomey
Sent from iPhone
… On 13 Aug 2018, at 18:43, Mauro Verrocchio ***@***.***> wrote:
@pablobolomey I just tried to do a pio run on a fresh checkout and I traced the error to justwifi which is an external (the only result when searching for 1.1.4 in the project btw): xoseperez have removed all the tags and pushed just the master branch.
You could get away with removing the #1.1.4 from esp8266/platform.ini like:
- https://bitbucket.org/xoseperez/justwifi.git#1.1.4
+ https://bitbucket.org/xoseperez/justwifi.git
but I dunno if it's gonna work.
I don't have the hardware anymore so I can't try 😢.
Let me know if it worked!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/xoseperez/sonoffsc","title":"xoseperez/sonoffsc","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in ***@***.*** in #19: @pablobolomey I just tried to do a `pio run` on a fresh checkout and I traced the error to `justwifi` which is an external (the only result when searching for **1.1.4** in the project btw): **xoseperez** have removed all the tags and pushed just the `master` branch.\r\n\r\nYou __could__ get away with removing the `#1.1.4` from `esp8266/platform.ini` like:\r\n```diff\r\n- https://bitbucket.org/xoseperez/justwifi.git#1.1.4\r\n+ https://bitbucket.org/xoseperez/justwifi.git\r\n```\r\n \r\nbut I dunno if it's gonna work.\r\nI don't have the hardware anymore so I can't try 😢.\r\n\r\nLet me know if it worked!"}],"action":{"name":"View Issue","url":"#19 (comment)"}}} [ { ***@***.***": "http://schema.org", ***@***.***": "EmailMessage", "potentialAction": { ***@***.***": "ViewAction", "target": "#19 (comment)", "url": "#19 (comment)", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { ***@***.***": "Organization", "name": "GitHub", "url": "https://github.com" } }, { ***@***.***": "MessageCard", ***@***.***": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB", "title": "Re: [xoseperez/sonoffsc] Can't flash ATMega328P (#19)", "sections": [ { "text": "", "activityTitle": "**Mauro Verrocchio**", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": ***@***.***", "facts": [ ] } ], "potentialAction": [ { "name": "Add a comment", ***@***.***": "ActionCard", "inputs": [ { "isMultiLine": true, ***@***.***": "TextInput", "id": "IssueComment", "isRequired": false } ], "actions": [ { "name": "Comment", ***@***.***": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"xoseperez/sonoffsc\",\n\"issueId\": 19,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}" } ] }, { "name": "Close issue", ***@***.***": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"xoseperez/sonoffsc\",\n\"issueId\": 19\n}" }, { "targets": [ { "os": "default", "uri": "#19 (comment)" } ], ***@***.***": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", ***@***.***": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 262420584\n}" } ], "themeColor": "26292E" } ]
|
@pablobolomey it the compilation failing? |
Yes it’s failing due to some syntax and veritable errors missing or not define words.
I have downloaded the zip file of the code
Pablo
Sent from iPhone
… On 13 Aug 2018, at 20:09, Mauro Verrocchio ***@***.***> wrote:
@pablobolomey it the compilation failing?If it's just warning the compilation will most likely to go through.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/xoseperez/sonoffsc","title":"xoseperez/sonoffsc","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in ***@***.*** in #19: @pablobolomey it the compilation failing?If it's just warning the compilation will most likely to go through."}],"action":{"name":"View Issue","url":"#19 (comment)"}}} [ { ***@***.***": "http://schema.org", ***@***.***": "EmailMessage", "potentialAction": { ***@***.***": "ViewAction", "target": "#19 (comment)", "url": "#19 (comment)", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { ***@***.***": "Organization", "name": "GitHub", "url": "https://github.com" } }, { ***@***.***": "MessageCard", ***@***.***": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB", "title": "Re: [xoseperez/sonoffsc] Can't flash ATMega328P (#19)", "sections": [ { "text": "", "activityTitle": "**Mauro Verrocchio**", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": ***@***.***", "facts": [ ] } ], "potentialAction": [ { "name": "Add a comment", ***@***.***": "ActionCard", "inputs": [ { "isMultiLine": true, ***@***.***": "TextInput", "id": "IssueComment", "isRequired": false } ], "actions": [ { "name": "Comment", ***@***.***": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"xoseperez/sonoffsc\",\n\"issueId\": 19,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}" } ] }, { "name": "Close issue", ***@***.***": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"xoseperez/sonoffsc\",\n\"issueId\": 19\n}" }, { "targets": [ { "os": "default", "uri": "#19 (comment)" } ], ***@***.***": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", ***@***.***": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 262420584\n}" } ], "themeColor": "26292E" } ]
|
This issue is fixed in the
|
@xoseperez thanks for the clarification, I didn't realize that you're moving all your repos from BitBucket to Github hehe |
thanks @xoseperez @maur8ino, I have moved to the dev files. corrected some errors but still getting these: Once again thanks for all the support Pablo Compiling .pioenvs\sonoffsc\lib665\ESPAsyncTCP\ESPAsyncTCP.cpp.o C:/Users/pablo.bolomey/Desktop/sonoffsc-dev/esp8266/sonoffsc/lights.ino: In function 'void sendNotification(bool, long unsigned int)': Archiving .pioenvs\sonoffsc\lib0bc\libESP8266WiFi.a [SUMMARY] |
Same, removed support for the LED ring and the size was correct. |
Guys, no one has compiled binary files for firmware (preferably for ATMega too)? Honestly, I'm already a little tired of fighting this device. I bought it about two years ago, and since then it has been lying around disassembled so far due to the fact that I just can not flash it. Every time I try, then I stumble upon any difficulties with compiling and throw it again. Once again, I took it, taking into account all the above-mentioned features, I adjusted the list of dependencies, but again nothing good comes out:
Thanks in advance for any of your help. |
Hello,
I really like your work, but I can’t flash the ATMega328P with Arduino and do not know what I’m doing wrong. I flashed a lot of sonoff devices and also the ESP part of the Sonoff SC, but don’t know how to flash the ATMega328P.
I have compiled everything without errors, but when I want to upload the code I get everytime this message:
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x8e
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xfc
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x70
Beim Hochladen des Sketches ist ein Fehler aufgetreten
Have I press a button to get in flash mode? I have choosen Board: Arduino Nano and processor: ATMega328P. The green LEd is blinking on the Sonoff. In the serial monitor I see AT+STATUS?
I have also disconnected the jumpers.
I really tried everything and getting crazy….
Thank you very much for help
The text was updated successfully, but these errors were encountered: