How do you upload FW to Smart Power 2?

Moderators: odroid, mdrjr

How do you upload FW to Smart Power 2?

Unread postby Raymond Day » Sat Feb 10, 2018 12:12 pm

Looked at:

https://wiki.odroid.com/accessory/power_supply_battery/smartpower2

Plugged the USB to my server and did all the commands it said. A lsusb will show it like this:

Bus 001 Device 014: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light

I downloaded a FW for it.

It has a "date" folder, a "src" folder and a "platformio.ini" file. All in a "smartpower2" folder.

Here is what it says to do in set 3:

$ cd /path/to/dir/smartpower2
$ platformio run
$ platformio run --target upload
$ platformio run --target uploadfs


So I guess I replace the --target with the folder of "smartpower2" is that right?

-Raymond Day
Raymond Day
 
Posts: 494
Joined: Tue Jun 04, 2013 8:18 pm
Location: Belleville MI
languages_spoken: english
ODROIDs: Odroid-U2, XU4, C1+,

Re: How do you upload FW to Smart Power 2?

Unread postby joerg » Mon Feb 12, 2018 2:16 am

@Raymond Day
I have done it now exactly how it is written on the wiki page. No replace of --target. You give this commands exactly like it is written, in my case with sudo in front.
Before not possible to connect to wifi (original firmware when I got this as prototype years ago) and after, yes it is possible to connect to wifi, shows FW 1.30. So I am sure the update was done.
joerg
 
Posts: 791
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: How do you upload FW to Smart Power 2?

Unread postby Raymond Day » Mon Feb 12, 2018 2:27 am

Got another post what I did.

Yes I guess it will work with the F/W that comes with the:

git clone https://github.com/hardkernel/smartpower2.git

But I want it to work with the F/W I got from "Smart Power 2 firmware with wifi client"

I did replace the 2 folders and 1 file with the one from that firmware with wifi client with the same names.

But then I get errors in RED color:

/media/6TB/USBdisk2-3TB/root/smartpower2/src/smartpower2.ino:268:15: error: use of deleted function 'ESP8266WebServer& ESP8266WebServer::operator=(const ESP8266WebServer&)'

Did it any way and tested my smart power 2 and looks like nothing changed on it.

Just don't know how you put a different firmware on it.

-Raymond Day
Raymond Day
 
Posts: 494
Joined: Tue Jun 04, 2013 8:18 pm
Location: Belleville MI
languages_spoken: english
ODROIDs: Odroid-U2, XU4, C1+,

Re: How do you upload FW to Smart Power 2?

Unread postby joerg » Mon Feb 12, 2018 3:50 am

O.K. I missed this. I tried now with this alternative firmware and run in the same errors.
To solve this, change in smartpower2.ino
line 69:
Code: Select all
ESP8266WebServer *webServer;

line 269:
Code: Select all
webServer =  new ESP8266WebServer(current_ip, 80);

And search in this file for 'webServer.' and replace it with 'webServer->'.

On my PC it compiles and I can download. Only I can't see what's the different. I tried to change the ssid to my home wifi ssid, but I can't set the aes password, it's to long.

Update
I see that the FW has changed to 1.21. Only don't know how to use it. Need to ask the OP.
joerg
 
Posts: 791
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: How do you upload FW to Smart Power 2?

Unread postby joerg » Mon Feb 12, 2018 7:35 pm

OK, I finaly found it.
To make it accept long password need to change data/index.html
line 275:
Code: Select all
<input type="password" id="tf_passwd" class="form-control" maxlength="16">

Or to whatever length it is needed.
After setting of ssid and password, save and reboot. It connects to my home wifi with wpa2. IP address is dynamic.
But be aware, there is no security. Also password is shown with asteriks, it is stored and transfered in plain text.
joerg
 
Posts: 791
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: How do you upload FW to Smart Power 2?

Unread postby Raymond Day » Mon Feb 12, 2018 10:02 pm

I still can't get the FW to upload to the SmartPower2. Just don't know what I am doing wrong.

-Raymond Day
Raymond Day
 
Posts: 494
Joined: Tue Jun 04, 2013 8:18 pm
Location: Belleville MI
languages_spoken: english
ODROIDs: Odroid-U2, XU4, C1+,

Re: How do you upload FW to Smart Power 2?

Unread postby joerg » Mon Feb 12, 2018 10:06 pm

I saw with my PC that I need to reconnect or press the button until a 'dev/ttyUSB0' was there. Then it was possible to download.
But it compiles now without error?
joerg
 
