SmartPower2 alt firmware

Post Reply
ytrikoz
Posts: 8
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 0
Been thanked: 0
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 553 times
3.png
3.png (174.89 KiB) Viewed 555 times
2.png
2.png (153.54 KiB) Viewed 555 times

User avatar
odroid
Site Admin
Posts: 31760
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 83 times
Been thanked: 241 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: 8
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 0
Been thanked: 0
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: 31760
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 83 times
Been thanked: 241 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: 8
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 0
Been thanked: 0
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: 142
Joined: Thu Aug 22, 2013 12:46 am
languages_spoken: english
Location: South Korea
Has thanked: 0
Been thanked: 2 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: 8
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 0
Been thanked: 0
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: 142
Joined: Thu Aug 22, 2013 12:46 am
languages_spoken: english
Location: South Korea
Has thanked: 0
Been thanked: 2 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 11 times
I tried to solve the error by renaming files but the other error occurred.

Thank you.

ytrikoz
Posts: 8
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 0
Been thanked: 0
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: 142
Joined: Thu Aug 22, 2013 12:46 am
languages_spoken: english
Location: South Korea
Has thanked: 0
Been thanked: 2 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: 8
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 0
Been thanked: 0
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: 142
Joined: Thu Aug 22, 2013 12:46 am
languages_spoken: english
Location: South Korea
Has thanked: 0
Been thanked: 2 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 217 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 217 times

ytrikoz
Posts: 8
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 0
Been thanked: 0
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: 142
Joined: Thu Aug 22, 2013 12:46 am
languages_spoken: english
Location: South Korea
Has thanked: 0
Been thanked: 2 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: 8
Joined: Mon Jun 17, 2019 9:06 pm
languages_spoken: russian, english
ODROIDs: XU-4, CloudShell2, SmartPower2
Has thanked: 0
Been thanked: 0
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.

Post Reply

Return to “Smart Power”

Who is online

Users browsing this forum: No registered users and 1 guest