SmartPower2 alt firmware

paulcrawford
Posts: 160
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2 and n2
Has thanked: 19 times
Been thanked: 4 times
Contact:

Re: SmartPower2 alt firmware

Unread post by paulcrawford » Mon Oct 28, 2019 10:08 pm

@ytrikoz

I have confirmed that if running telnet to 192.168.4.1 you do “set wifi 3” and then “config apply”, the SP2 will not be able to restart.

This is critical. Can you please fix this?

ytrikoz
Posts: 46
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Tue Oct 29, 2019 9:01 am

paulcrawford wrote:
Mon Oct 28, 2019 11:52 am
@ytrikoz,
...
I have now done a full plaformio compile and flash as I did to get the web page working before and everything seems to be working until I try to make changes on config.
When I set wifi 3 set ssid *** and set passwd *** and config apply, the boot process stalls at WIFI 40% then resets and starts again only to reset again. I have to rerun platformio to get the SP2 working again. These settings worked fine before in 0.6.8.
I may (definitely) be mistaken about the operating of the toolchain pipe and the temprorary location of the firmware files, which I then upload to the forum as working, assuming that I just built them up and uploaded them to my device and it works. I apologize and try to figure out what's wrong (what I'm doing wrong).

And you are right and i did't checked wifi 3 mode (but did some changes in code with it), but it's simply to fix.
paulcrawford wrote:
Mon Oct 28, 2019 11:52 am
voltage mod
Now i'm ready to begin with this issue. I got several questions to answer.
What measurement you got in range 4.1 - 5.3 could you do it? (if it posible with .1v step) i mean real output voltage with DMM. I figure what 5.1 give you 12.7, but may i ask one time more (if you wrote this already before, triple sorry i totaly missed it). web admin - 5.3 - give us 12.9V output and... 5.2, - ? 5.1 -? 5.0 - 12.7V ... what about low side of 5v? Are you getting ~2,54 times higher output, right? What difference in the voltage measurements (is it constant delta or not?) from DMM vs device log/display? This information from the modified device (i use stock) will allow me to correctly work out the "volt-mod".Thank you in advance!

ytrikoz
Posts: 46
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Tue Oct 29, 2019 9:44 am

0.6.9: fixes... i hope.