Posts: 791
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: How do you upload FW to Smart Power 2?

Unread postby Raymond Day » Mon Feb 12, 2018 10:15 pm

Got my Smart power plug in to the USB of my Ubuntu server and I did all theres commands and still get red errors you can see from that screen shot of my Putty window to it.

The 4 commands I did is this:

Code: Select all
git clone https://github.com/palich2000/smartpower2.git
cd smartpower2
platformio run
platformio run --target upload
platformio run --target uploadfs


Command line smartpower2 errors.jpg
Command line smartpower2 errors.jpg (265.12 KiB) Viewed 484 times


It just don't seem like it's uploading any FW to my Smart power. The display does not move when it's doing this and after it looks like it resets. The display turns off then back on.

But I plug it in and all is the same looks like.

I guess can't get any errors. But don't know how to fix that.

-Raymond Day
Raymond Day
 
Posts: 494
Joined: Tue Jun 04, 2013 8:18 pm
Location: Belleville MI
languages_spoken: english
ODROIDs: Odroid-U2, XU4, C1+,

Re: How do you upload FW to Smart Power 2?

Unread postby joerg » Mon Feb 12, 2018 10:32 pm

Hi Raymond,
this double, tripple posts do confusing me a little. ;)
In the video of other post I saw that it compiled, but not uploaded with command upload. But it uploaded with command uploadfs.
The error in the video, I was able to see on my pc when I had connected another usb serial device, in my case an usb progger. I disconnected all other, let only the smartpower connected, and it uploaded. It seems that the uploader takes the first device it finds.

In the post above I see that it don't compile because of line 269: webServer = ESP8266WebServer(current_ip, 80);. You need to apply the changes I posted above. Somehow the code from this wifi client is outdated meanwhile in the libraries of ESP8266 has changed something.
joerg
 
Posts: 791
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: How do you upload FW to Smart Power 2?

Unread postby rooted » Mon Feb 12, 2018 10:37 pm

I see the baudrate is not 115200 but 921600, this may be the uploading problem?
User avatar
rooted
 
Posts: 4672
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: How do you upload FW to Smart Power 2?

Unread postby Raymond Day » Tue Feb 13, 2018 9:18 pm

I looked on that line in the src/smartpower2.ino file. The webServer = ESP.... had 2 spaces between the = and E I fixed that and still get errors running the platformio run and platformio run --target upload I guess 2 spaces don't matter there.

-Raymond Day

joerg wrote:Hi Raymond,
this double, tripple posts do confusing me a little. ;)
In the video of other post I saw that it compiled, but not uploaded with command upload. But it uploaded with command uploadfs.
The error in the video, I was able to see on my pc when I had connected another usb serial device, in my case an usb progger. I disconnected all other, let only the smartpower connected, and it uploaded. It seems that the uploader takes the first device it finds.

In the post above I see that it don't compile because of line 269: webServer = ESP8266WebServer(current_ip, 80);. You need to apply the changes I posted above. Somehow the code from this wifi client is outdated meanwhile in the libraries of ESP8266 has changed something.
Raymond Day
 
Posts: 494
Joined: Tue Jun 04, 2013 8:18 pm
Location: Belleville MI
languages_spoken: english
ODROIDs: Odroid-U2, XU4, C1+,

Re: How do you upload FW to Smart Power 2?

Unread postby Raymond Day » Tue Feb 13, 2018 9:55 pm

Thanks joere it worked this time. I did what you said to the file src/smartpower2.ino The 3 things. Just copied a paste from you post lines 69 and 269 and replace all the 'webServer.' with 'webServer->"

Ran the commands and just got the yellow errors.

Got on it's WiFi and can see just this change "F/W Version 1.21" now. Before it was 1.20

But that is the only change I go to settings and it's just the same. How do I get it to be like a server for WiFi. I want it to connect to my WiFi so can get the data and setting on any LAN PC. Not just a cellphone connected to it's WiFi. I want the SmartPower to connect to my WiFi. I thought this F/W would do that.

-Raymond Day

joerg wrote:O.K. I missed this. I tried now with this alternative firmware and run in the same errors.
To solve this, change in smartpower2.ino
line 69:
Code: Select all
ESP8266WebServer *webServer;

line 269:
Code: Select all
webServer =  new ESP8266WebServer(current_ip, 80);

And search in this file for 'webServer.' and replace it with 'webServer->'.

