SmartPower2 alt firmware

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

SmartPower2 alt firmware

Unread post by ytrikoz » Wed Jun 19, 2019 8:03 pm

Hi! I am finishing my home project - firmware for smartpower2, it is based on v1.5 with several new function sta mode, captiva, ndns, ssdp, ntp, logging to flash or rsyslog, and CLI for telnet, serial console and http connection.
For example, this is a serial console log with some of them executed:

Code: Select all

[lcd] + [boot] wait 4 3 2 1 
[spiffs] 571.12KB / 934.88KB [config] wifi:1, ssid:SmartPower2, passwd:12345678, dhcp:1, ipaddr:192.168.4.1, netmask:255.255.255.0, gateway:192.168.4.1, dns:192.168.4.1, voltage:5.0, pwrmode:0, login:, webpass: 
[ap] success [
[system] service +[web] +[telnet] +[captive] +[mdns] +[ntp] +[cli] 
[http] 192.168.4.1:80 
[telnet] 192.168.4.1:23 
[boot] 00:00:08 
[system] power off 
system uptime 
> 00:00:29 
system status
> loop: 48ms 9925/sec, heap: 39.70KB 0.33% 
config passwd 87654321 
> passwd changed 
show config passwd
> 87654321 
system restart
> restart in 5 4 3 2 1
At this moment, available commands are:
help
show [item]
system [command] [param]
config [param] [value]
To change configuration, do some system stuff, save config to flash, restart, power on, off, etc.
If you interested and want some features for yours smartpower2, you are welcome to share your request in this topic. Or you could flash yours smartpower2 with this firmware for some beta testing.
Also needs help with english terms in UI.

PS sorry for broken english
Attachments
1.png
1.png (191.98 KiB) Viewed 2554 times
3.png
3.png (174.89 KiB) Viewed 2556 times
2.png
2.png (153.54 KiB) Viewed 2556 times

User avatar
odroid
Site Admin
Posts: 32472
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 175 times
Been thanked: 343 times
Contact:

Re: SmartPower2 alt firmware

Unread post by odroid » Wed Jun 19, 2019 8:54 pm

Great improvement.
It looks much better than our official firmware. :oops:

Can you please share the firmware binary and source code?
We are willing to test it from early next week.

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Wed Jun 19, 2019 11:43 pm

odroid wrote:
Wed Jun 19, 2019 8:54 pm
Great improvement.
It looks much better than our official firmware. :oops:
Can you please share the firmware binary and source code?
We are willing to test it from early next week.
Yes of course, but i needs some more time to make code public (don't want to blush :)). if you send me (PM) some github account, i could add it to private repo, if you don't mind.
platformio + vscode.

User avatar
odroid
Site Admin
Posts: 32472
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 175 times
Been thanked: 343 times
Contact:

Re: SmartPower2 alt firmware

Unread post by odroid » Thu Jun 20, 2019 12:31 pm

Thanks!
My colleague's github account : leeseungcheol
In fact, he was one of key developers who made the SmartPower2 hardware as well as software. ;)

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Thu Jun 20, 2019 8:18 pm

odroid wrote:
Thu Jun 20, 2019 12:31 pm
Thanks!
My colleague's github account : leeseungcheol
In fact, he was one of key developers who made the SmartPower2 hardware as well as software. ;)
just added his account to https://github.com/ytrikoz/smartpower2

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

Re: SmartPower2 alt firmware

Unread post by lsc1117 » Mon Jun 24, 2019 10:36 am

Hi,
The smartpower2 you upgraded is awesome!
Improved UI and useful features!

I've added an issue to your smartpower2 repository.
I think there is no "consts.h" file in my environment.
Please check the issue.
https://github.com/ytrikoz/smartpower2/issues/1

Thank you.

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Sat Jun 29, 2019 4:54 am

If you are ready for alpha testing, you can try https://github.com/ytrikoz/smartpower2/tree/develop (develop branch is active) or upload prebuilt binaries https://github.com/ytrikoz/smartpower2/releases. Issues are welcome.

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

Re: SmartPower2 alt firmware

Unread post by lsc1117 » Fri Jul 26, 2019 10:01 am

Sorry, too late reply.

When I compile your smartpower2, I got the including errors.
Can you check this?
build_error.txt
(4.08 KiB) Downloaded 17 times
I tried to solve the error by renaming files but the other error occurred.

Thank you.

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Sat Jul 27, 2019 6:59 am

lsc1117 wrote:
Fri Jul 26, 2019 10:01 am
I tried to solve the error by renaming files but the other error occurred.
last prebuilt and sources, now there
https://github.com/ytrikoz/smartpower2/ ... /tag/0.6.2
if some one, needs some feature and can resist some bugs, as i said before, you are welcome - just write whats you need :)

Code: Select all

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

Processing smartkernel2 (platform: espressif8266; framework: arduino; board: nodemcuv2)
--------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 2.2.2 > 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
Looking for Simpletimer, library in registry
Found: https://platformio.org/lib/show/419/SimpleTimer
LibraryManager: Installing id=419
SimpleTimer @ b30890b8f7 is already installed
Looking for WebSockets, library in registry
Found: https://platformio.org/lib/show/549/WebSockets
LibraryManager: Installing id=549
WebSockets @ 2.2.0 is already installed
Looking for ArduinoJson, library in registry
Found: https://platformio.org/lib/show/64/ArduinoJson
LibraryManager: Installing id=64
ArduinoJson @ 6.11.3 is already installed
Found 36 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <LiquidCrystal_I2C>
|   |-- <Wire> 1.0
|-- <SimpleCLI> 1.0.3
|-- <ESP8266WebServer> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ArduinoOTA> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266mDNS> 1.2
|   |   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <ESP8266SSDP> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
|-- <Wire> 1.0
|-- <SimpleTimer>
|-- <ESP8266NetBIOS> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <mcp4652>
|   |-- <Wire> 1.0
|-- <ArduinoJson> 6.11.3
|-- <WebSockets> 2.2.0
|   |-- <Hash> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <Ethernet(esp8266)> 1.0.4
|   |   |-- <SPI> 1.0
|   |-- <SPI> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <mcurses>
Retrieving maximum program size .pio\build\smartkernel2\firmware.elf
Checking size .pio\build\smartkernel2\firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [====      ]  40.8% (used 33444 bytes from 81920 bytes)
PROGRAM: [====      ]  41.4% (used 432622 bytes from 1044464 bytes)
======================================================= [SUCCESS] Took 3.37 seconds =======================================================

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

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