roadmap:
0.6.9: if applying the new configuration creates boot errors, device should restore previous (used on last success boot) config or downfall to default config.
0.7.0: full stabilization of the current functionality (include all things that bug reported in this topic and did't fixed yet)
0.8.0: logs (graphs) of device power on/off sessions, continuous recording (collecting) when the web page is open.
Maybe you have a suggestion or needs (how you use the device? maybe this will suggest thoughts on how to improve the user experience)

Did you test power avg command, wich value of averaging you are finding most usefull?
What do you think about Google Sheets as persistance storage for data logging or some local network storage / logging tools/ protocol will be preferable ?

use show psu to see running parameters,
with in config voltage="13.5"
show psu outputs this:
power: off
status: ok
output: 5.30
store: false
mod: true

this is expected behavior
Attachments
0.6.9_firmware.zip
(521.55 KiB) Downloaded 15 times

User avatar
mad_ady
Posts: 6888
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 248 times
Been thanked: 181 times
Contact:

Re: SmartPower2 alt firmware

Unread post by mad_ady » Tue Oct 29, 2019 2:56 pm

What do you think about Google Sheets as persistance storage for data logging or some local network storage / logging tools/ protocol will be preferable ?
I'd stay away from the cloud because its apis may change frequently and because your data leaves the home.

You can use syslog strictly for logging stuff over the network. It's simple, udp based and shouldn't take a lot of lines of code to implement. The data processing can be done on the receiving end with a parser script that can feed the data into whatever system.
Alternatively I've seen MQTT has a growing adoption as a IoT protocol and allows you to export data to various consumers, but also allows for remote control. There are libraries for it, but it's heavier than syslog. Have a look at tasmota to see a mqtt implementation on espxxxx.

paulcrawford
Posts: 160
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2 and n2
Has thanked: 19 times
Been thanked: 4 times
Contact:

Re: SmartPower2 alt firmware

Unread post by paulcrawford » Tue Oct 29, 2019 11:20 pm

ytrikoz wrote:
Tue Oct 29, 2019 9:01 am

And you are right and i did't checked wifi 3 mode (but did some changes in code with it), but it's simply to fix.
wifi 3 mode is still broken on the latest version I downloaded today
ytrikoz wrote:
Tue Oct 29, 2019 9:01 am
Now i'm ready to begin with this issue. I got several questions to answer.
What measurement you got in range 4.1 - 5.3 could you do it? (if it posible with .1v step) i mean real output voltage with DMM. I figure what 5.1 give you 12.7, but may i ask one time more (if you wrote this already before, triple sorry i totaly missed it). web admin - 5.3 - give us 12.9V output and... 5.2, - ? 5.1 -? 5.0 - 12.7V ... what about low side of 5v? Are you getting ~2,54 times higher output, right? What difference in the voltage measurements (is it constant delta or not?) from DMM vs device log/display? This information from the modified device (i use stock) will allow me to correctly work out the "volt-mod".Thank you in advance!
See the attachment for the voltage data you asked for.
Attachments
voltage.xlsx
(6.21 KiB) Downloaded 14 times
These users thanked the author paulcrawford for the post:
ytrikoz (Wed Oct 30, 2019 5:02 am)

paulcrawford
Posts: 160
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2 and n2
Has thanked: 19 times
Been thanked: 4 times
Contact:

Re: SmartPower2 alt firmware

Unread post by paulcrawford » Tue Oct 29, 2019 11:36 pm

ytrikoz wrote:
Tue Oct 29, 2019 9:44 am
Maybe you have a suggestion or needs (how you use the device? maybe this will suggest thoughts on how to improve the user experience)
I will be moving the data to my N2 where it will be managed in an existing database and graphing system that I have developed for other data so I really just need the raw data.
ytrikoz wrote:
Tue Oct 29, 2019 9:44 am
Did you test power avg command, wich value of averaging you are finding most usefull?
I have not yet really explored the power avg command. The default value of 3 looks OK to me so far. I will have another look once the other issues have been resolved.
ytrikoz wrote:
Tue Oct 29, 2019 9:44 am
What do you think about Google Sheets as persistance storage for data logging or some local network storage / logging tools/ protocol will be preferable ?
Since I have my own facility, I would not use Google.
ytrikoz wrote:
Tue Oct 29, 2019 9:44 am
use show psu to see running parameters,
with in config voltage="13.5"
show psu outputs this:
power: off
status: ok
output: 5.30
store: false
mod: true

this is expected behavior
This works fine but I get also uptime: *** and not mod: true.

paulcrawford
Posts: 160
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2 and n2
Has thanked: 19 times
Been thanked: 4 times
Contact:

Re: SmartPower2 alt firmware

Unread post by paulcrawford » Tue Oct 29, 2019 11:37 pm

mad_ady wrote:
Tue Oct 29, 2019 2:56 pm
What do you think about Google Sheets as persistance storage for data logging or some local network storage / logging tools/ protocol will be preferable ?
I'd stay away from the cloud because its apis may change frequently and because your data leaves the home.

You can use syslog strictly for logging stuff over the network. It's simple, udp based and shouldn't take a lot of lines of code to implement. The data processing can be done on the receiving end with a parser script that can feed the data into whatever system.
Alternatively I've seen MQTT has a growing adoption as a IoT protocol and allows you to export data to various consumers, but also allows for remote control. There are libraries for it, but it's heavier than syslog. Have a look at tasmota to see a mqtt implementation on espxxxx.
I agree and thanks for the tip in syslog...

ytrikoz
Posts: 46
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Wed Oct 30, 2019 5:02 am

paulcrawford wrote:
Tue Oct 29, 2019 11:36 pm

Code: Select all

############### Welcome ################
           SmartPower2 v0.6.9
############# Oct 29 2019 ##############
[display] ready
[wait] 5 4 3 2 1 
[psu] restore: 1130.93
[psu] store: enabled
[wifi] mode: ap sta
[wifi] tpw: 82
[wifi] host: smartpower2
[wifi] dhcp: on
[wifi] ssid: *******************
[wifi] bssid: ec:************
[wifi] ch: 5
[wifi] got ip: 192.168.1.204 subnet: 255.255.255.0 gateway: 192.168.1.1 dns: 192.168.1.1 
[wifi] setbroadcast2 ->3
[wifi] ip: 192.168.4.1 subnet: 255.255.255.0 gateway: 192.168.4.1 dns:
[wifi] ssid: *******************
[app] network up (14.95 sec)
[dns] smartpower2.local 192.168.1.204:53
[netbios] smartpower2
[mdns] smartpower2
[ntp] server: pool.ntp.org
[ntp] port: 123
[telnet] port: 23
[update] port: 8266
press "enter" to start
[ntp] request: 194.190.168.1:123
[ntp] request: 194.190.168.1:123
[ntp] response: 1572378521
[clock] time: 1572378521
wed 22:49:06> show
free 23.23kB max 23.21kB frag 1%
wifi:
http: 0
telnet: 0
wed 22:49:11> show psu
power: off
status: ok
output: 12.90
store: true
mod: true
wed 22:51:47> show psu
power: on
status: ok
output: 12.90
uptime: 152
store: true
mod: true
wed 22:51:53>
0.6.9:
0.6.9_firmware.zip
(521.62 KiB) Downloaded 22 times
These users thanked the author ytrikoz for the post:
odroid (Wed Oct 30, 2019 11:50 am)

paulcrawford
Posts: 160
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2 and n2
Has thanked: 19 times
Been thanked: 4 times
Contact:

Re: SmartPower2 alt firmware

Unread post by paulcrawford » Wed Oct 30, 2019 10:54 am

@ytrikoz

Congratulations, the Output voltage now works perfectly.

I tried set wifi 3, but that still does not work so I assume that you have not been able to correct that yet. Once that is done I will have another try at reviewing all of the features and get back to you with comments.

Thanks again for all of your hard work.
These users thanked the author paulcrawford for the post:
ytrikoz (Thu Oct 31, 2019 4:53 am)

ytrikoz
Posts: 46
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Thu Oct 31, 2019 4:52 am

paulcrawford wrote:
Wed Oct 30, 2019 10:54 am
@ytrikoz
I tried set wifi 3, but that still does not work so I assume that you have not been able to correct that yet. Once that is done I will have another try at reviewing all of the features and get back to you with comments.
a little bit wrong, I posted a log above, with active ap sta mode (my device still working in ap-sta right now). Trying to figure out why there might be a problem. Is it possible to show the exception what you get on reboot?
It's looks something like (ex):

Code: Select all

Exception (9):
epc1=0x402097a3 epc2=0x00000000 epc3=0x00000000 excvaddr=0x20000007 depc=0x00000000

>>>stack>>>

ctx: cont
sp: 3ffffd20 end: 3fffffc0 offset: 01a0
3ffffec0:  0000000b 3ffef454 3fff54fc 40202ddc
3ffffed0:  3ffe8ba2 3ffef454 00000009 40202f6c
3ffffee0:  3ffefc04 00000001 3fff26fc 00002a39  
3ffffef0:  3ffefc04 00000001 3fff26fc 40203016
3fffff00:  00007075 00000000 ff100cbc 00002a39  
3fffff10:  3fffff00 4023392e 00000004 40223ba0
3fffff20:  0030d2c4 3fff3d94 00000004 3ffefd38
3fffff30:  3fffdad0 00000001 3ffef664 4010013b
3fffff40:  3fffdad0 00000001 3ffef664 4020f3fc
3fffff50:  00000000 00000000 00000000 00000000
3fffff60:  3fffdad0 00000000 00000004 4023392e
3fffff70:  3fffdad0 00000000 3ffef454 40202ecc
3fffff80:  3fff3d94 00000000 40201fa0 40202f9c
3fffff90:  3fffdad0 3ffef454 3ffefc04 4020f8ca
3fffffa0:  feefeffe 00000000 3ffefd08 40220ab0  
3fffffb0:  feefeffe feefeffe 3ffe86a8 40101295  
<<<stack<<<

paulcrawford
Posts: 160
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2 and n2
Has thanked: 19 times
Been thanked: 4 times
Contact:

Re: SmartPower2 alt firmware

Unread post by paulcrawford » Thu Oct 31, 2019 5:30 am

I saw the data about your SP2 that you output on the latest version but I do not know how to duplicate that on my system. Reading again it seems it is a log. I did not do one of those before but I will try now. How do I output the exceptions on reboot?

ytrikoz
Posts: 46
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Thu Oct 31, 2019 5:41 am

paulcrawford wrote:
Thu Oct 31, 2019 5:30 am
I saw the data about your SP2 that you output on the latest version but I do not know how to duplicate that on my system. Reading again it seems it is a log. I did not do one of those before but I will try now. How do I output the exceptions on reboot?
Needs serial connection...in serial you should get it (it's low level sdk function i could't break it) suggested that, after flashing and the reboot, will you connect via telnet and no serial connection (thing so you wrote that early). In my case (testing), I always have a serial port connected ... even if connect via telnet. I'll try this.

nope. this is not the cause of the problem, the device boots up and works without serial, telnet working, ap sta mode active.
if you could show me your serial log right from start, it's help a lot. No needs in passwords and addresses network names etc.

Did you try to "erase flash" and then "flash" with firmware files?

In repo for this moment totaly the same code as i got locally, i checked.
0.6.9_262c2c3.zip
(319.72 KiB) Downloaded 13 times
Today i''ll check the project with platformio code analysis tools (new feature) and will post update after that.

paulcrawford
Posts: 160
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2 and n2
Has thanked: 19 times
Been thanked: 4 times
Contact:

Re: SmartPower2 alt firmware

Unread post by paulcrawford » Thu Oct 31, 2019 10:25 pm

ytrikoz wrote:
Thu Oct 31, 2019 5:41 am

if you could show me your serial log right from start, it's help a lot. No needs in passwords and addresses network names etc.
I think this is what you are looking for:

Code: Select all

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v8b899c12
~ld

############### Welcome ################
           SmartPower2 v0.6.9           
############# Oct 29 2019 ##############
[display] ready
[wait] 5 4 3 2 1 
[store] not exists '/var/utc'  
[psu] restore: 278.01
[psu] store: enabled
[psu] restore: 278.01
[wifi] mode: ap sta
[wifi] tpw: 82
[wifi] host: smartpower2
[wifi] dhcp: on
[wifi] ssid: ********
[wifi] bssid: ************
[wifi] ch: 1
[wifi] got ip: 192.168.10.*** subnet: 255.255.255.0 gateway: 192.168.10.1 dns: 192.168.10.1 
[wifi] setbroadcast2 ->3

Exception (3):
              epc1=0x40223916 epc2=0x00000000 epc3=0x4000e23d excvaddr=0x40023931 depc=0x00000000

ytrikoz
Posts: 46
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Fri Nov 01, 2019 12:10 am

paulcrawford wrote:
Thu Oct 31, 2019 10:25 pm
I think this is what you are looking for:
My thoughts:
1. it's flashing problem - with choosed mode, too fast.
2. it's version not from last git commit or last post.
Your exception is special - you can even google it.
So:
Erase frash, and flash both files it will work, or do it with platformino from git sources - will work too.

PS may i see yours local platformio.ini in project root?

Code: Select all

[platformio]
description = smartpower2
default_envs = release

[env]
platform = espressif8266
board = nodemcuv2
framework = arduino
lib_deps =
;SimpleTimer_ID419
  419
;WebSockets_ID549  
  549
;LiquidCrystal_ID136
  136
;ArduinoJson_ID64
  64
;SimpleCLI_ID5606
  5606
monitor_speed = 115200

; to update over-the-air
; upload_protocol = espota

; device address for over-the-air update
; upload_port = 192.168.1.203

[env:release]
build_type = release

[env:debug]
build_type = debug
Last edited by ytrikoz on Fri Nov 01, 2019 1:05 am, edited 2 times in total.

ytrikoz
Posts: 46
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Fri Nov 01, 2019 12:25 am

Make sure that the device is connected not only to usb but to the main power supply also!

you should built project with last avalaible version of platformio

Code: Select all

platformio update
platformio upgrade


to fully erase flash (it's not need to do every time, but sometimes it's may help)

Code: Select all

platformio run --target erase

to flash firmware (all settings, personal data, saved in other part of flash memory, they will not be affected)- it's regular update procedure

Code: Select all

platformio run --target upload
to flash and start serial terminal after that

Code: Select all

platformio run --target upload --target monitor
to flash data part of firmware (it also erase all settings, save it first)

Code: Select all

platformio run --target uploadfs
you don't need to use sudo command (it's from manual, they even not recomended do that).
Last edited by ytrikoz on Fri Nov 01, 2019 6:07 am, edited 2 times in total.

