SmartPower2 alt firmware

paulcrawford
Posts: 183
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2, n2 and n2+
Has thanked: 27 times
Been thanked: 7 times
Contact:

Re: SmartPower2 alt firmware

Post by paulcrawford »

@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: 56
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 5 times
Been thanked: 15 times
Contact:

Re: SmartPower2 alt firmware

Post by ytrikoz »

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: 56
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 5 times
Been thanked: 15 times
Contact:

Re: SmartPower2 alt firmware

Post by ytrikoz »

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 46 times

mad_ady
Posts: 8468
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 578 times
Been thanked: 462 times
Contact:

Re: SmartPower2 alt firmware

Post by mad_ady »

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: 183
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2, n2 and n2+
Has thanked: 27 times
Been thanked: 7 times
Contact:

Re: SmartPower2 alt firmware

Post by paulcrawford »

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 48 times
These users thanked the author paulcrawford for the post:
ytrikoz (Wed Oct 30, 2019 5:02 am)

paulcrawford
Posts: 183
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2, n2 and n2+
Has thanked: 27 times
Been thanked: 7 times
Contact:

Re: SmartPower2 alt firmware

Post by paulcrawford »

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: 183
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2, n2 and n2+
Has thanked: 27 times
Been thanked: 7 times
Contact:

Re: SmartPower2 alt firmware

Post by paulcrawford »

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: 56
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 5 times
Been thanked: 15 times
Contact:

Re: SmartPower2 alt firmware

Post by ytrikoz »

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 58 times
These users thanked the author ytrikoz for the post:
odroid (Wed Oct 30, 2019 11:50 am)

paulcrawford
Posts: 183
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2, n2 and n2+
Has thanked: 27 times
Been thanked: 7 times
Contact:

Re: SmartPower2 alt firmware

Post by paulcrawford »

@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: 56
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 5 times
Been thanked: 15 times
Contact:

Re: SmartPower2 alt firmware

Post by ytrikoz »

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: 183
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2, n2 and n2+
Has thanked: 27 times
Been thanked: 7 times
Contact:

Re: SmartPower2 alt firmware

Post by paulcrawford »

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: 56
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 5 times
Been thanked: 15 times
Contact:

Re: SmartPower2 alt firmware

Post by ytrikoz »

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 42 times
Today i''ll check the project with platformio code analysis tools (new feature) and will post update after that.

paulcrawford
Posts: 183
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2, n2 and n2+
Has thanked: 27 times
Been thanked: 7 times
Contact:

Re: SmartPower2 alt firmware

Post by paulcrawford »

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: 56
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 5 times
Been thanked: 15 times
Contact:

Re: SmartPower2 alt firmware

Post by ytrikoz »

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: 56
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 5 times
Been thanked: 15 times
Contact:

Re: SmartPower2 alt firmware

Post by ytrikoz »

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: 183
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2, n2 and n2+
Has thanked: 27 times
Been thanked: 7 times
Contact:

Re: SmartPower2 alt firmware

Post by paulcrawford »

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: 56
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 5 times
Been thanked: 15 times
Contact:

Re: SmartPower2 alt firmware

Post by ytrikoz »

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: 56
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 5 times
Been thanked: 15 times
Contact:

Re: SmartPower2 alt firmware

Post by ytrikoz »

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: 56
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 5 times
Been thanked: 15 times
Contact:

Re: SmartPower2 alt firmware

Post by ytrikoz »

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: 56
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 5 times
Been thanked: 15 times
Contact:

Re: SmartPower2 alt firmware

Post by ytrikoz »

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: 56
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 5 times
Been thanked: 15 times
Contact:

Re: SmartPower2 alt firmware

Post by ytrikoz »

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 47 times

paulcrawford
Posts: 183
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2, n2 and n2+
Has thanked: 27 times
Been thanked: 7 times
Contact:

Re: SmartPower2 alt firmware

Post by paulcrawford »

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: 56
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 5 times
Been thanked: 15 times
Contact:

Re: SmartPower2 alt firmware

Post by ytrikoz »

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: 183
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2, n2 and n2+
Has thanked: 27 times
Been thanked: 7 times
Contact:

Re: SmartPower2 alt firmware

Post by paulcrawford »

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: 56
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 5 times
Been thanked: 15 times
Contact:

Re: SmartPower2 alt firmware

Post by ytrikoz »

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: 183
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2, n2 and n2+
Has thanked: 27 times
Been thanked: 7 times
Contact:

Re: SmartPower2 alt firmware

Post by paulcrawford »

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: 56
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 5 times
Been thanked: 15 times
Contact:

Re: SmartPower2 alt firmware

Post by ytrikoz »

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)

mad_ady
Posts: 8468
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 578 times
Been thanked: 462 times
Contact:

Re: SmartPower2 alt firmware

Post by mad_ady »

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: 56
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 5 times
Been thanked: 15 times
Contact:

Re: SmartPower2 alt firmware

Post by ytrikoz »

telegram bot soon

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

Re: SmartPower2 alt firmware

Post by rooted »

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

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

Re: SmartPower2 alt firmware

Post by ytrikoz »

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: 7987
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 724 times
Been thanked: 243 times
Contact:

Re: SmartPower2 alt firmware

Post by rooted »

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)

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

Re: SmartPower2 alt firmware

Post by ytrikoz »

0.6.9 - "most stable"
https://github.com/ytrikoz/smartpower2/ ... /tag/0.6.9

web ui: reset total counter, network settings for ap/sta/ap+sta modes, lcd backlight on/off, wifi transmitter strength
telnet and serial connection are independent and can be used at same time.
(if shell not active are showing power supply info)
cli commands:
config diff - show diff between yours and default settings.
wifi, wifi list - wifi scanner (/var/networks)
wol [ip], [mac] or [hostname], [mac]
show - info
home.png
home.png (44.38 KiB) Viewed 4665 times
options.png
options.png (44.78 KiB) Viewed 4665 times
These users thanked the author ytrikoz for the post:
paulcrawford (Tue Dec 31, 2019 12:05 am)

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

Re: SmartPower2 alt firmware

Post by ytrikoz »

prebuilt files
Attachments
spiffs.zip
(192.95 KiB) Downloaded 26 times
firmware.zip
(383.13 KiB) Downloaded 27 times
These users thanked the author ytrikoz for the post (total 2):
odroid (Mon Dec 30, 2019 3:32 pm) • paulcrawford (Tue Dec 31, 2019 12:05 am)

paulcrawford
Posts: 183
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2, n2 and n2+
Has thanked: 27 times
Been thanked: 7 times
Contact:

Re: SmartPower2 alt firmware

Post by paulcrawford »

@ytrikoz

You certainly have been busy lately.

I wanted to build the latest 0.6.9 from source code so I first updated and upgraded platformio:

Code: Select all

Updating tool-scons                      @ 2.20501.190826 [2.20501.191222]
Uninstalling tool-scons @ 2.20501.190826: 	[OK]
CorePackageManager: Installing tool-scons @ 2.20501.191222
tool-scons @ 2.20501.191222 has been successfully installed!