Re: SmartPower2 alt firmware

Unread post by lsc1117 » Wed Jul 31, 2019 4:59 pm

I have uploaded your firmware and spiffs.
And I need some example for AP or STA or AP+STA.
I think the default mode of SP2 is STA because I can't find my SP2's SSID.
How can I turn on AP mode?

Thank you.

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Thu Aug 01, 2019 1:00 am

Default mode is ap. I include prebuild hw binnaries (last sources at git) and erase, flash and first run logs. You should get same results or something strange happining.
https://github.com/ytrikoz/smartpower2/ ... o/prebuilt
esptool.py v2.6
Serial port COM15
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 15.4s
Hard resetting via RTS pin...
...
Uploading .pio\build\smartkernel2\spiffs.bin
esptool.py v2.6
Serial port COM15
Connecting....
Chip is ESP8266EX
Features: WiFi
MAC: 5c:cf:7f:1b:00:67
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 1028096 bytes to 216395...
Wrote 1028096 bytes (216395 compressed) at 0x00300000 in 19.2 seconds (effective 428.0 kbit/s)...
Hash of data verified.
...
Linking .pio\build\smartkernel2\firmware.elf
Retrieving maximum program size .pio\build\smartkernel2\firmware.elf
Checking size .pio\build\smartkernel2\firmware.elf
Building .pio\build\smartkernel2\firmware.bin
Memory Usage -> http://bit.ly/pio-memory-usage
DATA: [==== ] 41.0% (used 33592 bytes from 81920 bytes)
PROGRAM: [==== ] 41.5% (used 433170 bytes from 1044464 bytes)
Creating BIN file ".pio\build\smartkernel2\firmware.bin" using ".pio\build\smartkernel2\firmware.elf"
Configuring upload protocol...
AVAILABLE: espota, esptool
CURRENT: upload_protocol = esptool
Looking for upload port...
Auto-detected: COM15
Uploading .pio\build\smartkernel2\firmware.bin
esptool.py v2.6
Serial port COM15
Connecting....
Chip is ESP8266EX
Features: WiFi
MAC: 5c:cf:7f:1b:00:67
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 437328 bytes to 304153...
Wrote 437328 bytes (304153 compressed) at 0x00000000 in 26.9 seconds (effective 130.2 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
==================================================================== [SUCCESS] Took 34.17 seconds ====================================================================
--- Miniterm on COM15 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�␂
[wait] 3 2 1
[reset] reason: External System
[reset] info: Fatal exception:0 flag:6 (EXT_SYS_RST) epc1:0x00000000 epc2:0x00000000 epc3:0x00000000 excvaddr:0x00000000 depc:0x00000000
[lcd] ready
[clock] timezone 10800
[clock] backup interval 3600
[clock] restore failed
[clock] set 1564597338
[psu] output voltage 5.00
[psu] power is off
#######################################
SmartPower2 v0.6.3(Jul 31 2019)
#######################################
[wifi] network up
[telnet] port 23 success
[update] smartpower2:8266
[http] /www <- 192.168.4.1:80(81)
[dns] * -> 192.168.4.1:53
[mdns] ready
[netbios] ready

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

Re: SmartPower2 alt firmware

Unread post by lsc1117 » Fri Aug 02, 2019 3:01 pm

Thank you for the logs.

I have uploaded your latest firmware and spiffs.
I got the same serial logs as you.
log_sp2.png
log_sp2.png (51.81 KiB) Viewed 2230 times
After connecting my Smartpower2 via WiFi, when I access the SmartPower2 via a web browser, I got the "File not found" error.
pic_ps2.png
pic_ps2.png (22.62 KiB) Viewed 2230 times

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Sat Aug 03, 2019 4:04 am

lsc1117 wrote:
Fri Aug 02, 2019 3:01 pm
Thank you for the logs.
After connecting my Smartpower2 via WiFi, when I access the SmartPower2 via a web browser, I got the "File not found" error.
Just tried this scenario , everything seems to be correct.
Once more try, please, with 0.6.4? Also in last commit i include firmware064_debug.bin ( was builded with uncommented defines DEBUG_WIRELESS DEBUG_NTP DEBUG_TELNET DEBUG_WEBSOCKET in debug.h - to make log more verbose).
With debug build i get this output.
PS Thank you for your time.

Code: Select all

[wait] 3 2 1
[reset] reason: External System
[reset] info: Fatal exception:0 flag:6 (EXT_SYS_RST) epc1:0x00000000 epc2:0x00000000 epc3:0x00000000 excvaddr:0x00000000 depc:0x00000000
[lcd] ready
[clock] system time 20:12:24
[psu] output voltage 5.00
[psu] power is off
#######################################
    SmartPower2 v0.6.4(Aug  2 2019)
#######################################
[wifi] mode 2 tpw 82 hostname smartpower2
[wifi] ap ssid SmartPower2 ipaddr 192.168.4.1 success
[wifi] network up
[telnet] port 23 success
[update] smartpower2:8266
[http] /www <- 192.168.4.1:80(81)
[dns] * -> 192.168.4.1:53
[mdns] ready
[netbios] ready
[http] /www/index.html text/html 10.98KB
[http] #0 connected
[http] #0 unhandled 10
[http] #0 <- p1
[http] #0 -> o1
[http] #0 -> m0

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

Re: SmartPower2 alt firmware

Unread post by lsc1117 » Fri Aug 09, 2019 2:34 pm

Thank you for the debug firmware.
It works well. And how can I use the "AP+STA" mode?
I changed the wifi mode from AP to "AP + STA" in "Options" tab.
And I inputted the SSID and the password of my AP then, there is no other button about wifi. So I restarted my SP2. After that, I can't access my SP2 via the web page.
I think the other function is okay. But I don't know how to use the "AP+STA" mode.

And I create a PR on your repository. Please review it.
Thank you.

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Sat Aug 17, 2019 4:29 am

lsc1117 wrote:
Fri Aug 09, 2019 2:34 pm
And I create a PR on your repository. Please review it.
Thank you.
Thanks for RP, all files renamed with first capitals (except main.cpp), can you try to build last sources on linux platform for check?
In 0.6.5 (prebuilt available) you got power log and displaying graph-plot on lcd. Also can regulate ina231 averaging.
New shell commands power status, power log , power avg, plot.
AP+STA - will work in 0.6.6 (i hope), i'll write some tips how to setup this mode.

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

Re: SmartPower2 alt firmware

Unread post by lsc1117 » Mon Aug 19, 2019 12:22 pm

I have got the errors about "platformio.ini".
It occurred because of the following commit.
https://github.com/ytrikoz/smartpower2/ ... 6561c993b4

And still, the filename and the Included name do not match.
For example, the file name is "NTPClient.h" but including name is "NtpClient.h" in the "src/NTPClient.cpp".
A lot of files are like that...

And I hope that your commits merge to the hardkernel repository.
Many people will need those functions, logs, plots, AP+STA and etc.

Thanks.

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Mon Aug 19, 2019 8:29 pm

lsc1117 wrote:
Mon Aug 19, 2019 12:22 pm
I have got the errors about "platformio.ini".
https://github.com/ytrikoz/smartpower2/ ... 6561c993b4
What the error you got? I include build log for last commit (https://github.com/ytrikoz/smartpower2/ ... e467c0890b)/
This changes include stage and stable build options for trying use last arduino sdk wich more stable (even stage version). https://github.com/platformio/platform-espressif8266
Did you try to "clean" before building? Also i change one dependency (lcd library). The new one, much faster, 55ms vs 36ms on full screen redraw, when http transferring files on page loading it's substantially.
lsc1117 wrote:
Mon Aug 19, 2019 12:22 pm
And still, the filename and the Included name do not match.
I can "freeze" creating and renaming files for your new PR (if you don't mind, could you?), and apply it (last was "too late", i did too much refactoring at that moment and i could't merge it). The Windows environment is case insensitive :(
Waiting for your answer.
Thanks!

PS In near future my commits will be more focused, it's new lang, ide, sdk for me and i trying different styles and code patterns, so many modules got changes and renaming. But the structure of the projects is almost stabilized.

Code: Select all

> Executing task in folder smartpower2: platformio.exe run <

Processing stable (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.2 > 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 34 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <SimpleTimer>
|-- <WebSockets> 2.2.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <SPI> 1.0
|   |-- <Hash> 1.0
|   |-- <Ethernet(esp8266)> 1.0.4
|   |   |-- <SPI> 1.0
|-- <LiquidCrystal> 1.5.0
|   |-- <Wire> 1.0
|-- <ArduinoJson> 6.11.4
|-- <SimpleCLI> 1.0.4
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266SSDP> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <ESP8266WebServer> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <Wire> 1.0
|-- <ESP8266NetBIOS> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ArduinoOTA> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266mDNS> 1.2
|   |   |-- <ESP8266WiFi> 1.0
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
|-- <mcurses>
Retrieving maximum program size .pio\build\stable\firmware.elf
Checking size .pio\build\stable\firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [====      ]  41.7% (used 34152 bytes from 81920 bytes)
PROGRAM: [====      ]  42.5% (used 443572 bytes from 1044464 bytes)
==================================================================== [SUCCESS] Took 3.42 seconds ====================================================================

Processing stage (platform: https://github.com/platformio/platform-espressif8266.git#feature/stage; 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 (Stage) 2.3.0-alpha.1 #c2bae9e > 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 6dd8474
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 35 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <SimpleTimer>
|-- <WebSockets> 2.2.0
|   |-- <SPI> 1.0
|   |-- <Ethernet(esp8266)> 1.0.4
|   |   |-- <SPI> 1.0
|   |-- <Hash> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <LiquidCrystal> 1.5.0
|   |-- <Wire> 1.0
|-- <ArduinoJson> 6.11.4
|-- <SimpleCLI> 1.0.4
|-- <ESP8266NetBIOS> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WebServer> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <ArduinoOTA> 1.0
|   |-- <ESP8266mDNS> 1.2
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266SSDP> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <Wire> 1.0
|-- <mcurses>
Retrieving maximum program size .pio\build\stage\firmware.elf
Checking size .pio\build\stage\firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [====      ]  42.1% (used 34492 bytes from 81920 bytes)
PROGRAM: [====      ]  43.1% (used 450268 bytes from 1044464 bytes)
==================================================================== [SUCCESS] Took 3.48 seconds ====================================================================

Environment    Status    Time
-------------  --------  ---------
stable         SUCCESS   3 seconds
stage          SUCCESS   3 seconds
===================================================================== 2 succeeded in 7 seconds =====================================================================

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Wed Aug 21, 2019 8:27 am

Wifi "ap sta" mode now works, see release notes. After enabling it, you can connect to the device from both networks.
Prebuilt firmware included.
https://github.com/ytrikoz/smartpower2/ ... /tag/0.6.6

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

Re: SmartPower2 alt firmware

Unread post by lsc1117 » Fri Aug 23, 2019 5:56 pm

I attached a log when I build your source code v0.6.6.
Please review this log.

Code: Select all

Processing stable (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 > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz 80KB RAM (4MB Flash)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ESP8266WiFi> 1.0
|-- <ArduinoOTA> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266mDNS> 1.2
|   |   |-- <ESP8266WiFi> 1.0
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WebServer> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266SSDP> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266NetBIOS> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <mcurses>
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <Wire> 1.0
Compiling .pioenvs/stable/src/ConfigHelper.cpp.o
Compiling .pioenvs/stable/src/Display.cpp.o
In file included from src/ConfigHelper.cpp:1:0:
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.
Compiling .pioenvs/stable/src/NTPClient.cpp.o
src/NTPClient.cpp:1:23: fatal error: NtpClient.h: No such file or directory

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

#include "NtpClient.h"
^
compilation terminated.
Compiling .pioenvs/stable/src/NetworkService.cpp.o
In file included from src/Display.cpp:1:0:
include/Display.h:5:17: fatal error: LCD.h: No such file or directory

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

#include <LCD.h>
^
compilation terminated.
Compiling .pioenvs/stable/src/PSU.cpp.o
src/PSU.cpp:1:17: fatal error: Psu.h: No such file or directory

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

#include "Psu.h"
^
compilation terminated.
Compiling .pioenvs/stable/src/PsuLogger.cpp.o
In file included from src/PsuLogger.cpp:1:0:
include/PsuLogger.h:3:17: fatal error: Psu.h: No such file or directory

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

#include "Psu.h"
^
compilation terminated.
Compiling .pioenvs/stable/src/Shell.cpp.o
*** [.pioenvs/stable/src/ConfigHelper.cpp.o] Error 1
*** [.pioenvs/stable/src/NTPClient.cpp.o] Error 1
Compiling .pioenvs/stable/src/StrUtils.cpp.o
*** [.pioenvs/stable/src/Display.cpp.o] Error 1
*** [.pioenvs/stable/src/PSU.cpp.o] Error 1
*** [.pioenvs/stable/src/PsuLogger.cpp.o] Error 1
In file included from src/Shell.cpp:1:0:
include/Shell.h:3:23: fatal error: SimpleCLI.h: No such file or directory

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

#include <SimpleCLI.h>
^
compilation terminated.
*** [.pioenvs/stable/src/Shell.cpp.o] Error 1
In file included from src/NetworkService.cpp:1:0:
include/NetworkService.h:11:22: fatal error: Wireless.h: No such file or directory

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

#include "Wireless.h"
^
compilation terminated.
*** [.pioenvs/stable/src/NetworkService.cpp.o] Error 1
===================================== [ERROR] Took 0.90 seconds =====================================

Processing stage (platform: https://github.com/platformio/platform-espressif8266.git#feature/stage; 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 (Stage) > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz 80KB RAM (4MB Flash)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 30 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ESP8266NetBIOS> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <Wire> 1.0
|-- <ArduinoOTA> 1.0
|   |-- <ESP8266mDNS> 1.2
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WebServer> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266SSDP> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <mcurses>
Compiling .pioenvs/stage/src/ConfigHelper.cpp.o
Compiling .pioenvs/stage/src/Display.cpp.o
In file included from src/ConfigHelper.cpp:1:0:
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.
Compiling .pioenvs/stage/src/NTPClient.cpp.o
src/NTPClient.cpp:1:23: fatal error: NtpClient.h: No such file or directory

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

#include "NtpClient.h"
^
compilation terminated.
Compiling .pioenvs/stage/src/NetworkService.cpp.o
In file included from src/Display.cpp:1:0:
include/Display.h:5:17: fatal error: LCD.h: No such file or directory

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

#include <LCD.h>
^
compilation terminated.
Compiling .pioenvs/stage/src/OTAUpdate.cpp.o
Compiling .pioenvs/stage/src/PSU.cpp.o
Compiling .pioenvs/stage/src/Plot,.cpp.o
src/PSU.cpp:1:17: fatal error: Psu.h: No such file or directory

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

#include "Psu.h"
^
compilation terminated.
*** [.pioenvs/stage/src/ConfigHelper.cpp.o] Error 1
*** [.pioenvs/stage/src/NTPClient.cpp.o] Error 1
Compiling .pioenvs/stage/src/PsuLogger.cpp.o
*** [.pioenvs/stage/src/Display.cpp.o] Error 1
*** [.pioenvs/stage/src/PSU.cpp.o] Error 1
In file included from src/PsuLogger.cpp:1:0:
include/PsuLogger.h:3:17: fatal error: Psu.h: No such file or directory

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

#include "Psu.h"
^
compilation terminated.
*** [.pioenvs/stage/src/PsuLogger.cpp.o] Error 1
In file included from src/NetworkService.cpp:1:0:
include/NetworkService.h:11:22: fatal error: Wireless.h: No such file or directory

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

#include "Wireless.h"
^
compilation terminated.
*** [.pioenvs/stage/src/NetworkService.cpp.o] Error 1
===================================== [ERROR] Took 1.00 seconds =====================================

============================================= [SUMMARY] =============================================
Environment stable	[ERROR]
Environment stage 	[ERROR]
===================================== [ERROR] Took 1.90 seconds =====================================

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Fri Aug 23, 2019 11:28 pm

It's misleading with my local file system and git (i try to solve this).

c:\Projects\smartpower2\src>dir *.cpp

23.08.2019 00:09 13 287 Cli.cpp
17.08.2019 06:41 3 930 Config.cpp
11.08.2019 22:16 7 333 ConfigHelper.cpp
22.08.2019 19:54 16 117 Display.cpp
19.07.2019 02:30 1 245 FileStorage.cpp
22.08.2019 16:33 7 782 Global.cpp
18.08.2019 04:30 2 717 ina231.cpp
15.08.2019 00:51 3 686 Led.cpp
20.08.2019 03:06 2 150 LoopWatchDog.cpp
22.08.2019 21:17 14 146 main.cpp
13.08.2019 02:08 469 mcp4652.cpp
21.08.2019 15:23 2 275 NetworkService.cpp
23.08.2019 17:14 3 425 NtpClient.cpp
21.08.2019 18:51 2 985 OTAUpdate.cpp
15.08.2019 23:53 1 617 Plot,.cpp
22.08.2019 23:37 6 725 Psu.cpp
23.08.2019 00:16 2 765 PsuLogger.cpp
22.08.2019 15:08 2 452 Shell.cpp
20.08.2019 19:47 3 556 StrUtils.cpp
21.08.2019 02:42 8 014 SysInfo.cpp
20.08.2019 17:27 4 229 SystemClock.cpp
21.08.2019 12:23 2 786 TelnetServer.cpp
10.08.2019 01:54 7 822 Termul.cpp
10.08.2019 04:35 6 656 TimeUtils.cpp
21.08.2019 19:02 11 988 WebService.cpp
21.08.2019 15:17 13 460 Wireless.cpp


Could you execute platformio library update task in project folder, and attach log that you get?

platformio lib update

You should get something like

Library Storage: c:\Projects\smartpower2\.pio\libdeps\stable
Updating ArduinoJson @ 6.11.4 [6.11.5]
Uninstalling ArduinoJson @ 6.11.4: [OK]
Looking for ArduinoJson library in registry
Found: https://platformio.org/lib/show/64/ArduinoJson
LibraryManager: Installing id=64 @ 6.11.5
Downloading [####################################] 100%
Unpacking [####################################] 100%
ArduinoJson @ 6.11.5 has been successfully installed!
Updating LiquidCrystal @ 1.5.0 [Up-to-date]
Updating SimpleCLI @ 1.0.4 [Up-to-date]
Updating SimpleTimer @ b30890b8f7 [Up-to-date]
Updating WebSockets @ 2.2.0 [Up-to-date]

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Fri Aug 23, 2019 11:38 pm

It's misleading with my local file system and git (i try to solve this). Looks like git client (windows 7) is case insensitive too :x
UPD: done

Could you execute platformio library update task in project folder, and attach log that you get?

platformio lib update

You should get something like

Code: Select all

Library Storage: c:\Projects\smartpower2\.pio\libdeps\stable
Updating ArduinoJson                     @ 6.11.4         [6.11.5]
Uninstalling ArduinoJson @ 6.11.4:      [OK]
Looking for ArduinoJson library in registry
Found: https://platformio.org/lib/show/64/ArduinoJson
LibraryManager: Installing id=64 @ 6.11.5
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
ArduinoJson @ 6.11.5 has been successfully installed!
Updating LiquidCrystal                   @ 1.5.0          [Up-to-date]
Updating SimpleCLI                       @ 1.0.4          [Up-to-date]
Updating SimpleTimer                     @ b30890b8f7     [Up-to-date]
Updating WebSockets                      @ 2.2.0          [Up-to-date]
[/quote]


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

Re: SmartPower2 alt firmware

Unread post by lsc1117 » Mon Aug 26, 2019 10:48 am

Thank you for your reply.

I have updated the renaming commit to my source code.
And it works well.
Can you create PR on hardkernel repository?

Thank you.

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

Re: SmartPower2 alt firmware

Unread post by lsc1117 » Mon Aug 26, 2019 11:53 am

And can you update a feature that when I press the power button the web page will be updated instantly?
Currently, when I press and release the power button to turn on or off, the web page doesn't update.
So when I press the power button to turn off the power, the webpage remains on.

I have tested it with chrome and firefox browser on my PC.

Thank you.

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

Re: SmartPower2 alt firmware

Unread post by lsc1117 » Mon Aug 26, 2019 8:17 pm

Actually we want to use your repository as SP2's main project.
I think it's better to use your repository than the hardkernel repository.
Can I link your project to our hardkernel wiki page?

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Mon Aug 26, 2019 9:14 pm

lsc1117 wrote:
Mon Aug 26, 2019 8:17 pm
Actually we want to use your repository as SP2's main project.
I think it's better to use your repository than the hardkernel repository.
Can I link your project to our hardkernel wiki page?
Yes of curse, i'll create PR when finish 0.6.7 and fix bugs that i already now (include that you have found).

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

Re: SmartPower2 alt firmware

Unread post by lsc1117 » Tue Aug 27, 2019 9:55 am

I think it is better to use your repository than the hardkernel repository for the maintenance.
And we can just link the SP2's source code to your repository on our wiki.
What do you think?

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Thu Aug 29, 2019 7:00 am

lsc1117 wrote:
Tue Aug 27, 2019 9:55 am
I think it is better to use your repository than the hardkernel repository for the maintenance.
And we can just link the SP2's source code to your repository on our wiki.
What do you think?
As you wish, i don't mind.

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

Re: SmartPower2 alt firmware

Unread post by lsc1117 » Fri Aug 30, 2019 11:25 am

@ytrikoz
Thank you very much.

And I want to check one. When I turn on the "Total consumption" in Log and stats, the watt overflow occurs quickly.
What is the unit of the "Total consumption"?

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 Oct 11, 2019 11:33 am

@ytrikoz

I have installed your latest prebuilt code, 0.6.8, on my SmartPower2. It mostly works as expected but there are few issues.

I implemented wifi="3", store_wh="1", voltage="12.7", ssid="****", and passwd="**************" as you can see:

Code: Select all

paulcrawford@ma:~/smartpower2-0.6.8$ telnet 192.168.10.***
Trying 192.168.10.***...
Connected to 192.168.10.***.
Escape character is '^]'.
press "enter" to start


Command not found at '����'
05:04:19> config

wifi="3"
ssid="****"
passwd="************"
dhcp="1"
ipaddr="192.168.1.4"
netmask="255.255.255.0"
gateway="192.168.1.1"
dns="192.168.1.1"
voltage="12.7"
bootpwr="0"
login="admin"
password="1234"
ap_ssid="SmartPower2"
ap_passwd="12345678"
ap_ipaddr="192.168.4.1"
time_zone="3"
twp="82"
ntp_sync="3600"
ntp_pool="pool.ntp.org"
time_backup="3600"
store_wh="1"
backlight="1"
But when I try to change "time_zone" I get:

Code: Select all

05:23:29> set time_zone -4

Unknown argument at command 'set' at '-4'
Also although I set the voltage to 12.7, the display reads 12.93 which seems to be much higher. I will check that with a DMM.

When I try to get to the web page, at <http://192.168.4.1>, all I get is:

Code: Select all

File Not Found

URI: /
Method: GET
Arguments: 0
Can you please find the errors in the code and fix them?

Thanks

EDIT: I checked the output voltage with a Fluke DMM and got 12.92V, virtually identical to the display value of 12.929V. Then I set the config voltage to 12.5, but the display and DMM were unchanged. Setting voltage to 11 still had no effect on the actual output voltage that remained at 12.929V on the display.

Code: Select all

14:54:18> config

wifi="3"
ssid="****"
passwd="***********"
dhcp="1"
ipaddr="192.168.1.4"
netmask="255.255.255.0"
gateway="192.168.1.1"
dns="192.168.1.1"
voltage="11"
bootpwr="0"
login="admin"
password="1234"
ap_ssid="SmartPower2"
ap_passwd="12345678"
ap_ipaddr="192.168.4.1"
time_zone="3"
twp="82"
ntp_sync="3600"
ntp_pool="pool.ntp.org"
time_backup="3600"
store_wh="1"
backlight="1"
EDIT2: Removing the programming USB cable did reduce the output voltage slightly to 12.894 V on the display and 12.89 on the DMM but the config setting is still voltage="11". Also I tried setting bootpwr to 2 but unplugging the input power and plugging it back in again did not turn on the output power although it was on when the input was removed. Also the display remained at the wifi info not the V A W Wh info. Setting bootpwr to 1 switched the display to V A W Wh and the output power was turned on as checked with the DMM but all of the display values were 0.000 and the red power led does not flash. To get the display to the show the actual values required two button presses, but the first actually turned off the output power and the second restored the output power and correct readings on the display. All of which makes bootpwr="1" almost useless.

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Sun Oct 13, 2019 3:03 am

lsc1117 wrote:
Fri Aug 30, 2019 11:25 am
@ytrikoz
Thank you very much.
And I want to check one. When I turn on the "Total consumption" in Log and stats, the watt overflow occurs quickly.
What is the unit of the "Total consumption"?
Hi! apologize for the long silence.
I tested 0.6.8 with a USB doctor and my smartphone. while charging the smartphone battery, I got a similar result of ~ 12 so I thought it corresponded to watts hours.

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Sun Oct 13, 2019 3:10 am

paulcrawford wrote:
Fri Oct 11, 2019 11:33 am
Unknown argument at command 'set' at '-4'

EDIT: I checked the output voltage with a Fluke DMM and got 12.92V, virtually identical to the display value of 12.929V. Then I set the config voltage to 12.5, but the display and DMM were unchanged. Setting voltage to 11 still had no effect on the actual output voltage that remained at 12.929V on the display.

EDIT2: Removing the programming USB cable did reduce the output voltage slightly to 12.894 V on the display and 12.89 on the DMM but the config setting is still voltage="11". Also I tried setting bootpwr to 2 but unplugging the input power and plugging it back in again did not turn on the output power although it was on when the input was removed. Also the display remained at the wifi info not the V A W Wh info. Setting bootpwr to 1 switched the display to V A W Wh and the output power was turned on as checked with the DMM but all of the display values were 0.000 and the red power led does not flash. To get the display to the show the actual values required two button presses, but the first actually turned off the output power and the second restored the output power and correct readings on the display. All of which makes bootpwr="1" almost useless.
Missed, the possibility of using an alternative voltage range (have you changed the resistance as shown on the wiki)?
Yes, of course, I will do my best.
Thanks for the feedback, I thought that there was no interest (since there are no requests) ... Now the motivation has appeared again.

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 » Sun Oct 13, 2019 3:30 am

ytrikoz wrote:
Sun Oct 13, 2019 3:10 am

Missed, the possibility of using an alternative voltage range (have you changed the resistance as shown on the wiki)?
Yes, of course, I will do my best.
Thanks for the feedback, I thought that there was no interest (since there are no requests) ... Now the motivation has appeared again.
Yes I have changed the R30 to 91K so that I can use SmartPower2 with my N2. I use a 12V TalentCell lithium battery in parallel with AC adapter to act as a UPS. It works well but I would like to control the SmartPower2 to 12.6V as this is the voltage on the AC adapter supplied by TalentCell to charge the battery.

Do you know why setting time_zone does not work?

I really would like to be able to use the web page as well. Do you understand why I get "File Not Found" when I try to look at the default web page for SmartPower2?
Attachments
FileNotFound.png
FileNotFound.png (13.57 KiB) Viewed 1140 times

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Sun Oct 13, 2019 9:35 am

paulcrawford wrote:
Sun Oct 13, 2019 3:30 am
Yes I have changed the R30 to 91K so that I can use SmartPower2 with my N2. I use a 12V TalentCell lithium battery in parallel with AC adapter to act as a UPS. It works well but I would like to control the SmartPower2 to 12.6V as this is the voltage on the AC adapter supplied by TalentCell to charge the battery.

Do you know why setting time_zone does not work?

I really would like to be able to use the web page as well. Do you understand why I get "File Not Found" when I try to look at the default web page for SmartPower2?
yes, it was fixed in sources already. will upload new prebuilt in 24 hours.
These users thanked the author ytrikoz for the post:
paulcrawford (Sun Oct 13, 2019 10:58 am)

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Mon Oct 14, 2019 2:51 am

paulcrawford wrote:
Sun Oct 13, 2019 3:30 am
Do you know why setting time_zone does not work?
https://github.com/ytrikoz/smartpower2/ ... /tag/0.6.8
to set time_zone
https://github.com/ytrikoz/smartpower2/ ... l-timezone
please try to measure output voltage (with DMM) you got with standard 4 - 5.3 in web interface, don't need to set it above manually.
if I understand correctly, it will be necessary to introduce a correction factor.
With power on (and some connected load) to shure it's in range with your load measure voltage before ) type in console:
log print, to see wich you got, it's should be something like this
count min max avg time
V 18 2.67 4.96 4.58 00:00:04
I 18 0.15 5.00 4.39 00:00:04
P 18 0.00 23.31 16.11 00:00:04
Wh 18 0.00 0.02 0.01 00:00:04

to switch on and off you can use power on or power off commands. to see psu state show psu.
Web interface should work also.

After changing bootpwr, type config save or config apply

also with no input dc (when only usb connected) or no load, you'll get "error voltage low" and "alert load low" , please watch how power led blinking.
i'm working to fix lcd information showing when this happing and bootpwr = 1 or = 2

it is better to flash the device with the display turned off, if after the firmware the display has stopped working, it is necessary to completely disconnect the device power, this will bring it back to life.

random experiment ended with the smell of wiring showed that 5A for a long time require cooling the device.
These users thanked the author ytrikoz for the post (total 2):
paulcrawford (Mon Oct 14, 2019 4:11 am) • odroid (Mon Oct 14, 2019 9:15 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 15, 2019 6:04 am

@ytrikoz,

Thanks for the bug fix release. I have uploaded both firmware.bin and spiffs.bin to my SmartPower2.

I can confirm that "set time_zone 10" and gives me the correct time.

print /etc/time_zone does not work, however:

Code: Select all

10:10:59> print /etc/time_zone

file '/etc/time_zone' not found
I tested log print and show psu and got:

Code: Select all

16:22:46> log print

	count	min	max	avg	time
V	824	1.89	12.96	12.91	00:03:26
I	824	0.00	0.39	0.19	00:03:26
P	824	0.00	4.49	2.45	00:03:26
Wh	824	0.00	0.14	0.07	00:03:26
16:24:52> show psu

power: on
output: 5.30
uptime: 341
So that seems to work OK except that psu output is incorrect at 5.3. My DMM confirmed the output voltage at 12.92 the same as log print.

Unfortunately the web interface still shows "File Not Found" and the scrolling values of V and A go across the display too quickly to be read so something must have changed since it worked fine before. Occasionally the display does stop scrolling but what is displayed then is usually not the complete V and A output.

Presently my bootpwr is set to 2 but it does not seem to work now as when I unplug the SP2 DC input and plug it back in again there is no output DC power.

power on and power off commands do work properly.

I tried uploading the *.bin files with and without the display connected and it did not seem to make any difference.

With the pre bug fix version the AP and STA info used to be displayed before the dc input power was connected but now there is none of that, only blanks and zeros.

On balance, although time_zone now works, more things were broken than fixed unfortunately.

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Tue Oct 15, 2019 8:32 am

paulcrawford wrote:
Tue Oct 15, 2019 6:04 am
On balance, although time_zone now works, more things were broken than fixed unfortunately.
Ok, don't want to install platform.io? i'll write short build instruction if need. When you can press one button (two) to upload flash and get web interface work.
lcd may be "not found", it's not every flashing, (1/10 or less), it's a known bug (not mine)
Just wrote this to get you know. For me i got several minutes of panic, than it's happend first time.

print /etc/time_zone - file not found - means outdated spiffs.bin... try included with this post. My fault
Attachments
spiffs.zip
(210.63 KiB) Downloaded 10 times
These users thanked the author ytrikoz for the post:
paulcrawford (Wed Oct 16, 2019 11:31 am)

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Tue Oct 15, 2019 12:08 pm

still broken, but much better
no pvi lcd scrolling too
Attachments
firmware.zip
(310.92 KiB) Downloaded 8 times
These users thanked the author ytrikoz for the post:
paulcrawford (Wed Oct 16, 2019 11:31 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 16, 2019 11:31 am

I did install platformio and got the web page working.

Installed the new spiffs.bin but not the new firmware.bin.

Will do that tomorrow and report back.

Thanks for all of your help.

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 16, 2019 10:08 pm

Installed the new firmware.bin and now the display works fine again. The web page is also fine.

Still issues:
  • 1. Telnet config voltage set to 12.7 but web page shows 5.3 (actual voltage 12.924 on display and 12.92 on DMM).
    2. Live data set averaging on web page is 3 but parameter does not exist in telnet config.
    3. Output USB voltage from SP2 is 7.55 according to CHARGER Doctor (probably a result of higher than normal output voltage).
I think you are definitely getting there. Thank you for all of your hard work.

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 16, 2019 10:18 pm

One other thing: pressing "esc" twice during telnet session does not seem to end the session...

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Wed Oct 16, 2019 11:59 pm

paulcrawford wrote:
Wed Oct 16, 2019 10:08 pm
Installed the new firmware.bin and now the display works fine again. The web page is also fine.
Still issues:
  • 1. Telnet config voltage set to 12.7 but web page shows 5.3 (actual voltage 12.924 on display and 12.92 on DMM).
for this version it is assumed, this modification with a resistor is a fairly straightforward solution. I’m going to add a flag to the settings that will affect the range displayed in the interface, since this is nothing more than a convention.
paulcrawford wrote:
Wed Oct 16, 2019 10:08 pm
2. Live data set averaging on web page is 3 but parameter does not exist in telnet config.
right now you can set averaging by command power avg n (where n 1024, 512, 256,128, 64, 16 samples - it's hardware averaging).
paulcrawford wrote:
Wed Oct 16, 2019 10:08 pm
3. Output USB voltage from SP2 is 7.55 according to CHARGER Doctor (probably a result of higher than normal output voltage).
i think it's hardware issue, price for get 12V output, here I have no suggestions

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Sat Oct 19, 2019 10:47 pm

0.6.8:
-lcd fixed
-psu alert, error fixed

PS no changes between previous spiffs.bin
Attachments
0_6_8_firmware.zip
(521.28 KiB) Downloaded 9 times
These users thanked the author ytrikoz for the post:
paulcrawford (Sun Oct 20, 2019 11:07 pm)

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Sun Oct 20, 2019 6:18 am

0.6.8:
- command to send magic packet
wol -ip x.x.x.x -mac xx:xx:xx:xx:xx:xx
Attachments
0_6_8_firmware.zip
(310.64 KiB) Downloaded 9 times
These users thanked the author ytrikoz for the post:
paulcrawford (Sun Oct 20, 2019 11:07 pm)

User avatar
odroid
Site Admin
Posts: 32472
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 175 times
Been thanked: 343 times
Contact:

Re: SmartPower2 alt firmware

Unread post by odroid » Mon Oct 21, 2019 9:08 am

Thank you for the updates!
I like the WoL feature. :D

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Wed Oct 23, 2019 8:55 am

0.6.8:
Boot Up power state
(/etc/main) parameter 'bootpwr' (needs `config apply`)
To change, use the admin web interface or command `set bootpwr` *value*
Where *value*:
0 - Off
1 - On
2 - Last state (uninterruptible power during reboots and restoration of last state after switching off/on)

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 23, 2019 11:33 am

@ytrikoz,

First of all let me thank you for all of the great work you have done on the SP2 firmware. It is truly well appreciated.

Items that I have found to work properly now after your latest updates:

1. On startup.
2. Output voltage control.

Having said that there are still a few issues that I believe will make the firmware even better when they are corrected.

1. "Dull" live data (see the attachment for a screen shot from my iPhone). The red and green are very subdued. Not sure why it happens. When it does sometimes doing a refresh of the web page will correct it and sometimes not.

2. Total consumption. There seem to be two parameters that can be set to get this, one in config and one on the Home web page. I have had the config value of "store_wh" set to 1 for days now but if I unplug power to the SP2 and get the web page again it seems that often Home web page value of Total consumption will come up as "off" even though "store_wh" is still at 1. Shouldn't these two always be the same? If they are not the same how can the user save the Home web page value. I have let this Wh value get up to 60 or 70 and if I then remove the power and restart a non-zero value does come back to Wh indicating that the value has been saved and then restored but the actual value that shows up is usually somewhere in the range of 5 to 9. Does this mean that maximum value of the stored Wh is much less than the actual Home web page value?

3. Although the actual output voltage is now ~12.7V the Options webpage shows 5.1V. The wiki says that voltage should be between 4 and 6 volts or 11 and 13 volts, but if the user puts in a value of 12.7 then the Options web page display shows 5.3 when saved and then the actual voltage goes to 12.9V. Can this be fixed so that if the user puts in 12.7 and clicks "Save" the Options web page displays 12.7 and the actual voltage is 12.7V.

4. I have set the config "backlight" parameter to 0 but the LCD display backlight is still on. Can that be fixed so that the backlight will be off?

5. When in telnet without an "esc" key on the keyboard (iPad and iPhone) a "^[" does work to drop out of telnet but not on the N2 via ssh. I have found though that "^]" does work to replace "esc" on the N2. Is this a difference between the Apple and Linux interpretation of the "esc" key?

Thanks again for the great work.
Attachments
Dull live data.png
Dull live data.png (303.38 KiB) Viewed 704 times

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Sun Oct 27, 2019 6:04 am

## 0.6.9 (2019-10-26)
### Total consumption
(/etc/main) parameter 'store_wh' (needs `config apply`)
To change, use the admin web interface or command `set store_wh` *value*
Where *value*:
**0** - Off; Will reset counter every power on.
**1** - On; To save the counter between turning the device on and off (stored once a minute in / var / wh)

### Backlight control
To operate the device lcd backlight use command `system backlight` *value*
Where *value*:
**0** - Off
**1** - On
(/etc/main) parameter 'backlight' (needs `config apply`)
to disable backlight:
`set backlight 0`
`config apply`

### Voltage control 4-13 volts

Needs flash both files.
Attachments
0.6.9_firmware.zip
(521.24 KiB) Downloaded 5 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 » Mon Oct 28, 2019 1:46 am

@ytrikoz,

I tried uploading this latest set of firmware, 0.6.9, with esptool.py and the SP2 could not boot properly after being reset at the end of the program. WiFi never came up although the blue light flashed intermittently. Backlight apparently works since i could not see the display and I have it set to "0". Seems as if SP2 is caught in a loop.

I have reverted to the previous version. All is well again.

Can you please review this latest version?

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

Re: SmartPower2 alt firmware

Unread post by ytrikoz » Mon Oct 28, 2019 6:48 am

paulcrawford wrote:
Mon Oct 28, 2019 1:46 am
@ytrikoz,
I tried uploading this latest set of firmware, 0.6.9, with esptool.py and the SP2 could not boot properly after being reset at the end of the program. WiFi never came up although the blue light flashed intermittently. Backlight apparently works since i could not see the display and I have it set to "0". Seems as if SP2 is caught in a loop.
I have reverted to the previous version. All is well again.
Can you please review this latest version?
How do you flash - as wiki says, or using git repo and platformio? You're flashed both files?

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 11:52 am

@ytrikoz,

The way I flashed the 0.6.9 update was to run the following:

Code: Select all

paulcrawford@ma:~/smartpower2-0.6.8$ sudo esptool.py --chip esp8266 --port /dev/ttyUSB0 --baud 921600 write_flash 0x00000 prebuilt/firmware.bin 0x100000 prebuilt/spiffs.bin
after moving the two files, firmware.bin and spiffs.bin, provided in your 0.6.9_firmware.zip file attached to your reply to the forum of 26 Oct 2019 17:04 EST, to ~/smartpower2-0.6.8/prebuilt.

Since there was no release of 0.6.9 that I could find on GitHub I thought that flashing the two above files would be enough to get the changes onto my SP2.

Can you please advise when users must use platformio and when simply flashing firmware.bin and spiffs.bin with esptool.py is sufficient? If you send only the latter it appears that flashing only would be sufficient.

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.

On the output voltage setting to get my desired 12.7V I must set the output voltage to 5.0 (rather than 5.1 as it used to be). Setting the output voltage to my desired 12.7V results in an output voltage of 12.93V. It appears that output voltage setting is still not working correctly.

Post Reply

Return to “Smart Power”

Who is online

Users browsing this forum: No registered users and 0 guests