paulcrawford
Posts: 160
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2 and n2
Has thanked: 19 times
Been thanked: 4 times
Contact:

Re: SmartPower2 alt firmware

Unread post by paulcrawford » Fri Nov 01, 2019 3:53 am

I did an update to platformio, downloaded the latest code from github, verified that the last committed file, platformio.ini was correct, compiled the code, erased the sp2 and uploaded the files with platformio and I still get the error on set wifi 3 and config apply.

This is platformio update output:

Code: Select all

Updating tool-scons                      @ 2.20501.190826 [Up-to-date]

Platform Manager
================
Platform Espressif 8266
--------
Updating espressif8266                   @ 2.2.3          [Up-to-date]
Updating tool-esptoolpy                  @ 1.20600.0      [Up-to-date]
Updating tool-mkspiffs                   @ 1.200.0        [Up-to-date]
Updating tool-esptool                    @ 1.413.0        [Up-to-date]
Updating framework-arduinoespressif8266  @ 2.20502.0      [Up-to-date]
Updating toolchain-xtensa                @ 2.40802.190218 [Up-to-date]


Library Manager
===============
Library Storage: /home/paulcrawford/.platformio/lib
This is platformio.ini:

Code: Select all

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[platformio]
description = smartpower2
default_envs = release

[env]
platform = espressif8266
board = nodemcuv2
framework = arduino
lib_deps =
;SimpleTimer_ID419
  419
;WebSockets_ID549  
  549
;LiquidCrystal_ID136
  136
;ArduinoJson_ID64
  64
;SimpleCLI_ID5606
  5606
monitor_speed = 115200
; build_flags = -Wl,-Teagle.flash.4m1m.ld 
; -DLAST_BUILD_TIME=$UNIX_TIME
; upload_protocol = espota
; upload_port = 192.168.1.203

[env:release]
build_type = release

[env:debug]
build_type = debug
This is fw upload:

Code: Select all