On my PC it compiles and I can download. Only I can't see what's the different. I tried to change the ssid to my home wifi ssid, but I can't set the aes password, it's to long.

Update
I see that the FW has changed to 1.21. Only don't know how to use it. Need to ask the OP.
Raymond Day
 
Posts: 494
Joined: Tue Jun 04, 2013 8:18 pm
Location: Belleville MI
languages_spoken: english
ODROIDs: Odroid-U2, XU4, C1+,

Re: How do you upload FW to Smart Power 2?

Unread postby Raymond Day » Wed Feb 14, 2018 12:44 am

Wow got it to work.

Used this FW:

But I want it to work with the F/W I got from "Smart Power 2 firmware with wifi client"


smartpower2.tar.gz and when I ran the commands no errors but on the last one!

I was going to unplug the smartpower2 to reset it. Because the display was not scrolling but I thought my brick it then.

So I run the same commands again from the start and this time it worked! No errors.

Now the "F/W Version 1.30" is displayed.

But all the setting are the same looks like. Just want this so it can scan for WiFi and connect to it auto get a IP with DHCP. I thought this F/W would do that. If it does I don't know how to set it up.

-Raymond Day
Raymond Day
 
Posts: 494
Joined: Tue Jun 04, 2013 8:18 pm
Location: Belleville MI
languages_spoken: english
ODROIDs: Odroid-U2, XU4, C1+,

Re: How do you upload FW to Smart Power 2?

Unread postby joerg » Wed Feb 14, 2018 1:59 am

Hi Raymond,
if this is FW 1.21, yes it can connect to home WIFI. The FW 1.30 cannot, as @odroid already stated.
You don't need to put IP address in settings, only SSID and password.
Here are some screenshots:
screen1.png
After new flashed, FW 1.21 and ip 192.168.4.1, connected to tablet
screen1.png (99.97 KiB) Viewed 438 times

screen2.png
Set SSID and password and save, then a power cycle
screen2.png (90.19 KiB) Viewed 438 times

screen3.png
Found in router as ESP803-CDD with ip 192.168.1.64
screen3.png (42.15 KiB) Viewed 438 times

screen4.png
Opened in Firefox with ip 192.168.1.64
screen4.png (68.76 KiB) Viewed 438 times

After you have set SSID and password and reboot, it should appear in the wifi routers list of connected devices.
If not, maybe your router doesn't accept and need extra permission to be open for a new device.
joerg
 
Posts: 791
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: How do you upload FW to Smart Power 2?

Unread postby Raymond Day » Wed Feb 14, 2018 2:07 am

My is F/W Version 1.30.

Were did you download the F/W version 1.21 ?

That is very nice photo on yours.

Thank you. Just need to know were you got the firmware 1.21.

-Raymond Day
Raymond Day
 
Posts: 494
Joined: Tue Jun 04, 2013 8:18 pm
Location: Belleville MI
languages_spoken: english
ODROIDs: Odroid-U2, XU4, C1+,

Re: How do you upload FW to Smart Power 2?

Unread postby joerg » Wed Feb 14, 2018 2:14 am

joerg
 
Posts: 791
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: How do you upload FW to Smart Power 2?

Unread postby Raymond Day » Wed Feb 14, 2018 2:28 am



I went there and then when I run the 1st commend I got a lot of RED color errors now.

Something must be wrong with it.

Still need a link for the version 1.21 please.

-Raymond Day
Raymond Day
 
Posts: 494
Joined: Tue Jun 04, 2013 8:18 pm
Location: Belleville MI
languages_spoken: english
ODROIDs: Odroid-U2, XU4, C1+,

Re: How do you upload FW to Smart Power 2?

Unread postby joerg » Wed Feb 14, 2018 2:39 am

Yes, it's the link. After you downloaded it, you need to apply the changes I posted above.
Cannot upload the corrected version here, it's to big.
joerg
 
Posts: 791
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: How do you upload FW to Smart Power 2?

Unread postby Raymond Day » Wed Feb 14, 2018 2:53 am

joerg wrote:Yes, it's the link. After you downloaded it, you need to apply the changes I posted above.
Cannot upload the corrected version here, it's to big.


I did apply the changes and after I did that I still get RED errors. I got a snapshot of my Putty showing the RED errors.

SmartPower2-FW1.21-errors.jpg
SmartPower2-FW1.21-errors.jpg (151.58 KiB) Viewed 427 times