Platform Manager
================
Platform Espressif 8266
--------
Updating espressif8266                   @ 2.2.3          [2.3.2]
Uninstalling espressif8266 @ 2.2.3: 	[OK]
PlatformManager: Installing espressif8266 @ 2.3.2
espressif8266 @ 2.3.2 has been successfully installed!
Updating tool-esptool                    @ 1.413.0        [Up-to-date]
Updating tool-mkspiffs                   @ 1.200.0        [Up-to-date]
Uninstalling framework-arduinoespressif8266 @ 2.20502.0: 	[OK]
Uninstalling tool-esptoolpy @ 1.20600.0: 	[OK]
Uninstalling toolchain-xtensa @ 2.40802.190218: 	[OK]
PackageManager: Installing toolchain-xtensa @ ~2.40802.191122
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
toolchain-xtensa @ 2.40802.191122 has been successfully installed!
PackageManager: Installing tool-esptoolpy @ ~1.20800.0
tool-esptoolpy @ 1.20800.0 has been successfully installed!
PackageManager: Installing framework-arduinoespressif8266 @ ~2.20603.0
Downloading  [####################################]  100%          
Unpacking  [####################################]  100%          
framework-arduinoespressif8266 @ 2.20603.191216 has been successfully installed!


Library Manager
===============
Library Storage: /home/paulcrawford/.platformio/lib

********************************************************************************
There is a new version 4.1.0 of PlatformIO available.
Please upgrade it via `platformio upgrade` or `pip install -U platformio` command.
Changes: https://docs.platformio.org/en/latest/history.html
********************************************************************************

Code: Select all

Please wait while upgrading PlatformIO ...
PlatformIO has been successfully upgraded to 4.1.0
Release notes: https://docs.platformio.org/en/latest/history.html
Then I did platformio run but got an error:

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.3.2 > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: toolchain-xtensa 2.40802.191122 (4.8.2), tool-esptool 1.413.0 (4.13), tool-esptoolpy 1.20800.0 (2.8.0), framework-arduinoespressif8266 2.20603.191216 (2.6.3)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Looking for ArduinoJson library in registry
Found: https://platformio.org/lib/show/64/ArduinoJson
LibraryManager: Installing id=64
Unpacking  [####################################]  100%          
ArduinoJson @ 6.13.0 has been successfully installed!
Looking for ESP Async WebServer library in registry
Found: https://platformio.org/lib/show/306/ESP Async WebServer
LibraryManager: Installing id=306
ESP Async WebServer @ 1.2.3 has been successfully installed!
Installing dependencies
Looking for ESPAsyncTCP library in registry
Found: https://platformio.org/lib/show/305/ESPAsyncTCP
LibraryManager: Installing id=305
ESPAsyncTCP @ 1.2.2 has been successfully installed!
Looking for AsyncTCP library in registry
Found: https://platformio.org/lib/show/1826/AsyncTCP
LibraryManager: Installing id=1826
AsyncTCP @ 1.1.1 has been successfully installed!
Looking for Hash library in registry
Warning! Library `{u'platforms': [u'espressif8266'], u'name': u'Hash'}` has not been found in PlatformIO Registry.
You can ignore this message, if `{u'platforms': [u'espressif8266'], u'name': u'Hash'}` is a built-in library (included in framework, SDK). E.g., SPI, Wire, etc.
Looking for LiquidCrystal library in registry
Conflict: More than one library has been found by request {"requirements": null, "name": "LiquidCrystal"}:
LiquidCrystal
=============
#ID: 136
Automatically chose the first available library (use `--interactive` option to make a choice)
LiquidCrystal Library is faster and extensable, compatible with the original LiquidCrystal library

Keywords: lcd, hd44780
Compatible frameworks: Arduino
Compatible platforms: Atmel AVR, Espressif 32, Espressif 8266
Authors: F Malpartida

LiquidCrystal
=============
#ID: 887
Allows communication with alphanumerical liquid crystal displays (LCDs).

Keywords: display
Compatible frameworks: Arduino
Compatible platforms: Atmel AVR, Atmel SAM, Espressif 32, Espressif 8266, Intel ARC32, Microchip PIC32, Nordic nRF51, Nordic nRF52, ST STM32, Teensy, TI MSP430
Authors: Arduino, Adafruit

Found: https://platformio.org/lib/show/136/LiquidCrystal
LibraryManager: Installing id=136
LiquidCrystal @ 1.5.0 has been successfully installed!
Looking for SimpleCLI library in registry
Found: https://platformio.org/lib/show/5606/SimpleCLI
LibraryManager: Installing id=5606
SimpleCLI @ 1.0.5 has been successfully installed!
Found 34 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ArduinoJson> 6.13.0
|-- <ESP Async WebServer> 1.2.3
|   |-- <ESPAsyncTCP> 1.2.2
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <Hash> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <ArduinoJson> 6.13.0
|-- <LiquidCrystal> 1.5.0
|   |-- <Wire> 1.0
|-- <SimpleCLI> 1.0.5
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266NetBIOS> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ArduinoOTA> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266mDNS> 1.2
|   |   |-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <ESPAsyncTCP> 1.2.2
|   |-- <ESP8266WiFi> 1.0
|-- <Wire> 1.0
Compiling .pio/build/release/src/App.cpp.o
Compiling .pio/build/release/src/Cli/Cli.cpp.o
In file included from include/Modules/Host.h:3:0,
                 from include/App.h:3,
                 from include/Global.h:3,
                 from src/Cli/Cli.cpp:6:
include/Core/Module.h:9:27: fatal error: Utils/FsUtils.h: No such file or directory
 #include "Utils/FsUtils.h"
                           ^
compilation terminated.
In file included from include/Modules/Host.h:3:0,
                 from include/App.h:3,
                 from src/App.cpp:1:
include/Core/Module.h:9:27: fatal error: Utils/FsUtils.h: No such file or directory
 #include "Utils/FsUtils.h"
                           ^
compilation terminated.
*** [.pio/build/release/src/Cli/Cli.cpp.o] Error 1
*** [.pio/build/release/src/App.cpp.o] Error 1
========================= [FAILED] Took 14.44 seconds =========================

Environment    Status    Duration
-------------  --------  ------------
release        FAILED    00:00:14.440
test           IGNORED
==================== 1 failed, 0 succeeded in 00:00:14.440 ====================
Can you please advise what I need to do to get Utils/FsUtils.h?

Thanks

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

Re: SmartPower2 alt firmware

Post by ytrikoz »

paulcrawford wrote:
Mon Dec 30, 2019 11:54 pm
Can you please advise what I need to do to get Utils/FsUtils.h?
Thanks
Please, change "Utils/FsUtils.h" to "Utils/FSUtils.h" in "Core/Module.h"
These users thanked the author ytrikoz for the post:
paulcrawford (Wed Jan 01, 2020 11:45 am)

paulcrawford
Posts: 183
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2, n2 and n2+
Has thanked: 27 times
Been thanked: 7 times
Contact:

Re: SmartPower2 alt firmware

Post by paulcrawford »

@rooted
rooted wrote:
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.
If you get a smart power 2, it is really not that difficult to change the SMD resistor noted in the wiki so that you can use 12V output. I am running my N2 on my SP2 now.

@ytrikoz,

I did finally get the source code to compile and flashed both upload and uploadfs to my sp2. Once I set all of my parameters everything works perfectly:
  • 1. No more "dull" images
    2. No requirement to refresh the page after being on another page or not using the device
    3. Much better data arrangement with all values together
There are still a few issues though:
First what is "phy" really supposed to be?

PNG image.png
PNG image.png (317.48 KiB) Viewed 4518 times
One the Home page below:

1. For the "current" display, while the symbol for current is calculations is "I" by convention, this is a display of a value so the label should be the units which would be "A" just the same as voltage, power and energy values displayed.
2. The displayed values in the seven segment part are not all the same width. They end at the same point on the right but begin at different points on the left. I believe this offset is caused by the labels ("V", "W", "I", "Wh") being proportional space fonts. Can you change the layout to fix this?
3. It might be better to have the order as V, A, W, Wh rather than the present V, W, I (A), Wh.

PNG image 2.png
PNG image 2.png (458.95 KiB) Viewed 4518 times
On the development console show below there is one error and several unknowns. Perhaps you can determine if any of these are significant:

sp2 ss.png
sp2 ss.png (279.41 KiB) Viewed 4518 times
There were a two more "case sensitive" issues on compiling the code in Linux. The first was with "Looptiming.h" and the second was with "Powerlog.h". You should likely go through all of the occurrences of these header files and get the case corrected. Once I corrected them the compile worked fine.

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

Re: SmartPower2 alt firmware

Post by ytrikoz »

paulcrawford wrote:
Sat Jan 04, 2020 1:18 am
There are still a few issues though:
1. First what is "phy" really supposed to be?
One the Home page below:
2. For the "current" display, while the symbol for current is calculations is "I" by convention, this is a display of a value so the label should be the units which would be "A" just the same as voltage, power and energy values displayed.
3. The displayed values in the seven segment part are not all the same width. They end at the same point on the right but begin at different points on the left. I believe this offset is caused by the labels ("V", "W", "I", "Wh") being proportional space fonts. Can you change the layout to fix this?
4. It might be better to have the order as V, A, W, Wh rather than the present V, W, I (A), Wh.
5. There were a two more "case sensitive" issues on compiling the code in Linux. The first was with "Looptiming.h" and the second was with "Powerlog.h". You should likely go through all of the occurrences of these header files and get the case corrected. Once I corrected them the compile worked fine.
Thank you for constructive and concrete comments, should be fixed in last commit (already in the repo). If (after uploading spiffs and firmware updates), web page seems doesnt't changed - press "ctrl + f5" in browser for hard page reload.
paulcrawford wrote:
Sat Jan 04, 2020 1:18 am
On the development console show below there is one error and several unknowns. Perhaps you can determine if any of these are significant:
It's showing parameters which still unimplemented on web admin page, it's ok.
These users thanked the author ytrikoz for the post:
paulcrawford (Sat Jan 04, 2020 2:23 am)

paulcrawford
Posts: 183
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2, n2 and n2+
Has thanked: 27 times
Been thanked: 7 times
Contact:

Re: SmartPower2 alt firmware

Post by paulcrawford »

All of the issues I described are now fixed.

Thank you very much for the excellent firmware and quick turnaround on the issues. I am really pleased with the result.

paulcrawford
Posts: 183
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2, n2 and n2+
Has thanked: 27 times
Been thanked: 7 times
Contact:

Re: SmartPower2 alt firmware

Post by paulcrawford »

One small problem, on Safari under MacOS and Firefox under Ubuntu a numeral “1” sometimes appears in the left most SS digit for Wh, e.g. while the lcd on the sp2 shows 30.52, the two browsers show 130.52. Doing a page refresh in both browsers clears the problem. With Safari under iOS on an iPhone and under iPadOS on an iPad I have not seen this occurring.

I used to see this behaviour in the versions before 0.6.9 as well so I think it is a long standing issue.

Edit: right now the iPhone shows 118.0, agreeing with the LCD, while the Mac and Ubuntu show 1118.0

Edit2: on MacOS Safari the ampere value on the ss has gone to red from green (see below). A refresh changed it back to green. No change of colour for Firefox in Ubuntu although there was an additional "1" in the leading position which again was removed with a refresh.

red A.png
red A.png (63.21 KiB) Viewed 4390 times

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

Re: SmartPower2 alt firmware

Post by ytrikoz »

paulcrawford wrote:
Sat Jan 04, 2020 11:42 pm
...
Edit2: on MacOS Safari the ampere value on the ss has gone to red from green (see below). A refresh changed it back to green. No change of colour for Firefox in Ubuntu although there was an additional "1" in the leading position which again was removed with a refresh.
...
I will try to localize the problem. Do I understand correctly that the developer console does not accompany the appearance of an imaginary "1" with errors?

And I wanted to hear your opinion about this feature. Suppose we set the minimum level of consumption - preserving it for a certain time will mean for SP2 to completely disconnect the load and go to standby mode - as waiting for wol packet to power on?

paulcrawford
Posts: 183
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2, n2 and n2+
Has thanked: 27 times
Been thanked: 7 times
Contact:

Re: SmartPower2 alt firmware

Post by paulcrawford »

ytrikoz wrote:
Tue Jan 14, 2020 11:30 am
I will try to localize the problem. Do I understand correctly that the developer console does not accompany the appearance of an imaginary "1" with errors?
Sorry I have not run the console when there has been an imaginary "1". Next time it occurs I will look at the console.

On the red ss for A issue I do have some useful information. I noticed that if a new tab or window is opened for the web page on either MacOS Safari or Ubuntu Firefox the A reading is red. In both cases a page refresh changes it to lime. Here are the screen shots:

This is MacOS with red A
macos style sheet console.png
macos style sheet console.png (358.55 KiB) Viewed 4229 times
This MacOS with lime A after refresh
macos lime A after refresh.png
macos lime A after refresh.png (361.91 KiB) Viewed 4229 times
This is Ubuntu with red A
ubuntu style sheet console.png
ubuntu style sheet console.png (257.63 KiB) Viewed 4229 times
This is Ubuntu with lime A after refresh
ubuntu lime A after refresh.png
ubuntu lime A after refresh.png (579.39 KiB) Viewed 4229 times
And I wanted to hear your opinion about this feature. Suppose we set the minimum level of consumption - preserving it for a certain time will mean for SP2 to completely disconnect the load and go to standby mode - as waiting for wol packet to power on?
This feature will likely be a benefit to some users, but in my use case the N2 runs 24/7 since it is monitoring several systems so I would not use the disconnect ability.

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

Re: SmartPower2 alt firmware

Post by ytrikoz »

paulcrawford wrote:
Thu Jan 16, 2020 4:23 am
Sorry I have not run the console when there has been an imaginary "1". Next time it occurs I will look at the console.
Do you have the same problem with "green" regardless of the status of the device power switch? I mean you are connecting to already "power on" or stayed "power off" sp2?
Ubuntu - Firefox?

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

Re: SmartPower2 alt firmware

Post by ytrikoz »

paulcrawford wrote:
Thu Jan 16, 2020 4:23 am
This feature will likely be a benefit to some users, but in my use case the N2 runs 24/7 since it is monitoring several systems so I would not use the disconnect ability.
What about syslog, did you try to set syslog server or do not use it?

paulcrawford
Posts: 183
Joined: Tue May 10, 2016 11:51 am
languages_spoken: english
ODROIDs: c2, n2 and n2+
Has thanked: 27 times
Been thanked: 7 times
Contact:

Re: SmartPower2 alt firmware

Post by paulcrawford »

ytrikoz wrote:
Thu Jan 16, 2020 12:17 pm

Do you have the same problem with "green" regardless of the status of the device power switch? I mean you are connecting to already "power on" or stayed "power off" sp2?
Ubuntu - Firefox?
Since I need power for my N2 24/7 I never use the device power switch. I will move the power output to another N2 that can be shut down and try using the power switch.
ytrikoz wrote:
Thu Jan 16, 2020 12:19 pm
What about syslog, did you try to set syslog server or do not use it?
I have not used the syslog server.

I did get an instance today of the numeral "1" showing up in the left most position on the SS display. The correct value is 1016 Wh but MacOS Safari is showing 11016 Wh. I am not sure when this occurred but it could have been at the change from 999 to 1000. I have the javascript console running on the page now but I am not sure what to look at. Can you please advise on what you would like to see?

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

Re: SmartPower2 alt firmware

Post by ytrikoz »

paulcrawford wrote:
Tue Jan 21, 2020 5:23 am
I did get an instance today of the numeral "1" showing up in the left most position on the SS display. The correct value is 1016 Wh but MacOS Safari is showing 11016 Wh. I am not sure when this occurred but it could have been at the change from 999 to 1000. I have the javascript console running on the page now but I am not sure what to look at. Can you please advise on what you would like to see?
Try last commit it's for finding this bug only (sorry but i can't start new dev branch as going to... couse I forked project and only the hardkernel could) so after "1" problem happend, try to find some not normally expected data in yours console.
Also if you are right with "999 to 1000", you can set wh manually nearest that values and wait some time, or/and repeat several times till know exactly.

PS Ubunty - Firefox? I tried to reproduce but with no result, yet.

Console output should something like, every 10 sec
index.js:81 V range from 5.004 to 5.007
index.js:81 A range from 0.088 to 0.091
index.js:81 W range from 0.439 to 0.454
index.js:81 A range from 0.087 to 0.093

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

Re: SmartPower2 alt firmware

Post by ytrikoz »

https://www.crowdsupply.com/anavi-techn ... etails-top
just overtook his time, would be a 12v jumper, here's the led controller :)

lsc1117
Posts: 194
Joined: Thu Aug 22, 2013 12:46 am
languages_spoken: english
Location: South Korea
Has thanked: 0
Been thanked: 17 times
Contact:

Re: SmartPower2 alt firmware

Post by lsc1117 »

Hi ytrikoz,

I want to build your source code with platformio.
But there is no platformio.ini file in your repository.
How can I build your source code?

Thank you.

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

Re: SmartPower2 alt firmware

Post by ytrikoz »

lsc1117 wrote:
Fri Feb 28, 2020 6:49 pm
Hi ytrikoz,

I want to build your source code with platformio.
But there is no platformio.ini file in your repository.
How can I build your source code?

Thank you.
it's hidden in the project root "code" folder :)

lsc1117
Posts: 194
Joined: Thu Aug 22, 2013 12:46 am
languages_spoken: english
Location: South Korea
Has thanked: 0
Been thanked: 17 times
Contact:

Re: SmartPower2 alt firmware

Post by lsc1117 »

Oh, I found it.
Thanks. :)

Post Reply

Return to “Smart Power”

Who is online

Users browsing this forum: No registered users and 1 guest