Processing release (platform: espressif8266; board: nodemcuv2; framework: arduino)
--------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 2.2.3 > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: toolchain-xtensa 2.40802.190218 (4.8.2), tool-esptool 1.413.0 (4.13), tool-mkspiffs 1.200.0 (2.0), tool-esptoolpy 1.20600.0 (2.6.0), framework-arduinoespressif8266 2.20502.0 (2.5.2)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 34 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <SimpleTimer>
|-- <WebSockets> 2.2.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <Hash> 1.0
|   |-- <SPI> 1.0
|   |-- <Ethernet(esp8266)> 1.0.4
|   |   |-- <SPI> 1.0
|-- <LiquidCrystal> 1.5.0
|   |-- <Wire> 1.0
|-- <ArduinoJson> 6.12.0
|-- <SimpleCLI> 1.0.5
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266SSDP> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <ArduinoOTA> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266mDNS> 1.2
|   |   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <Wire> 1.0
|-- <ESP8266NetBIOS> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WebServer> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <mcurses>
Linking .pio/build/release/firmware.elf
Retrieving maximum program size .pio/build/release/firmware.elf
Checking size .pio/build/release/firmware.elf
Building .pio/build/release/firmware.bin
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [====      ]  41.8% (used 34252 bytes from 81920 bytes)
PROGRAM: [====      ]  43.7% (used 456696 bytes from 1044464 bytes)
Creating BIN file ".pio/build/release/firmware.bin" using ".pio/build/release/firmware.elf"
Configuring upload protocol...
AVAILABLE: espota, esptool
CURRENT: upload_protocol = esptool
Looking for upload port...
Auto-detected: /dev/ttyUSB0
Uploading .pio/build/release/firmware.bin
esptool.py v2.6
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP8266EX
Features: WiFi
MAC: 5c:cf:7f:80:17:f8
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 460848 bytes to 318407...
Wrote 460848 bytes (318407 compressed) at 0x00000000 in 28.0 seconds (effective 131.6 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
================================== [SUCCESS] Took 34.13 seconds ==================================

Environment    Status    Duration
-------------  --------  ------------
release        SUCCESS   00:00:34.127
debug          IGNORED
================================== 1 succeeded in 00:00:34.127 ==================================
This is upload of fs:

Code: Select all

Processing release (platform: espressif8266; board: nodemcuv2; framework: arduino)
--------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 2.2.3 > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: toolchain-xtensa 2.40802.190218 (4.8.2), tool-esptool 1.413.0 (4.13), tool-mkspiffs 1.200.0 (2.0), tool-esptoolpy 1.20600.0 (2.6.0), framework-arduinoespressif8266 2.20502.0 (2.5.2)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 34 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <SimpleTimer>
|-- <WebSockets> 2.2.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <Hash> 1.0
|   |-- <SPI> 1.0
|   |-- <Ethernet(esp8266)> 1.0.4
|   |   |-- <SPI> 1.0
|-- <LiquidCrystal> 1.5.0
|   |-- <Wire> 1.0
|-- <ArduinoJson> 6.12.0
|-- <SimpleCLI> 1.0.5
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
|-- <ArduinoOTA> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266mDNS> 1.2
|   |   |-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266SSDP> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <Wire> 1.0
|-- <ESP8266WiFi> 1.0
|-- <ESP8266NetBIOS> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WebServer> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <mcurses>
Building SPIFFS image from 'data' directory to .pio/build/release/spiffs.bin
/www/favicon.ico
/www/spiffs.html
/www/js/jquery.js
/www/js/circle-progress.js
/www/js/measurement.js
/www/js/GaugeMeter.js
/www/js/json2html.js
/www/js/knockout-3.5.0.js
/www/js/settings.js
/www/js/jquery.mobile.js
/www/js/sevenSeg.js
/www/js/jquery.json2html.js
/www/js/index.js
/www/js/jquery.treetable.js
/www/css/jquery.mobile.css
/www/css/index.css
/www/css/jquery.treetable.css
/www/index.html
/www/img/ajax-loader.gif
/etc/time_zone
Looking for upload port...
Auto-detected: /dev/ttyUSB0
Uploading .pio/build/release/spiffs.bin
esptool.py v2.6
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP8266EX
Features: WiFi
MAC: 5c:cf:7f:80:17:f8
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 1028096 bytes to 214923...
Wrote 1028096 bytes (214923 compressed) at 0x00300000 in 19.0 seconds (effective 431.8 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
================================== [SUCCESS] Took 22.94 seconds ==================================

Environment    Status    Duration
-------------  --------  ------------
release        SUCCESS   00:00:22.943
debug          IGNORED
================================== 1 succeeded in 00:00:22.943 ==================================
This is the error message:

Code: Select all

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)                                   
                                                                                
load 0x4010f000, len 1384, room 16                                              
tail 8                                                                          
chksum 0x2d                                                                     
csum 0x2d                                                                       
v8b899c12                                                                       
~ld                                                                             
                                                                                
############### Welcome ################                                        
           SmartPower2 v0.6.9                                                   
############# Oct 31 2019 ##############                                        
[display] ready                                                                 
[wait] 5 4 3 2 1                                                                
[store] not exists '/var/utc'                                                   
[psu] store: disabled                                                           
[wifi] mode: ap sta                                                             
[wifi] tpw: 82                                                                  
[wifi] host: smartpower2                                                        
[wifi] dhcp: on                                                                 
[wifi] ssid: ******                                                            
[wifi] setbroadcast2 ->3                                                        
                                                                                
Exception (3):                                                                  
              epc1=0x40223922 epc2=0x00000000 epc3=0x40000f58 excvaddr=0x4002390
                                                                                
                                                                               >
                                                                                
                                                                               t
                                                                               0
Is there anything more I can do?
These users thanked the author paulcrawford for the post:
ytrikoz (Fri Nov 01, 2019 4:42 am)

ytrikoz
Posts: 46
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Fri Nov 01, 2019 4:44 am

paulcrawford wrote:
Fri Nov 01, 2019 3:53 am
I did an update to platformio, downloaded thIs there anything more I can do?
This should have an explanation, I will repeat the same sequence of actions and compare the logs.

Logs for update, upgrade and erase flash. now its blank.

Code: Select all

Microsoft Windows [Version 10.0.18362.449]

C:\Projects\smartpower2>platformio update
Updating contrib-piohome                 @ 3.0.0-beta.3   [Up-to-date]
Updating contrib-pysite                  @ 2.37.191017    [Up-to-date]
Updating tool-pioplus                    @ 2.5.8          [Up-to-date]
Updating tool-unity                      @ 1.20403.0      [Up-to-date]
Updating tool-scons                      @ 3.30101.0      [Up-to-date]
Updating tool-cppcheck                   @ 1.189.0        [Up-to-date]

Platform Manager
================
Platform Espressif 8266
--------
Updating espressif8266                   @ 2.2.3          [Up-to-date]
Updating toolchain-xtensa                @ 2.40802.190218 [Up-to-date]
Updating framework-arduinoespressif8266  @ 2.20502.0      [Up-to-date]
Updating tool-esptool                    @ 1.413.0        [Up-to-date]
Updating tool-esptoolpy                  @ 1.20600.0      [Up-to-date]
Updating tool-mkspiffs                   @ 1.200.0        [Up-to-date]

Platform Espressif 8266 (Stage)
--------
Updating espressif8266                   @ 3500fb2        [Up-to-date]
Updating toolchain-xtensa                @ 2.40802.190218 [Up-to-date]
Updating framework-arduinoespressif8266  @ 14262af        [Up-to-date]
Updating tool-esptool                    @ 1.413.0        [Up-to-date]
Updating tool-esptoolpy                  @ 1.20600.0      [Up-to-date]
Updating tool-mkspiffs                   @ 1.200.0        [Up-to-date]


Library Manager
===============
Library Storage: C:\Users\ytrikoz\.platformio\lib

C:\Projects\smartpower2>platformio upgrade
You're up-to-date!
PlatformIO 4.1.0rc3 is currently the newest version available.

C:\Projects\smartpower2>platformio run --target erase
Processing release (platform: espressif8266; board: nodemcuv2; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 2.2.3 > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: toolchain-xtensa 2.40802.190218 (4.8.2), framework-arduinoespressif8266 2.20502.0 (2.5.2), tool-esptool 1.413.0 (4.13), tool-esptoolpy 1.20600.0 (2.6.0) 
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 34 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <SimpleTimer>
|-- <WebSockets> 2.2.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <Ethernet(esp8266)> 1.0.4
|   |   |-- <SPI> 1.0
|   |-- <SPI> 1.0
|   |-- <Hash> 1.0
|-- <LiquidCrystal> 1.5.0
|   |-- <Wire> 1.0
|-- <ArduinoJson> 6.12.0
|-- <SimpleCLI> 1.0.5
|-- <ESP8266WiFi> 1.0
|-- <mcurses>
|-- <Wire> 1.0
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266NetBIOS> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ArduinoOTA> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266mDNS> 1.2
|   |   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WebServer> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266SSDP> 1.0
|   |-- <ESP8266WiFi> 1.0
Looking for serial port...
Auto-detected: COM3
Erasing...
esptool.py v2.6
Serial port COM3
Connecting....
Chip is ESP8266EX
Features: WiFi
MAC: 5c:cf:7f:1b:00:67
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 18.0s
Hard resetting via RTS pin...
================================================================== [SUCCESS] Took 21.46 seconds ================================================================== 

Environment    Status    Duration
-------------  --------  ------------
release        SUCCESS   00:00:21.462
debug          IGNORED
=================================================================== 1 succeeded in 00:00:21.462 ===================================================================Microsoft Windows [Version 10.0.18362.449]

C:\Projects\smartpower2>platformio update
Updating contrib-piohome                 @ 3.0.0-beta.3   [Up-to-date]
Updating contrib-pysite                  @ 2.37.191017    [Up-to-date]
Updating tool-pioplus                    @ 2.5.8          [Up-to-date]
Updating tool-unity                      @ 1.20403.0      [Up-to-date]
Updating tool-scons                      @ 3.30101.0      [Up-to-date]
Updating tool-cppcheck                   @ 1.189.0        [Up-to-date]

Platform Manager
================
Platform Espressif 8266
--------
Updating espressif8266                   @ 2.2.3          [Up-to-date]
Updating toolchain-xtensa                @ 2.40802.190218 [Up-to-date]
Updating framework-arduinoespressif8266  @ 2.20502.0      [Up-to-date]
Updating tool-esptool                    @ 1.413.0        [Up-to-date]
Updating tool-esptoolpy                  @ 1.20600.0      [Up-to-date]
Updating tool-mkspiffs                   @ 1.200.0        [Up-to-date]

Platform Espressif 8266 (Stage)
--------
Updating espressif8266                   @ 3500fb2        [Up-to-date]
Updating toolchain-xtensa                @ 2.40802.190218 [Up-to-date]
Updating framework-arduinoespressif8266  @ 14262af        [Up-to-date]
Updating tool-esptool                    @ 1.413.0        [Up-to-date]
Updating tool-esptoolpy                  @ 1.20600.0      [Up-to-date]
Updating tool-mkspiffs                   @ 1.200.0        [Up-to-date]


Library Manager
===============
Library Storage: C:\Users\ytrikoz\.platformio\lib

C:\Projects\smartpower2>platformio upgrade
You're up-to-date!
PlatformIO 4.1.0rc3 is currently the newest version available.

C:\Projects\smartpower2>platformio run --target erase
Processing release (platform: espressif8266; board: nodemcuv2; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 2.2.3 > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: toolchain-xtensa 2.40802.190218 (4.8.2), framework-arduinoespressif8266 2.20502.0 (2.5.2), tool-esptool 1.413.0 (4.13), tool-esptoolpy 1.20600.0 (2.6.0) 
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 34 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <SimpleTimer>
|-- <WebSockets> 2.2.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <Ethernet(esp8266)> 1.0.4
|   |   |-- <SPI> 1.0
|   |-- <SPI> 1.0
|   |-- <Hash> 1.0
|-- <LiquidCrystal> 1.5.0
|   |-- <Wire> 1.0
|-- <ArduinoJson> 6.12.0
|-- <SimpleCLI> 1.0.5
|-- <ESP8266WiFi> 1.0
|-- <mcurses>
|-- <Wire> 1.0
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266NetBIOS> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ArduinoOTA> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266mDNS> 1.2
|   |   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WebServer> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266SSDP> 1.0
|   |-- <ESP8266WiFi> 1.0
Looking for serial port...
Auto-detected: COM3
Erasing...
esptool.py v2.6
Serial port COM3
Connecting....
Chip is ESP8266EX
Features: WiFi
MAC: 8888888888
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 18.0s
Hard resetting via RTS pin...
================================================================== [SUCCESS] Took 21.46 seconds ================================================================== 

Environment    Status    Duration
-------------  --------  ------------
release        SUCCESS   00:00:21.462
debug          IGNORED
=================================================================== 1 succeeded in 00:00:21.462 ===================================================================
Last edited by ytrikoz on Fri Nov 01, 2019 6:13 am, edited 1 time in total.

ytrikoz
Posts: 46
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Fri Nov 01, 2019 5:44 am

paulcrawford wrote:
Fri Nov 01, 2019 3:53 am
I did an update to platformio, downloaded thIs there anything more I can do?

Code: Select all

platformio upgrade
i got output
PlatformIO 4.1.0rc3 is currently the newest version available.
yours?
if we have save versions.. i'm updated post with log of upgrade, update and erase. Please, try upgrade... pull last commit and give me a sign.

my flash and first boot log (there is no data on the device right now "[store] not exists '/etc/main' " signals that)

Code: Select all

Configuring upload protocol...
AVAILABLE: espota, esptool
CURRENT: upload_protocol = esptool
Looking for upload port...
Auto-detected: COM3
Uploading .pio\build\release\firmware.bin
esptool.py v2.6
Serial port COM3
Connecting....
Chip is ESP8266EX
Features: WiFi
MAC: xx:xx:xx:xxx
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 459456 bytes to 317734...

Writing at 0x00000000... (5 %)
Writing at 0x00004000... (10 %)
Writing at 0x00008000... (15 %)
Writing at 0x0000c000... (20 %)
Writing at 0x00010000... (25 %)
Writing at 0x00014000... (30 %)
Writing at 0x00018000... (35 %)
Writing at 0x0001c000... (40 %)
Writing at 0x00020000... (45 %)
Writing at 0x00024000... (50 %)
Writing at 0x00028000... (55 %)
Writing at 0x0002c000... (60 %)
Writing at 0x00030000... (65 %)
Writing at 0x00034000... (70 %)
Writing at 0x00038000... (75 %)
Writing at 0x0003c000... (80 %)
Writing at 0x00040000... (85 %)
Writing at 0x00044000... (90 %)
Writing at 0x00048000... (95 %)
Writing at 0x0004c000... (100 %)
Wrote 459456 bytes (317734 compressed) at 0x00000000 in 28.0 seconds (effective 131.1 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
================================================================== [SUCCESS] Took 61.14 seconds ==================================================================
--- Miniterm on COM3  115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
rl␀l��|␀�l�|␂␌␌␌�␌l�␌b|��␂�␒�r�b�␌b��nn�lnn���␌b␜p��lrlrlp�n�␐␂␌␌�␌l␌��␌␌␌b␌n�|␂l�␌␌�b��nn�␀l��l`␂�␒␒nn␌l`␂␎␂nr���n␌␌b␌�␎l␎r��n␌␌b␌�␎l�␂�␂ll�␒�l`␂��n�␂
[store] not exists '/etc/main'  
############### Welcome ################
           SmartPower2 v0.6.9
############# Nov  1 2019 ##############
[display] failed
[wait] 5 4 3 2 1 
[store] not exists '/var/utc'  
[wifi] mode: ap
[wifi] tpw: 82
[wifi] host: smartpower2
[wifi] ip: 192.168.4.1 subnet: 255.255.255.0 gateway: 192.168.4.1 dns:
[wifi] ssid: 
[app] network up (21.93 sec)
[dns] smartpower2.local 192.168.4.1:53
[netbios] smartpower2
[mdns] smartpower2
[ntp] server: pool.ntp.org
[ntp] port: 123
[telnet] port: 23
[update] host: smartpower2
[update] port: 8266
press "enter" to start
[ntp] dns: error
[ntp] request: (IP unset):123
Last edited by ytrikoz on Fri Nov 01, 2019 7:21 am, edited 2 times in total.

ytrikoz
Posts: 46
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Fri Nov 01, 2019 6:51 am

platformio run --target uploadfs

Code: Select all

> Executing task in folder smartpower2: C:\Users\ytrikoz\.platformio\penv\Scripts\platformio.exe run --target uploadfs <

Processing release (platform: espressif8266; board: nodemcuv2; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 2.2.3 > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: toolchain-xtensa 2.40802.190218 (4.8.2), framework-arduinoespressif8266 2.20502.0 (2.5.2), tool-esptool 1.413.0 (4.13), tool-esptoolpy 1.20600.0 (2.6.0), tool-mkspiffs 1.200.0 (2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 34 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <SimpleTimer>
|-- <WebSockets> 2.2.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <Ethernet(esp8266)> 1.0.4
|   |   |-- <SPI> 1.0
|   |-- <SPI> 1.0
|   |-- <Hash> 1.0
|-- <LiquidCrystal> 1.5.0
|   |-- <Wire> 1.0
|-- <ArduinoJson> 6.12.0
|-- <SimpleCLI> 1.0.5
|-- <ESP8266WiFi> 1.0
|-- <mcurses>
|-- <Wire> 1.0
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266NetBIOS> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ArduinoOTA> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266mDNS> 1.2
|   |   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WebServer> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266SSDP> 1.0
|   |-- <ESP8266WiFi> 1.0
Building SPIFFS image from 'data' directory to .pio\build\release\spiffs.bin
/etc/time_zone
/www/css/index.css
/www/css/jquery.mobile.css
/www/css/jquery.treetable.css
/www/favicon.ico
/www/img/ajax-loader.gif
/www/index.html
Chip is ESP8266EX
Features: WiFi
MAC: xxxxxxxxxxxxxx
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 1028096 bytes to 215947...

Writing at 0x00300000... (7 %)
Writing at 0x00304000... (14 %)
Writing at 0x00308000... (21 %)
Writing at 0x0030c000... (28 %)
Writing at 0x00310000... (35 %)
Writing at 0x00314000... (42 %)
Writing at 0x00318000... (50 %)
Writing at 0x0031c000... (57 %)
Writing at 0x00320000... (64 %)
Writing at 0x00324000... (71 %)
Writing at 0x00328000... (78 %)
Writing at 0x0032c000... (85 %)
Writing at 0x00330000... (92 %)
Writing at 0x00334000... (100 %)
Wrote 1028096 bytes (215947 compressed) at 0x00300000 in 19.1 seconds (effective 431.0 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
================================================================== [SUCCESS] Took 24.43 seconds ==================================================================

Environment    Status    Duration
-------------  --------  ------------
release        SUCCESS   00:00:24.430
debug          IGNORED
=================================================================== 1 succeeded in 00:00:24.430 ===================================================================

ytrikoz
Posts: 46
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Fri Nov 01, 2019 6:56 am

now please, give me instructions how to break my device (like your exception). Before that, of couse i tried different variants, but missing something, that's you do, it's working (but i prefered to got error, trust )

Device status:
This second boot (after data part flashed)
dc power connected - it's very important to have power on not only micro-usb while doing all flashing
usb connected
lcd disconnect

after some more time got exception
Exception (28):
epc1=0x4022ed3a epc2=0x00000000 epc3=0x40223795 excvaddr=0x00000000 depc=0x00000000

it's not yours, but maybe it's one code problem, i'll check and fix it.. please, wait for update (git commit).

finally found ... I don’t understand how it worked for me at the same time :( I’ll update it today.


Code: Select all

--- Miniterm on COM3  115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
rl␀l��|␀�l�|␂␌␌␌�␌l�␌b|��␂�␒�r�b�␌b��nn�lnn���␌b␜p��lrlrlp�n�␐␂␌␌�␌l␌��␌␌␌b␌n�|␂l�␌␌�b��nn�␀l��l`␂�␒␒nn␌l`␂␎␂nr���n␌␌b␌�␎l␎r��n␌␌b␌�␎l�␂�␂ll�␒�l`␂��n�␂
############### Welcome ################
           SmartPower2 v0.6.9
############# Nov  1 2019 ##############
[display] failed
[wait] 5 4 3 2 1 
[store] not exists '/var/utc'  
[wifi] mode: ap
[wifi] tpw: 82
[wifi] host: smartpower2
[wifi] ip: 192.168.4.1 subnet: 255.255.255.0 gateway: 192.168.4.1 dns:  
[wifi] ssid:
[app] network up (9.26 sec)
[dns] smartpower2.local 192.168.4.1:53
[netbios] smartpower2
[mdns] smartpower2
[ntp] server: pool.ntp.org
[ntp] port: 123
[telnet] port: 23
[update] host: smartpower2
[update] port: 8266
press "enter" to start       
[ntp] dns: error
[ntp] request: (IP unset):123

ytrikoz
Posts: 46
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Fri Nov 01, 2019 8:14 pm

It works again, I tried to switch modes and connected by telnet, but I do not want to reassure.
Attachments
0.6.9_test.zip
(308.6 KiB) Downloaded 14 times

paulcrawford
Posts: 160
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2 and n2
Has thanked: 19 times
Been thanked: 4 times
Contact:

Re: SmartPower2 alt firmware

Unread post by paulcrawford » Sat Nov 02, 2019 12:16 am

Finally success. I am able to run in wifi 3 and therefore see the web page on my local network. Congratulations.

What was the issue in the end?

First I tried to download the full source code and compile from source using platformio but unfortunately there was a missing file:

Code: Select all

Processing release (platform: espressif8266; board: nodemcuv2; framework: arduino)
-------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 2.2.3 > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: toolchain-xtensa 2.40802.190218 (4.8.2), tool-esptool 1.413.0 (4.13), tool-esptoolpy 1.20600.0 (2.6.0), framework-arduinoespressif8266 2.20502.0 (2.5.2)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 33 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <SimpleTimer>
|-- <WebSockets> 2.2.0
|   |-- <Hash> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <Ethernet(esp8266)> 1.0.4
|   |   |-- <SPI> 1.0
|   |-- <SPI> 1.0
|-- <LiquidCrystal> 1.5.0
|   |-- <Wire> 1.0
|-- <SimpleCLI> 1.0.5
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <mcurses>
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266SSDP> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <Wire> 1.0
|-- <ESP8266WebServer> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ArduinoOTA> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266mDNS> 1.2
|   |   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <ESP8266NetBIOS> 1.0
|   |-- <ESP8266WiFi> 1.0
Compiling .pio/build/release/src/App.cpp.o
Compiling .pio/build/release/src/ArrayBuffer.cpp.o
In file included from include/App.h:5:0,
                 from src/App.cpp:1:
include/ConfigHelper.h:3:25: fatal error: ArduinoJson.h: No such file or directory

*********************************************************************
* Looking for ArduinoJson.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:ArduinoJson.h"
* Web  > https://platformio.org/lib/search?query=header:ArduinoJson.h
*
*********************************************************************

 #include <ArduinoJson.h>
                         ^
compilation terminated.
*** [.pio/build/release/src/App.cpp.o] Error 1
================================== [FAILED] Took 1.20 seconds ==================================

Environment    Status    Duration
-------------  --------  ------------
release        FAILED    00:00:01.198
debug          IGNORED
============================= 1 failed, 0 succeeded in 00:00:01.198 =============================
You probably need to look at this error to fix the source code.

Next I simply uploaded the new firmware.bin from Nov 1, 2019 with:

Code: Select all

sudo esptool.py --chip esp8266 --port /dev/ttyUSB0 --baud 921600 write_flash 0x00000 firmware.bin
esptool.py v2.7
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 5c:cf:7f:80:17:f8
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 457056 bytes to 315976...
Wrote 457056 bytes (315976 compressed) at 0x00000000 in 4.3 seconds (effective 851.7 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
That worked fine and as noted wifi 3 works.

ytrikoz
Posts: 46
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Mon Nov 04, 2019 12:27 am

paulcrawford wrote:
Sat Nov 02, 2019 12:16 am
Finally success. I am able to run in wifi 3 and therefore see the web page on my local network. Congratulations.
What was the issue in the end?
I assume a multifactorial problem (for example, what connection was established earlier than http or telnet) along with obvious errors in the code. But I made conclusions. To exclude repetitions, I will create a "stable" branch (current version) and a development branch. That localize the code that needs attention in case of mistakes.
paulcrawford wrote:
Sat Nov 02, 2019 12:16 am
First I tried to download the full source code and compile from source using platformio but unfortunately there was a missing file:
While no special need ArduinoJson turned off the external dependency. Fixed.

Now finishing syslog client.

paulcrawford
Posts: 160
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2 and n2
Has thanked: 19 times
Been thanked: 4 times
Contact:

Re: SmartPower2 alt firmware

Unread post by paulcrawford » Mon Nov 04, 2019 10:03 am

I downloaded the latest revision of code and compiled with platformio. No errors of course :D

Then did platformio run --target upload to get the new firmware on SP2. That worked fine with the correct time except that the day of the week was reported as tue.

So then I did platformio run --target uploadfs (which of course changed all of my set parameters) and it restarted twice to get going (which must be the new code to revert to previous successful code if there is a failure) but still the day of the week was tue.

Then I reset all my parameters and did config apply. There was some trouble getting to power on but after pressing the button it began to work.

Then finally set a parameter to a wrong value and back to the right value and did config apply. The result was a perfect startup going right to output DC as bootpwr is set to 1 but still the day of the week is tue.

I think there may still be a small problem.

Also on the Home webpage I got the "dull" live values again but copying the URL and pasting it back in seems to have fixed that. I really think there is a small issue there as well as it keeps reappearing on iPadOS 13.2, iOS 13.2, and now this latest on Firefox 70.0 under Ubuntu 18.04 LTS on Parallels Linux on a MacBook Pro.

Anyway you are certainly getting there. Good plan to go to a development version.

ytrikoz
Posts: 46
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Mon Nov 04, 2019 9:43 pm

paulcrawford wrote:
Mon Nov 04, 2019 10:03 am
Anyway you are certainly getting there. Good plan to go to a development version.
- revert config on errors - it's a plan for 0.6.9 - in progress, not done yet. first of all, it will be saving crash reports and the ability to collect them from the device - working on it

so, in short term:
- wrong day of week
- "dull" values - it's could be then webpage loosing websocket connection with the device, it's should reconnecting, if you don't do anything with it, it's still "dull", for a minute or more, until manually reshreshing? Could you press "ctrl+ shift + i" in brower page and see "console" - errors in it.?

paulcrawford
Posts: 160
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2 and n2
Has thanked: 19 times
Been thanked: 4 times
Contact:

Re: SmartPower2 alt firmware

Unread post by paulcrawford » Tue Nov 05, 2019 12:04 am

ytrikoz wrote:
Mon Nov 04, 2019 9:43 pm
- "dull" values - it's could be then webpage loosing websocket connection with the device, it's should reconnecting, if you don't do anything with it, it's still "dull", for a minute or more, until manually reshreshing? Could you press "ctrl+ shift + i" in brower page and see "console" - errors in it.?
I will definitely check the console next time this happens in Firefox or Safari on my Mac.

ytrikoz
Posts: 46
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Thu Nov 07, 2019 7:14 am

draft 0.6.9 (sources only)
# wrong day of week - fixed
# shell history by pressing tab key - fixed

? "overlocked" cpu to 160Mhz (default 80Mhz). It's not even overclock :) only minus - more power consume - but it our case it's not metter and it's twice cpu power too, think so :)
but if you watnt to disable change this line (main.cpp)
void preinit() {
// SYS_CPU_80MHZ
system_update_cpu_freq(SYS_CPU_160MHZ);
}
+ crash reports
When application crashes, a crash report saved on the device’s flash. (Limited to 10 crash reports by 512 bytes each).
Crash reports saved to /err/ folder in binarry format and has naming [n]_[device uptime].
"crash list" - to get list of saved reports (equivalently to the command "ls /err/")
For viewing you should use the command "crash print [name]" ("print [name]" at not fits as it's binnary)
to delete them all: "crash clear" (or "rm /err/[name]" command as it's files).
"crash test" - to get divide by zero crash, if you want.

+ safe boot mode
If boot process not completed with success, next boot will be safe - minimal configuration, only shell commands available, and after safe, will be normal again (or crashes again, if nothing was fixed)

Maybe thought on needs auto reset config in safe (you can do it, or not by shell commands)?

And i want implement firmware rollback scheme (on flash will stored two firmware versions the new one and old).

+ syslog
Just to see how its work with yours syslog server, config parameter "syslog" - ip or dns name of server 514 port hardcoded). On device boot you should get log message.

Maybe thoughts what device events or telemetry to implement sysloging firsts?
These users thanked the author ytrikoz for the post:
odroid (Thu Nov 07, 2019 4:40 pm)

User avatar
mad_ady
Posts: 6888
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 248 times
Been thanked: 181 times
Contact:

Re: SmartPower2 alt firmware

Unread post by mad_ady » Thu Nov 07, 2019 3:20 pm

If syslogging is enabled, all serial output should be sent (after syslog was started).
You could implement various log levels/facilities so that errors leave with error/fatal level, telemetry could be info and debugging could be debug.
Then through a new config option (e.g. logging level info) you would know what messages you need to send.

Since you capture crash data already it's concievable that you can export the crashlog via syslog as well.

ytrikoz
Posts: 46
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Thu Nov 14, 2019 10:42 am

telegram bot soon

User avatar
rooted
Posts: 6924
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 278 times
Been thanked: 71 times
Contact:

Re: SmartPower2 alt firmware

Unread post by rooted » Fri Nov 15, 2019 9:53 pm

ytrikoz wrote:telegram bot soon
That's an interesting choice for monitoring.

ytrikoz
Posts: 46
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 4 times
Been thanked: 10 times
Contact:

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Tue Dec 03, 2019 12:40 pm

If you want you can check this out https://github.com/ytrikoz/JATBot as the library wich i planning to use (wrote it to have full code control, and because did't like others).
I’m simultaneously considering the possibility of using RTOS SDK as a project base.
ps if someone uses, still interested in the project, let me know so that I can prioritize.
These users thanked the author ytrikoz for the post:
rooted (Tue Dec 03, 2019 2:24 pm)

User avatar
rooted
Posts: 6924
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 278 times
Been thanked: 71 times
Contact:

Re: SmartPower2 alt firmware

Unread post by rooted » Tue Dec 03, 2019 2:26 pm

I don't have a smart power 2 but I enjoy seeing all the nice progress you have made in improving the firmware, I wish someone would have improved the original smart power which I do have. I wanted to add Bluetooth UART logging but since many devices I have now are 12v I lost interest.
These users thanked the author rooted for the post:
ytrikoz (Thu Dec 05, 2019 12:18 am)

Post Reply

Return to “Smart Power”

Who is online

Users browsing this forum: No registered users and 1 guest