I guess need some other changes on the /src/smartpower2.ino that is what I change for you info.

-Raymond Day
Raymond Day
 
Posts: 494
Joined: Tue Jun 04, 2013 8:18 pm
Location: Belleville MI
languages_spoken: english
ODROIDs: Odroid-U2, XU4, C1+,

Re: How do you upload FW to Smart Power 2?

Unread postby joerg » Wed Feb 14, 2018 3:20 am

Look at the error message. There is a typo in smartpower2.inc at line 5: #include <ESP8266webServer->.h> must be: #include <ESP8266WebServer.h>
smartpower2.ino.zip
(5.99 KiB) Downloaded 7 times
joerg
 
Posts: 791
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: How do you upload FW to Smart Power 2?

Unread postby Raymond Day » Wed Feb 14, 2018 3:27 am

joerg wrote:Look at the error message. There is a typo in smartpower2.inc at line 5: #include <ESP8266webServer->.h> must be: #include <ESP8266WebServer.h>


I did not change that yet because I seen I all ready had F/W version 1.21. I named the folder "smartpower2-master-github" I should of put he version number in the folder name.

So now it shows 1.21 and I go to settings and put in the SSID: and Password. I leave the IP address as 192.168.4.1 and save it. Go to Home and back to settings it it put back the SSID: "SmartPower2_8003a9" I change it to "OnHub" but it will not save it. I guess I have to unplug it from the USB and plug the power in.

-Raymond Day
Raymond Day
 
Posts: 494
Joined: Tue Jun 04, 2013 8:18 pm
Location: Belleville MI
languages_spoken: english
ODROIDs: Odroid-U2, XU4, C1+,

Re: How do you upload FW to Smart Power 2?

Unread postby Raymond Day » Wed Feb 14, 2018 3:35 am

O wow. It worked!

I did not think it saved. All I did was change the SSID and I thought it did not change but It did have my WiFi Password: So I unplug it from the USB and plug it in 12 volt power and it came up and it said on the LCD OnHub and got a IP and I went to the IP and it worked.

SmartPower2-FW1.21-WORKS.jpg
SmartPower2-FW1.21-WORKS.jpg (114.65 KiB) Viewed 423 times


Wow that took a long time. But nice got it working.

Plug in my Cell phone to the USB with a USB-C on my cellphone.

That USB says on the Wiki that it can only do 1 AMP. But on this video. Charging a battery with a lot more amps then 1 amp.

I had this server uptime 3 and a half days power with the smartpower1 and it says the most amp is says 3.027 max. I guess that my be why some car USB-C adapters did not let it run more then a day. It locked up or turn off. Using a USB on the smartpower1 so it's USB can do a little more then 3 amps then. So I hope the smart power 2 and all so. It can take more volts input them the smart power 1. + can see it on the web not not just USB info.

Thank you for all your help. It's working now. To bad it was not easy to do. Been doing this for 3 days now.

-Raymond Day
Raymond Day
 
Posts: 494
Joined: Tue Jun 04, 2013 8:18 pm
Location: Belleville MI
languages_spoken: english
ODROIDs: Odroid-U2, XU4, C1+,

Re: How do you upload FW to Smart Power 2?

Unread postby Raymond Day » Wed Feb 14, 2018 3:45 am

What does the "Auto Run" do if you check it? I guess it put Network Settings from default maybe? So I don't want to check that then.

-Raymond Day
Raymond Day
 
Posts: 494
Joined: Tue Jun 04, 2013 8:18 pm
Location: Belleville MI
languages_spoken: english
ODROIDs: Odroid-U2, XU4, C1+,

Re: How do you upload FW to Smart Power 2?

Unread postby Raymond Day » Wed Feb 14, 2018 1:08 pm

The one that worked is F/W Version: 1.21 and I named the folder "smartpower2-server"

So all the commands I did was this:

Code: Select all
cd smartpower2-server/
platformio init
platformio run
platformio run --target upload
platformio run --target uploadfs


But not sure were I downloaded it from. I got like 5 folders of smartpower2 on my server so it's hard to know were I downloaded it from. I think if some one else wants this it be nice to have the link to the right download for version: 1.21

-Raymond Day
Raymond Day
 
Posts: 494
Joined: Tue Jun 04, 2013 8:18 pm
Location: Belleville MI
languages_spoken: english
ODROIDs: Odroid-U2, XU4, C1+,


Return to Smart Power

Who is online

Users browsing this forum: No registered users and 2 guests