uPyEasy v0.3.0 released

Moderators: Voyager, BertB, Stuntteam, LisaM

Post Reply
Message
Author
LisaM
Normal user
Posts: 494
Joined: 11 Apr 2017, 18:29

uPyEasy v0.3.0 released

#1 Post by LisaM » 05 May 2018, 22:06

Version 0.3.0:
  • Dxbootstate switched from server based to client-server based
  • Changed hardware page from server based to client-server based, most processing on the page is now done by the browser.
  • Database single/multi row caching
  • Plugins optimized, bug fixing
  • Memory optimization done: Mem debugging added, pre-loading protocol/plugin changed to JIT
  • Memory optimization STM32
  • Added AP mode to config
  • Added missing unix dir's
There are significant database changes, best is to erase your firmware before flashing it with V0.3.0

Debug level can be set manually at startup, change the file boot.py content to
upyeasy.main(loglevel=0)

Loglevels:
0 = Debug + mem info
1 = Debug
2 = Info
3 = Warning
4 = Error

AndrewJ
Normal user
Posts: 226
Joined: 14 Feb 2017, 12:38

Re: uPyEasy v0.3.0 released

#2 Post by AndrewJ » 08 May 2018, 20:53

Hi Lisa,
I just downloaded the STM32 version of release v0.3.0 (dfu binary file) from Github releases page.
It started up all right, after a hiccup while it connected to ethernet, but after a short time (a few minutes) it gave the following errors....

Code: Select all

cket state=2 timeout=0 incoming=20003f34 off=34>> "GET /static/upyeasy.css"
Traceback (most recent call last):
  File "ulog.py", line 110, in do_log
  File "log_sink.py", line 44, in log
MemoryError: memory allocation failed, allocating 1857 bytes
Traceback (most recent call last):
  File "ulog.py", line 110, in do_log
  File "log_sink.py", line 44, in log
MemoryError: memory allocation failed, allocating 1857 bytes
2000-01-01 00:00:00 [info] uPyEasy-uPyEasy: 0.000 <HTTPRequest object at 200177f0> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=33>> "GET /static/upyeasy.js"
2000-01-01 00:00:00 [info] uPyEasy-uPyEasy: 0.000 <HTTPRequest object at 200188e0> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=16>> "GET /"
2000-01-01 00:00:00 [debug] uPyEasy-uPyEasy: Pages: Authorize User!?
2000-01-01 00:00:00 [debug] uPyEasy-uPyEasy: Pages: Entering Home Page
2000-01-01 00:00:00 [debug] uPyEasy-uPyEasy: Pages: Home Page Station mode
2000-01-01 00:00:00 [debug] uPyEasy-uPyEasy: Utils: uPyEasy Name
2000-01-01 00:00:00 [debug] uPyEasy-uPyEasy: Utils: Unit Number
2000-01-01 00:00:00 [debug] uPyEasy-uPyEasy: Hal: Getting local time in seconds
2000-01-01 00:00:00 [debug] uPyEasy-uPyEasy: Hal: get_ip_address pyboard, ip: 192.168.1.5
2000-01-01 00:00:00 [debug] uPyEasy-uPyEasy: Pages: Home Page Data collected
Traceback (most recent call last):
  File "ulog.py", line 110, in do_log
  File "log_sink.py", line 55, in log
MemoryError: memory allocation failed, allocating 2048 bytes
2000-01-01 00:00:00 [info] uPyEasy-uPyEasy: 0.000 <HTTPRequest object at 20019790> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=34>> "GET /static/upyeasy.css"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "upyeasy/__init__.py", line 82, in main
  File "picoweb/__init__.py", line 301, in run
  File "uasyncio/core.py", line 146, in run_forever
  File "uasyncio/core.py", line 101, in run_forever
  File "uasyncio/__init__.py", line 254, in start_server
MemoryError: memory allocation failed, allocating 180 bytes
>>> 
and the web interface stopped working ("The site cannot be reached, the connection was reset").

Any ideas where it's going wrong for me?

cheers
Andrew

AndrewJ
Normal user
Posts: 226
Joined: 14 Feb 2017, 12:38

Re: uPyEasy v0.3.0 released

#3 Post by AndrewJ » 08 May 2018, 22:39

Hi Lisa,
Following my previous post, I notced a new update was available in Github (d71b3d5) so I did a git pull to update my local upyeasy repo and rebuilt micropython-stm32, then downloaded it to my board.
Unfortunately I'm still getting similar errors, this time they seem to be triggered by accessing the Hardware page. :cry:

Code: Select all

2018-05-08 21:22:56 [info] uPyEasy-STM32_2: 579129791.259 <HTTPRequest object at 2000c700> <StreamWriter <socket state=2 timeout=0 incoming=20003f34 off=33>> "GET /static/upyeasy.js"
static/upyeasy.js
2018-05-08 21:28:38 [info] uPyEasy-STM32_2: 579130125.045 <HTTPRequest object at 20018c20> <StreamWriter <socket state=2 timeout=0 incoming=20003f34 off=24>> "GET /hardware"
2018-05-08 21:28:38 [debug] uPyEasy-STM32_2: Pages: Authorize User!?
2018-05-08 21:28:38 [debug] uPyEasy-STM32_2: Pages GET: Display hardware Page
Traceback (most recent call last):
  File "ulog.py", line 110, in do_log
  File "console_sink.py", line 37, in log
MemoryError: memory allocation failed, allocating 280 bytes
2018-05-08 21:28:39 [info] uPyEasy-STM32_2: 579130125.045 <HTTPRequest object at 2001b390> <StreamWriter <socket state=2 timeout=0 incoming=20003f34 off=24>> "GET /hardware"
2018-05-08 21:28:39 [debug] uPyEasy-STM32_2: Pages: Authorize User!?
2018-05-08 21:28:39 [debug] uPyEasy-STM32_2: Pages GET: Display hardware Page
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "upyeasy/__init__.py", line 82, in main
  File "picoweb/__init__.py", line 302, in run
  File "uasyncio/core.py", line 146, in run_forever
  File "uasyncio/core.py", line 101, in run_forever
  File "picoweb/__init__.py", line 212, in _handle
  File "picoweb/__init__.py", line 212, in _handle
  File "ulog.py", line 177, in exc
  File "ulog.py", line 49, in debug
  File "ulog.py", line 97, in log
  File "ulog.py", line 92, in create
MemoryError: memory allocation failed, allocating 280 bytes
>>> 
Any ideas?

EDIT: After posting the above, I rebooted the board and now it seems stable!
I don't know what to think.
I'll use it a bit more and see how it goes.

Cheers
Andrew

AndrewJ
Normal user
Posts: 226
Joined: 14 Feb 2017, 12:38

Re: uPyEasy v0.3.0 released

#4 Post by AndrewJ » 08 May 2018, 23:01

Sorry, still getting problems.
This time all was stable until I clicked 'Submit' button at bottom of Hardware page, then I got...

Code: Select all

2018-05-08 21:56:48 [debug] uPyEasy-STM32_2: Pages: Entering Devices Page
2018-05-08 21:56:48 [debug] uPyEasy-STM32_2: Utils: uPyEasy Name
2018-05-08 21:56:48 [info] uPyEasy-STM32_2: 579131793.975 <HTTPRequest object at 20015260> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=34>> "GET /static/upyeasy.css"
static/upyeasy.css
2018-05-08 21:56:48 [info] uPyEasy-STM32_2: 579131793.975 <HTTPRequest object at 200082d0> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=33>> "GET /static/upyeasy.js"
static/upyeasy.js
2018-05-08 21:56:52 [info] uPyEasy-STM32_2: 579131841.659 <HTTPRequest object at 200122e0> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=27>> "GET /controllers"
2018-05-08 21:56:52 [debug] uPyEasy-STM32_2: Pages: Authorize User!?
2018-05-08 21:56:52 [debug] uPyEasy-STM32_2: Pages: Entering Controllers Page
2018-05-08 21:56:52 [debug] uPyEasy-STM32_2: Utils: uPyEasy Name
2018-05-08 21:56:52 [info] uPyEasy-STM32_2: 579131841.659 <HTTPRequest object at 20015630> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=34>> "GET /static/upyeasy.css"
static/upyeasy.css
2018-05-08 21:56:54 [info] uPyEasy-STM32_2: 579131841.659 <HTTPRequest object at 20017580> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=24>> "GET /hardware"
2018-05-08 21:56:54 [debug] uPyEasy-STM32_2: Pages: Authorize User!?
2018-05-08 21:56:54 [debug] uPyEasy-STM32_2: Pages GET: Display hardware Page
2018-05-08 21:56:54 [debug] uPyEasy-STM32_2: Utils: uPyEasy Name
2018-05-08 21:56:54 [info] uPyEasy-STM32_2: 579131841.659 <HTTPRequest object at 20017750> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=34>> "GET /static/upyeasy.css"
static/upyeasy.css
2018-05-08 21:57:15 [info] uPyEasy-STM32_2: 579131841.659 <HTTPRequest object at 20011580> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=25>> "POST /hardware"
2018-05-08 21:57:15 [debug] uPyEasy-STM32_2: Pages: Authorize User!?
2018-05-08 21:57:15 [debug] uPyEasy-STM32_2: Pages POST: Update hardware
2018-05-08 21:57:16 [debug] uPyEasy-STM32_2: Critical exception: MemoryError('memory allocation failed, allocating 848 bytes',) - message: 579131841.659 <HTTPRequest object at 20011580> <StreamWriter <socket state=2 timeout=0 incoming=0 off=0>> MemoryError('memory allocation failed, allocating 848 bytes',)

Hope this helps to track it down.
Andrew

LisaM
Normal user
Posts: 494
Joined: 11 Apr 2017, 18:29

Re: uPyEasy v0.3.0 released

#5 Post by LisaM » 09 May 2018, 00:01

AndrewJ wrote:
08 May 2018, 23:01
Sorry, still getting problems.
This time all was stable until I clicked 'Submit' button at bottom of Hardware page, then I got...

Code: Select all

2018-05-08 21:56:48 [debug] uPyEasy-STM32_2: Pages: Entering Devices Page
2018-05-08 21:56:48 [debug] uPyEasy-STM32_2: Utils: uPyEasy Name
2018-05-08 21:56:48 [info] uPyEasy-STM32_2: 579131793.975 <HTTPRequest object at 20015260> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=34>> "GET /static/upyeasy.css"
static/upyeasy.css
2018-05-08 21:56:48 [info] uPyEasy-STM32_2: 579131793.975 <HTTPRequest object at 200082d0> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=33>> "GET /static/upyeasy.js"
static/upyeasy.js
2018-05-08 21:56:52 [info] uPyEasy-STM32_2: 579131841.659 <HTTPRequest object at 200122e0> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=27>> "GET /controllers"
2018-05-08 21:56:52 [debug] uPyEasy-STM32_2: Pages: Authorize User!?
2018-05-08 21:56:52 [debug] uPyEasy-STM32_2: Pages: Entering Controllers Page
2018-05-08 21:56:52 [debug] uPyEasy-STM32_2: Utils: uPyEasy Name
2018-05-08 21:56:52 [info] uPyEasy-STM32_2: 579131841.659 <HTTPRequest object at 20015630> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=34>> "GET /static/upyeasy.css"
static/upyeasy.css
2018-05-08 21:56:54 [info] uPyEasy-STM32_2: 579131841.659 <HTTPRequest object at 20017580> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=24>> "GET /hardware"
2018-05-08 21:56:54 [debug] uPyEasy-STM32_2: Pages: Authorize User!?
2018-05-08 21:56:54 [debug] uPyEasy-STM32_2: Pages GET: Display hardware Page
2018-05-08 21:56:54 [debug] uPyEasy-STM32_2: Utils: uPyEasy Name
2018-05-08 21:56:54 [info] uPyEasy-STM32_2: 579131841.659 <HTTPRequest object at 20017750> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=34>> "GET /static/upyeasy.css"
static/upyeasy.css
2018-05-08 21:57:15 [info] uPyEasy-STM32_2: 579131841.659 <HTTPRequest object at 20011580> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=25>> "POST /hardware"
2018-05-08 21:57:15 [debug] uPyEasy-STM32_2: Pages: Authorize User!?
2018-05-08 21:57:15 [debug] uPyEasy-STM32_2: Pages POST: Update hardware
2018-05-08 21:57:16 [debug] uPyEasy-STM32_2: Critical exception: MemoryError('memory allocation failed, allocating 848 bytes',) - message: 579131841.659 <HTTPRequest object at 20011580> <StreamWriter <socket state=2 timeout=0 incoming=0 off=0>> MemoryError('memory allocation failed, allocating 848 bytes',)

Hope this helps to track it down.
Andrew
Hi Andrew,

Looks like a memory issue, can you restart with upyeasy.main(loglevel=0)
That will tell us the memory free all the time.

Can you also goto tools/info? On the console a memory map should appear telling the memory allocation.

Cheers,

Lisa

AndrewJ
Normal user
Posts: 226
Joined: 14 Feb 2017, 12:38

Re: uPyEasy v0.3.0 released

#6 Post by AndrewJ » 09 May 2018, 10:45

LisaM wrote:
09 May 2018, 00:01

Hi Andrew,

Looks like a memory issue, can you restart with upyeasy.main(loglevel=0)
That will tell us the memory free all the time.

Can you also goto tools/info? On the console a memory map should appear telling the memory allocation.

Cheers,

Lisa
OK, thanks for the pointers, I'll try them later, probably this evening.

AndrewJ
Normal user
Posts: 226
Joined: 14 Feb 2017, 12:38

Re: uPyEasy v0.3.0 released

#7 Post by AndrewJ » 09 May 2018, 16:22

LisaM wrote:
09 May 2018, 00:01

Hi Andrew,

Looks like a memory issue, can you restart with upyeasy.main(loglevel=0)
That will tell us the memory free all the time.

Can you also goto tools/info? On the console a memory map should appear telling the memory allocation.

Cheers,

Lisa
OK, I reset the board and restarted uPyEasy with "import upyeasy", "upyeasy.main(loglevel=0)"
Now I get the GC MEM Free values, and a different error: "ValueError: syntax error in JSON".
Log attached below...

Code: Select all

>>>
>>> import upyeasy
>>> upyeasy.main(loglevel=0)
2018-05-09T15.0000002d:11:34.000 [debug] uPyEasy: Init: Init constructor
2018-05-09T15.0000002d:11:34.000 [debug] uPyEasy: GC MEM Free: 36,352
2018-05-09T15.0000002d:11:34.000 [debug] uPyEasy: Init: Entering init
2018-05-09T15.0000002d:11:34.000 [debug] uPyEasy: GC MEM Free: 36,240
2018-05-09 15:11:34 [debug] uPyEasy: Init: Create directory config
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 36,144
2018-05-09 15:11:34 [debug] uPyEasy: Init: Create directory config exception: OSError(17,)
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 35,952
2018-05-09 15:11:34 [debug] uPyEasy: Init: Create directory plugins
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 36,064
2018-05-09 15:11:34 [debug] uPyEasy: Init: Create directory plugins exception: OSError(17,)
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 35,952
2018-05-09 15:11:34 [debug] uPyEasy: Init: Create directory protocols
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 36,048
2018-05-09 15:11:34 [debug] uPyEasy: Init: Create directory protocols exception: OSError(17,)
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 35,952
2018-05-09 15:11:34 [debug] uPyEasy: Init: Create directory scripts
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 36,064
2018-05-09 15:11:34 [debug] uPyEasy: Init: Create directory scripts exception: OSError(17,)
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 35,952
2018-05-09 15:11:34 [debug] uPyEasy: Init: Create directory rules
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 36,064
2018-05-09 15:11:34 [debug] uPyEasy: Init: Create directory rules exception: OSError(17,)
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 35,952
2018-05-09 15:11:34 [debug] uPyEasy: Init: config Table
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 36,064
2018-05-09 15:11:34 [debug] uPyEasy: Init: network Table
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 35,856
2018-05-09 15:11:34 [debug] uPyEasy: Init: protocol Table
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 35,632
2018-05-09 15:11:34 [debug] uPyEasy: Init: controller Table
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 35,472
2018-05-09 15:11:34 [debug] uPyEasy: Init: hardware Table
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 35,264
2018-05-09 15:11:34 [debug] uPyEasy: Init: dxpin Table
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 34,368
2018-05-09 15:11:34 [debug] uPyEasy: Init: dxmap Table
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 33,840
2018-05-09 15:11:34 [debug] uPyEasy: Init: plugin Table
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 33,312
2018-05-09 15:11:34 [debug] uPyEasy: Init: pluginstore Table
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 33,088
2018-05-09 15:11:34 [debug] uPyEasy: Init: device Table
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 32,960
2018-05-09 15:11:34 [debug] uPyEasy: Init: service Table
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 32,640
2018-05-09 15:11:34 [debug] uPyEasy: Init: notification Table
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 32,480
2018-05-09 15:11:34 [debug] uPyEasy: Init: advanced Table
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 32,352
2018-05-09 15:11:34 [debug] uPyEasy: Init: script Table
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 32,016
2018-05-09 15:11:34 [debug] uPyEasy: Init: rule Table
2018-05-09 15:11:34 [debug] uPyEasy: GC MEM Free: 31,856
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "upyeasy/__init__.py", line 46, in main
  File "upyeasy/init.py", line 182, in init
  File "upyeasy/db.py", line 248, in getrow
  File "upyeasy/db.py", line 246, in getrow
  File "filedb.py", line 111, in get
  File "filedb.py", line 111, in get
ValueError: syntax error in JSON
>>> 
I tried again, same result. :cry:

LisaM
Normal user
Posts: 494
Joined: 11 Apr 2017, 18:29

Re: uPyEasy v0.3.0 released

#8 Post by LisaM » 09 May 2018, 17:48

Hi Andrew,

I just tried this and it's working at my stm32.
I think this is due to database changes, can you erase the stm32? (press and hold the reset button, press the user button until red en green are on and then let the reset button go).
Erasing also deletes the database, so if you have settings you want to keep/remember then save it first.

Cheers,

Lisa

AndrewJ
Normal user
Posts: 226
Joined: 14 Feb 2017, 12:38

Re: uPyEasy v0.3.0 released

#9 Post by AndrewJ » 09 May 2018, 22:43

LisaM wrote:
09 May 2018, 17:48
Hi Andrew,

I just tried this and it's working at my stm32.
I think this is due to database changes, can you erase the stm32? (press and hold the reset button, press the user button until red en green are on and then let the reset button go).
Erasing also deletes the database, so if you have settings you want to keep/remember then save it first.

Cheers,

Lisa
Hi Lisa,
I think I must be doing something wrong with the erase procedure. I never get red and green together on my boards while holding the reset and the user button - I've waited over a minute. One one of my STM32 boards the red is lit while holding; on the other board no LED. When I release RST I get a quick flash of the green LED, but when I look in config there are still details there which I entered before, so it looks as if it is not erased.
My boards are like this
https://www.aliexpress.com/item/STM32-S ... 0.0.pdUNhD
Help please?!

Cheers
Andrew

LisaM
Normal user
Posts: 494
Joined: 11 Apr 2017, 18:29

Re: uPyEasy v0.3.0 released

#10 Post by LisaM » 10 May 2018, 17:17

AndrewJ wrote:
09 May 2018, 22:43
Hi Lisa,
I think I must be doing something wrong with the erase procedure. I never get red and green together on my boards while holding the reset and the user button - I've waited over a minute. One one of my STM32 boards the red is lit while holding; on the other board no LED. When I release RST I get a quick flash of the green LED, but when I look in config there are still details there which I entered before, so it looks as if it is not erased.
My boards are like this
https://www.aliexpress.com/item/STM32-S ... 0.0.pdUNhD
Help please?!

Cheers
Andrew
I have the same one.
With the micro-usb connector below the two buttons, press and hold the right button (the one with K2 written on the board). While you hold the K2 button, the leds cycle: only red on, only green on, red and green on, etc. Wait until both red and green leds are on, then let go of K2. The blue led should be going on and off marking the erasure of the stm32 flash area (not firmware!), while red and green are on. After a minute or so, the blue light goes off and the green on. Then press and hold the reset button (K2) again until only the green led is on and let go of K2.

Efficient, but complicated i have to admit...

Ps. if you want to see what has been changed after a git pull: git log -5 (5 last log entries)

Cheers,

Lisa

AndrewJ
Normal user
Posts: 226
Joined: 14 Feb 2017, 12:38

Re: uPyEasy v0.3.0 released

#11 Post by AndrewJ » 11 May 2018, 21:03

LisaM wrote:
10 May 2018, 17:17

I have the same one.
With the micro-usb connector below the two buttons, press and hold the right button (the one with K2 written on the board). While you hold the K2 button, the leds cycle: only red on, only green on, red and green on, etc. Wait until both red and green leds are on, then let go of K2. The blue led should be going on and off marking the erasure of the stm32 flash area (not firmware!), while red and green are on. After a minute or so, the blue light goes off and the green on. Then press and hold the reset button (K2) again until only the green led is on and let go of K2.

Efficient, but complicated i have to admit...

Ps. if you want to see what has been changed after a git pull: git log -5 (5 last log entries)

Cheers,

Lisa
I'm beginning to think that both my boards may be faulty. With one board, pressing and holding K2 gives a constant red LED which does not change. On the other board, no LED is lit while pressing K2.
I had to repair both boards a while back because the USB cable had strained the micro USB sockets and made the connection erratic. It may be that some part of the connection is still not good.
Another thought - do you know of a way to download a "blank" file to STM32, similar to make erase on ESP32? I've tried googling but not found anything.

Cheers
Andrew

LisaM
Normal user
Posts: 494
Joined: 11 Apr 2017, 18:29

Re: uPyEasy v0.3.0 released

#12 Post by LisaM » 11 May 2018, 21:18

AndrewJ wrote:
11 May 2018, 21:03
Another thought - do you know of a way to download a "blank" file to STM32, similar to make erase on ESP32? I've tried googling but not found anything.
dfu-util -s :mass-erase:force -a 0 -d 0483:df11 -D upyeasy_v030_20180506_test_stm32-pybv3_1024.dfu

That should do the trick: first it will erase the STM32F405 and then flash the new firmware.

Cheers,

Lisa

AndrewJ
Normal user
Posts: 226
Joined: 14 Feb 2017, 12:38

Re: uPyEasy v0.3.0 released

#13 Post by AndrewJ » 11 May 2018, 21:49

LisaM wrote:
11 May 2018, 21:18
AndrewJ wrote:
11 May 2018, 21:03
Another thought - do you know of a way to download a "blank" file to STM32, similar to make erase on ESP32? I've tried googling but not found anything.
dfu-util -s :mass-erase:force -a 0 -d 0483:df11 -D upyeasy_v030_20180506_test_stm32-pybv3_1024.dfu

That should do the trick: first it will erase the STM32F405 and then flash the new firmware.

Cheers,

Lisa
Hi Lisa
Thanks for the quick reply. I'll try that - probably tomorrow or Sunday.
Andrew

LisaM
Normal user
Posts: 494
Joined: 11 Apr 2017, 18:29

Re: uPyEasy v0.3.0 released

#14 Post by LisaM » 12 May 2018, 02:56

You will be probably one of the first to try out the new REST interface, it will mark a departure from ESPEasy's web-based UI. ESPEasy does have way more plugins, but uPyEasy has a much better and modern architecture which is now benefiting us for switching to the REST client-server setup.
If you look at the pages.py file, you'll see some significant changes already including two new DELETE rest api's already active... ;)
The client side for controller/device delete's is now different to, which you can see at controllers.html en devices.html
Going bootstrap is the next step...

AndrewJ
Normal user
Posts: 226
Joined: 14 Feb 2017, 12:38

Re: uPyEasy v0.3.0 released

#15 Post by AndrewJ » 17 May 2018, 19:21

LisaM wrote:
12 May 2018, 02:56
You will be probably one of the first to try out the new REST interface, it will mark a departure from ESPEasy's web-based UI. ESPEasy does have way more plugins, but uPyEasy has a much better and modern architecture which is now benefiting us for switching to the REST client-server setup.
If you look at the pages.py file, you'll see some significant changes already including two new DELETE rest api's already active... ;)
The client side for controller/device delete's is now different to, which you can see at controllers.html en devices.html
Going bootstrap is the next step...
Hi Lisa
I've come back onto this today after a break as my mum died recently.
I found the latest update on Github (cf2bca9) and updated it to my local repo (the new filesystem). Did sudo make ..... deploy for stm32 (Ali pyboard clone). First time I hadn't erased the flash so I went back and did that (I think I've got the hang of that now).
But when I do import upyeasy, upyeasy.main(loglevel=0) I get this...

Code: Select all

2018-05-17 18:08:52 [debug] uPyEasy: GC MEM Free: 31,664
2018-05-17 18:08:54 [debug] uPyEasy: Init: Create dxpin Record
2018-05-17 18:08:54 [debug] uPyEasy: GC MEM Free: 31,664
2018-05-17 18:08:55 [debug] uPyEasy: Init: Create dxmap Record
2018-05-17 18:08:55 [debug] uPyEasy: GC MEM Free: 31,712
2018-05-17 18:08:55 [debug] uPyEasy: Hal: dxmaps_init
2018-05-17 18:08:55 [debug] uPyEasy: GC MEM Free: 31,456
2018-05-17 18:08:55 [debug] uPyEasy: Hal: dxmaps_init pyboard
2018-05-17 18:08:55 [debug] uPyEasy: GC MEM Free: 31,456
2018-05-17 18:08:55 [debug] uPyEasy: Hal: board info
2018-05-17 18:08:55 [debug] uPyEasy: GC MEM Free: 31,472
2018-05-17 18:08:55 [debug] uPyEasy: Hal: board pyboard
2018-05-17 18:08:55 [debug] uPyEasy: GC MEM Free: 31,456
2018-05-17 18:08:55 [debug] uPyEasy: STM32: init_pindb
2018-05-17 18:08:55 [debug] uPyEasy: GC MEM Free: 30,752
2018-05-17 18:08:56 [debug] uPyEasy: Init: Create advanced Record
2018-05-17 18:08:56 [debug] uPyEasy: GC MEM Free: 31,376
2018-05-17 18:08:57 [debug] uPyEasy: Hal: Init
2018-05-17 18:08:57 [debug] uPyEasy: GC MEM Free: 31,312
2018-05-17 18:08:57 [debug] uPyEasy: Hal: init, network record present
2018-05-17 18:08:57 [debug] uPyEasy: GC MEM Free: 31,040
2018-05-17 18:08:57 [debug] uPyEasy: Hal: pyboard
2018-05-17 18:08:57 [debug] uPyEasy: GC MEM Free: 31,072
2018-05-17 18:08:57 [debug] uPyEasy: Hal: board info
2018-05-17 18:08:57 [debug] uPyEasy: GC MEM Free: 31,072
2018-05-17 18:08:57 [debug] uPyEasy: Hal: board pyboard
2018-05-17 18:08:57 [debug] uPyEasy: GC MEM Free: 31,056
Traceback (most recent call last):
  File "ulog.py", line 110, in do_log
  File "syslog_sink.py", line 76, in log
  File "usyslog.py", line 72, in warning
  File "usyslog.py", line 82, in log
OSError: [Errno 113] EHOSTUNREACH
2018-05-17 18:08:57 [warning] uPyEasy: Hal: pyboard, spi is empty: trying default!
2018-05-17 18:08:57 [warning] uPyEasy: GC MEM Free: 30,928

At the end it just freezes.

I also tried import upyeasy, upyeasy.main() and got...

Code: Select all

>> 
>>> import upyeasy
>>> 
>>> dir()
['machine', 'upyeasy', '__name__', 'pyb']
>>> upyeasy.main()
Traceback (most recent call last):
  File "ulog.py", line 110, in do_log
  File "syslog_sink.py", line 76, in log
  File "usyslog.py", line 72, in warning
  File "usyslog.py", line 82, in log
OSError: [Errno 113] EHOSTUNREACH
2018-05-17 18:17:40 [warning] uPyEasy: Hal: pyboard, spi is empty: trying default!

and again it got stuck.
I'm baffled - have you any ideas what might be wrong please?
Cheers
Andrew

LisaM
Normal user
Posts: 494
Joined: 11 Apr 2017, 18:29

Re: uPyEasy v0.3.0 released

#16 Post by LisaM » 19 May 2018, 14:42

AndrewJ wrote:
17 May 2018, 19:21

Code: Select all

>> 
>>> import upyeasy
>>> 
>>> dir()
['machine', 'upyeasy', '__name__', 'pyb']
>>> upyeasy.main()
Traceback (most recent call last):
  File "ulog.py", line 110, in do_log
  File "syslog_sink.py", line 76, in log
  File "usyslog.py", line 72, in warning
  File "usyslog.py", line 82, in log
OSError: [Errno 113] EHOSTUNREACH
2018-05-17 18:17:40 [warning] uPyEasy: Hal: pyboard, spi is empty: trying default!

and again it got stuck.
I'm baffled - have you any ideas what might be wrong please?
Cheers
Andrew
Hi Andrew,

If you haven't done

Code: Select all

upyeasy.setnet(1,'A3','A4','<SOC IP ADDRESS>', '<GATEWAY IP ADDRESS>', '255.255.255.0', '<DNS SVR IP ADDRESS>')
then uPyEasy on STM32 will try to use DHCP to get an ip-address. However sometimes it just waits forever to get one and it never does end.

If you haven't used the setnet command, please try to use that. Just do a ctrl-c before this point and enter the setnet command.

It also might be a wiring problem, please check if some wires are not connected anymore.

Cheers,

Lsia

AndrewJ
Normal user
Posts: 226
Joined: 14 Feb 2017, 12:38

Re: uPyEasy v0.3.0 released

#17 Post by AndrewJ » 19 May 2018, 19:24

LisaM wrote:
19 May 2018, 14:42

Hi Andrew,

If you haven't done

Code: Select all

upyeasy.setnet(1,'A3','A4','<SOC IP ADDRESS>', '<GATEWAY IP ADDRESS>', '255.255.255.0', '<DNS SVR IP ADDRESS>')
then uPyEasy on STM32 will try to use DHCP to get an ip-address. However sometimes it just waits forever to get one and it never does end.

If you haven't used the setnet command, please try to use that. Just do a ctrl-c before this point and enter the setnet command.

It also might be a wiring problem, please check if some wires are not connected anymore.

Cheers,

Lsia
Thanks Lisa. I hadn't previously done upyeasy.setnet... so I did that this time and it went further, but eventually got stuck again. Here is the log...

Code: Select all

>>> upyeasy.setnet(1,'A3','A4','102.168.1.78', '192.168.1.1', '255.255.255.0', '192.168.1.1'                                                                    ... )                                                                                                                                                           >>>                                                                                                                                                             >>>                                                                                                                                                             >>> upyeasy.main(loglevel=0)                                                                                                                                    loaded sink console                                                                                                                                             2018-05-19T17.0000002d:51:45.004 [debug] uPyEasy: Init: Init constructor                                                                                        2018-05-19T17.0000002d:51:45.004 [debug] uPyEasy: GC MEM Free: 30,944                                                                                           2018-05-19T17.0000002d:51:45.004 [debug] uPyEasy: Init: Entering init                                                                                           2018-05-19T17.0000002d:51:45.004 [debug] uPyEasy: GC MEM Free: 30,832                                                                                           2018-05-19 17:51:45 [debug] uPyEasy: Init: Create directory config                                                                                              2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,736                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: Create directory config exception: OSError(17,)                                                                      2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,544                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: Create directory plugins                                                                                             2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: Create directory plugins exception: OSError(17,)                                                                     2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,544                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: Create directory protocols                                                                                           2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,640                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: Create directory protocols exception: OSError(17,)                                                                   2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,544                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: Create directory scripts                                                                                             2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: Create directory scripts exception: OSError(17,)                                                                     2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,544                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: Create directory rules                                                                                               2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: Create directory rules exception: OSError(17,)                                                                       2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,544                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: config Table                                                                                                         2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: network Table                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: protocol Table                                                                                                       2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: controller Table                                                                                                     2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: hardware Table                                                                                                       2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: dxpin Table                                                                                                          2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: dxmap Table                                                                                                          2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: plugin Table                                                                                                         2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: pluginstore Table                                                                                                    2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: device Table                                                                                                         2018-05-19 17:51:46 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:46 [debug] uPyEasy: Init: service Table                                                                                                        2018-05-19 17:51:46 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:46 [debug] uPyEasy: Init: notification Table                                                                                                   2018-05-19 17:51:46 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:46 [debug] uPyEasy: Init: advanced Table                                                                                                       2018-05-19 17:51:46 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:46 [debug] uPyEasy: Init: script Table                                                                                                         2018-05-19 17:51:46 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:46 [debug] uPyEasy: Init: rule Table                                                                                                           2018-05-19 17:51:46 [debug] uPyEasy: GC MEM Free: 30,640                                                                                                        2018-05-19 17:51:46 [debug] uPyEasy: Hal: Init                                                                                                                  2018-05-19 17:51:46 [debug] uPyEasy: GC MEM Free: 27,424                   
I've checked the wiring and it looks ok to me.
Can you offer any more suggestions to debug this, please?
Cheers,
Andrew.

AndrewJ
Normal user
Posts: 226
Joined: 14 Feb 2017, 12:38

Re: uPyEasy v0.3.0 released

#18 Post by AndrewJ » 19 May 2018, 22:14

AndrewJ wrote:
19 May 2018, 19:24
LisaM wrote:
19 May 2018, 14:42

Hi Andrew,

If you haven't done

Code: Select all

upyeasy.setnet(1,'A3','A4','<SOC IP ADDRESS>', '<GATEWAY IP ADDRESS>', '255.255.255.0', '<DNS SVR IP ADDRESS>')
then uPyEasy on STM32 will try to use DHCP to get an ip-address. However sometimes it just waits forever to get one and it never does end.

If you haven't used the setnet command, please try to use that. Just do a ctrl-c before this point and enter the setnet command.

It also might be a wiring problem, please check if some wires are not connected anymore.

Cheers,

Lsia
Thanks Lisa. I hadn't previously done upyeasy.setnet... so I did that this time and it went further, but eventually got stuck again. Here is the log...

Code: Select all

>>> upyeasy.setnet(1,'A3','A4','102.168.1.78', '192.168.1.1', '255.255.255.0', '192.168.1.1'                                                                    ... )                                                                                                                                                           >>>                                                                                                                                                             >>>                                                                                                                                                             >>> upyeasy.main(loglevel=0)                                                                                                                                    loaded sink console                                                                                                                                             2018-05-19T17.0000002d:51:45.004 [debug] uPyEasy: Init: Init constructor                                                                                        2018-05-19T17.0000002d:51:45.004 [debug] uPyEasy: GC MEM Free: 30,944                                                                                           2018-05-19T17.0000002d:51:45.004 [debug] uPyEasy: Init: Entering init                                                                                           2018-05-19T17.0000002d:51:45.004 [debug] uPyEasy: GC MEM Free: 30,832                                                                                           2018-05-19 17:51:45 [debug] uPyEasy: Init: Create directory config                                                                                              2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,736                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: Create directory config exception: OSError(17,)                                                                      2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,544                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: Create directory plugins                                                                                             2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: Create directory plugins exception: OSError(17,)                                                                     2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,544                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: Create directory protocols                                                                                           2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,640                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: Create directory protocols exception: OSError(17,)                                                                   2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,544                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: Create directory scripts                                                                                             2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: Create directory scripts exception: OSError(17,)                                                                     2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,544                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: Create directory rules                                                                                               2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: Create directory rules exception: OSError(17,)                                                                       2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,544                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: config Table                                                                                                         2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: network Table                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: protocol Table                                                                                                       2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: controller Table                                                                                                     2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: hardware Table                                                                                                       2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: dxpin Table                                                                                                          2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: dxmap Table                                                                                                          2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: plugin Table                                                                                                         2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: pluginstore Table                                                                                                    2018-05-19 17:51:45 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:45 [debug] uPyEasy: Init: device Table                                                                                                         2018-05-19 17:51:46 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:46 [debug] uPyEasy: Init: service Table                                                                                                        2018-05-19 17:51:46 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:46 [debug] uPyEasy: Init: notification Table                                                                                                   2018-05-19 17:51:46 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:46 [debug] uPyEasy: Init: advanced Table                                                                                                       2018-05-19 17:51:46 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:46 [debug] uPyEasy: Init: script Table                                                                                                         2018-05-19 17:51:46 [debug] uPyEasy: GC MEM Free: 30,656                                                                                                        2018-05-19 17:51:46 [debug] uPyEasy: Init: rule Table                                                                                                           2018-05-19 17:51:46 [debug] uPyEasy: GC MEM Free: 30,640                                                                                                        2018-05-19 17:51:46 [debug] uPyEasy: Hal: Init                                                                                                                  2018-05-19 17:51:46 [debug] uPyEasy: GC MEM Free: 27,424                   
I've checked the wiring and it looks ok to me.
Can you offer any more suggestions to debug this, please?
Cheers,
Andrew.
Oh dear, I should have checked wiring better first time! :oops:
It turned out that one of the Dupont wire connections between the STM32 board and the Wiznet 5500 was slightly loose. When I replaced it with a new one, and tried again from the start (right back to erasing flash then doing make.....deploy) -- it's working, and I can connect with my browser!! :D
No sensors connected at present, I'll test further.

Cheers
Andrew
(I'm using cf3bca9 from Github).

AndrewJ
Normal user
Posts: 226
Joined: 14 Feb 2017, 12:38

Re: uPyEasy v0.3.0 released

#19 Post by AndrewJ » 20 May 2018, 20:52

it's working, and I can connect with my browser!! :D
No sensors connected at present, I'll test further.

Cheers
Andrew
(I'm using cf3bca9 from Github).
Hi Lisa,
If I go to the Controllers screen in the browser, and try to Add a controller, the screen just stays blank, with no list of controllers to select from. (I can still get to other screens if I click on their tab). Here is the log - nothing that seems very helpful!

Code: Select all

>>> import upyeasy
>>> upyeasy.main()
Traceback (most recent call last):
  File "ulog.py", line 110, in do_log
  File "syslog_sink.py", line 76, in log
  File "usyslog.py", line 72, in warning
  File "usyslog.py", line 82, in log
OSError: [Errno 113] EHOSTUNREACH
2018-05-20 19:37:25 [warning] uPyEasy: Hal: pyboard, spi is empty: trying default!
2018-05-20 19:37:37 [info] uPyEasy-STM32_2: Main: uPyEasy running in Ethernet mode
2018-05-20 19:37:37 [info] uPyEasy-STM32_2: Main: uPyEasy Main Async Loop on IP adress: 192.168.1.5:80
2018-05-20 19:37:53 [info] uPyEasy-STM32_2: 580160236.358 <HTTPRequest object at 20011f70> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=16>> "GET /"
2018-05-20 19:37:53 [info] uPyEasy-STM32_2: 580160236.358 <HTTPRequest object at 20019250> <StreamWriter <socket state=2 timeout=0 incoming=20003f34 off=33>> "GET /static/upyeasy.js"
2018-05-20 19:37:53 [info] uPyEasy-STM32_2: 580160236.358 <HTTPRequest object at 20019b70> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=34>> "GET /static/upyeasy.css"
2018-05-20 19:38:05 [info] uPyEasy-STM32_2: 580160236.358 <HTTPRequest object at 20008340> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=22>> "GET /config"
2018-05-20 19:38:06 [info] uPyEasy-STM32_2: 580160236.358 <HTTPRequest object at 20014fe0> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=34>> "GET /static/upyeasy.css"
2018-05-20 19:38:06 [info] uPyEasy-STM32_2: 580160236.358 <HTTPRequest object at 2001a610> <StreamWriter <socket state=2 timeout=0 incoming=20003f34 off=33>> "GET /static/upyeasy.js"
2018-05-20 19:38:15 [info] uPyEasy-STM32_2: 580160331.726 <HTTPRequest object at 200136f0> <StreamWriter <socket state=2 timeout=0 incoming=20003f34 off=27>> "GET /controllers"
2018-05-20 19:38:15 [info] uPyEasy-STM32_2: 580160331.726 <HTTPRequest object at 200180c0> <StreamWriter <socket state=2 timeout=0 incoming=20003f34 off=34>> "GET /static/upyeasy.css"
2018-05-20 19:38:15 [info] uPyEasy-STM32_2: 580160331.726 <HTTPRequest object at 20019930> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=33>> "GET /static/upyeasy.js"
2018-05-20 19:38:40 [info] uPyEasy-STM32_2: 580160331.726 <HTTPRequest object at 20017270> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=39>> "GET /controller_setting?id=0"
2018-05-20 19:38:40 [info] uPyEasy-STM32_2: 580160331.726 <HTTPRequest object at 20019530> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=34>> "GET /static/upyeasy.css"
2018-05-20 19:38:40 [info] uPyEasy-STM32_2: 580160331.726 <HTTPRequest object at 20019d60> <StreamWriter <socket state=2 timeout=0 incoming=20003f34 off=33>> "GET /static/upyeasy.js"

Tried again with loglevel=0 ....

Code: Select all

  (some lines lost)
2018-05-20 19:44:08 [debug] uPyEasy: Hal: pyboard
2018-05-20 19:44:08 [debug] uPyEasy: GC MEM Free: 29,088
2018-05-20 19:44:08 [debug] uPyEasy: Hal: board info
2018-05-20 19:44:08 [debug] uPyEasy: GC MEM Free: 29,088
2018-05-20 19:44:08 [debug] uPyEasy: Hal: board pyboard
2018-05-20 19:44:08 [debug] uPyEasy: GC MEM Free: 29,072
Traceback (most recent call last):
  File "ulog.py", line 110, in do_log
  File "syslog_sink.py", line 76, in log
  File "usyslog.py", line 72, in warning
  File "usyslog.py", line 82, in log
OSError: [Errno 113] EHOSTUNREACH
2018-05-20 19:44:08 [warning] uPyEasy: Hal: pyboard, spi is empty: trying default!
2018-05-20 19:44:08 [warning] uPyEasy: GC MEM Free: 28,944
2018-05-20 19:44:18 [debug] uPyEasy: Hal: pyboard, ip: 192.168.1.5
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 28,880
2018-05-20 19:44:18 [debug] uPyEasy: Hal: nic present
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 28,928
2018-05-20 19:44:18 [debug] uPyEasy: Protocols: Load
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 29,264
2018-05-20 19:44:18 [debug] uPyEasy: Protocols: Init protocol records
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 28,784
2018-05-20 19:44:18 [debug] uPyEasy: Protocols: Protocol record found: Domoticz HTTP
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 28,016
2018-05-20 19:44:18 [debug] uPyEasy: Protocols: Protocol record found: OpenHab MQTT
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 28,016
2018-05-20 19:44:18 [debug] uPyEasy: Protocols: Protocol record found: Domoticz MQTT
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 28,016
2018-05-20 19:44:18 [debug] uPyEasy: Plugins: Load
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 28,944
2018-05-20 19:44:18 [debug] uPyEasy: Plugins: Init plugin records
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 28,656
2018-05-20 19:44:18 [debug] uPyEasy: Plugins: Plugin record found: SSD1306
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 27,280
2018-05-20 19:44:18 [debug] uPyEasy: Plugins: Plugin record found: Switch
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 27,280
2018-05-20 19:44:18 [debug] uPyEasy: Plugins: Plugin record found: DS18B20
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 27,280
2018-05-20 19:44:18 [debug] uPyEasy: Plugins: Plugin record found: Test
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 27,280
2018-05-20 19:44:18 [debug] uPyEasy: Plugins: Plugin record found: BME280
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 27,280
2018-05-20 19:44:18 [debug] uPyEasy: Scripts: Load
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 28,688
2018-05-20 19:44:18 [debug] uPyEasy: Scripts: Init
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 28,592
2018-05-20 19:44:18 [debug] uPyEasy: Plugins: GetQueue
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 28,576
2018-05-20 19:44:18 [debug] uPyEasy: Scripts: init scripts records
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 28,304
2018-05-20 19:44:18 [debug] uPyEasy: Scripts: init rules records
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 28,240
2018-05-20 19:44:18 [debug] uPyEasy: Utils: Sys hostname
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 27,968
2018-05-20 19:44:18 [debug] uPyEasy: Utils: uPyEasy Name
2018-05-20 19:44:18 [debug] uPyEasy: GC MEM Free: 28,384
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: Set syslog hostname 0.0.0.0
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: GC MEM Free: 28,160
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: reloaded sink syslog
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: GC MEM Free: 27,584
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: Hal: Entering SetTime
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: GC MEM Free: 28,448
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: Hal: Entering GetNtpTime
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: GC MEM Free: 28,288
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: Hal: network Table
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: GC MEM Free: 28,304
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: Hal: Using NTP Hostname: pool.ntp.org
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: GC MEM Free: 27,808
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: Hal: TimeZome offset: 60
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: GC MEM Free: 27,840
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: Hal: Received UTC NTP Time: 580157059
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: GC MEM Free: 27,488
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: Hal: Timezone corrected NTP Time: 580160659
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: GC MEM Free: 27,488
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: Hal: DST corrected NTP Time: 580160659
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: GC MEM Free: 27,488
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: Hal: Received NTP Time: 580160659
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: GC MEM Free: 28,336
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: Hal: StartTime: 580160659
2018-05-20 19:44:18 [debug] uPyEasy-STM32_2: GC MEM Free: 28,368
2018-05-20 19:44:19 [info] uPyEasy-STM32_2: Main: uPyEasy running in Ethernet mode
2018-05-20 19:44:19 [info] uPyEasy-STM32_2: GC MEM Free: 24,896
2018-05-20 19:44:19 [debug] uPyEasy-STM32_2: Hal: get_ip_address pyboard, ip: 192.168.1.5
2018-05-20 19:44:19 [debug] uPyEasy-STM32_2: GC MEM Free: 24,720
2018-05-20 19:44:19 [debug] uPyEasy-STM32_2: Main: Schedule async loops
2018-05-20 19:44:19 [debug] uPyEasy-STM32_2: GC MEM Free: 24,880
2018-05-20 19:44:19 [info] uPyEasy-STM32_2: Main: uPyEasy Main Async Loop on IP adress: 192.168.1.5:80
2018-05-20 19:44:19 [info] uPyEasy-STM32_2: GC MEM Free: 24,224
2018-05-20 19:44:19 [debug] uPyEasy-STM32_2: Protocols: Async processing protocols
2018-05-20 19:44:19 [debug] uPyEasy-STM32_2: GC MEM Free: 24,048
2018-05-20 19:44:19 [debug] uPyEasy-STM32_2: Plugins: Async processing plugins
2018-05-20 19:44:19 [debug] uPyEasy-STM32_2: GC MEM Free: 23,248
2018-05-20 19:44:19 [debug] uPyEasy-STM32_2: Scripts: Async processing scripts/rules
2018-05-20 19:44:19 [debug] uPyEasy-STM32_2: GC MEM Free: 22,016

Then when I try to add a controller....

Code: Select all

2018-05-20 19:47:34 [debug] uPyEasy-STM32_2: Scripts: Async processing scripts/rules
2018-05-20 19:47:34 [debug] uPyEasy-STM32_2: GC MEM Free: 22,048
2018-05-20 19:47:49 [info] uPyEasy-STM32_2: 580160903.930 <HTTPRequest object at 2000d670> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=16>> "GET /"
2018-05-20 19:47:49 [info] uPyEasy-STM32_2: GC MEM Free: 20,960
2018-05-20 19:47:49 [debug] uPyEasy-STM32_2: Pages: Authorized User?
2018-05-20 19:47:49 [debug] uPyEasy-STM32_2: GC MEM Free: 20,256
2018-05-20 19:47:49 [debug] uPyEasy-STM32_2: Pages GET: Entering Home Page
2018-05-20 19:47:49 [debug] uPyEasy-STM32_2: GC MEM Free: 20,256
2018-05-20 19:47:49 [debug] uPyEasy-STM32_2: Pages: Home Page Station mode
2018-05-20 19:47:49 [debug] uPyEasy-STM32_2: GC MEM Free: 20,048
2018-05-20 19:47:49 [debug] uPyEasy-STM32_2: Utils: uPyEasy Name
2018-05-20 19:47:49 [debug] uPyEasy-STM32_2: GC MEM Free: 20,032
2018-05-20 19:47:49 [debug] uPyEasy-STM32_2: Utils: Unit Number
2018-05-20 19:47:49 [debug] uPyEasy-STM32_2: GC MEM Free: 19,920
2018-05-20 19:47:49 [debug] uPyEasy-STM32_2: Hal: Getting local time in seconds
2018-05-20 19:47:49 [debug] uPyEasy-STM32_2: GC MEM Free: 19,808
2018-05-20 19:47:49 [debug] uPyEasy-STM32_2: Hal: get_ip_address pyboard, ip: 192.168.1.5
2018-05-20 19:47:49 [debug] uPyEasy-STM32_2: GC MEM Free: 19,632
2018-05-20 19:47:49 [debug] uPyEasy-STM32_2: Pages: Home Page Data collected
2018-05-20 19:47:49 [debug] uPyEasy-STM32_2: GC MEM Free: 19,776
2018-05-20 19:47:49 [info] uPyEasy-STM32_2: 580160903.930 <HTTPRequest object at 20018dc0> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=34>> "GET /static/upyeasy.css"
2018-05-20 19:47:49 [info] uPyEasy-STM32_2: GC MEM Free: 19,632
2018-05-20 19:47:49 [info] uPyEasy-STM32_2: 580160903.930 <HTTPRequest object at 20010670> <StreamWriter <socket state=2 timeout=0 incoming=20003f34 off=33>> "GET /static/upyeasy.js"
2018-05-20 19:47:49 [info] uPyEasy-STM32_2: GC MEM Free: 19,104
2018-05-20 19:48:01 [info] uPyEasy-STM32_2: 580160903.930 <HTTPRequest object at 2000f4a0> <StreamWriter <socket state=2 timeout=0 incoming=20003f34 off=27>> "GET /controllers"
2018-05-20 19:48:01 [info] uPyEasy-STM32_2: GC MEM Free: 19,072
2018-05-20 19:48:01 [debug] uPyEasy-STM32_2: Pages: Authorized User?
2018-05-20 19:48:01 [debug] uPyEasy-STM32_2: GC MEM Free: 18,464
2018-05-20 19:48:01 [debug] uPyEasy-STM32_2: Pages: Entering Controllers Page
2018-05-20 19:48:01 [debug] uPyEasy-STM32_2: GC MEM Free: 18,448
2018-05-20 19:48:01 [debug] uPyEasy-STM32_2: Utils: uPyEasy Name
2018-05-20 19:48:01 [debug] uPyEasy-STM32_2: GC MEM Free: 18,448
2018-05-20 19:48:01 [info] uPyEasy-STM32_2: 580160903.930 <HTTPRequest object at 20018cb0> <StreamWriter <socket state=2 timeout=0 incoming=20003f34 off=34>> "GET /static/upyeasy.css"
2018-05-20 19:48:01 [info] uPyEasy-STM32_2: GC MEM Free: 18,496
2018-05-20 19:48:01 [info] uPyEasy-STM32_2: 580160903.930 <HTTPRequest object at 20010c10> <StreamWriter <socket state=2 timeout=0 incoming=20004192 off=33>> "GET /static/upyeasy.js"
2018-05-20 19:48:01 [info] uPyEasy-STM32_2: GC MEM Free: 17,968

Can you see what is going wrong :?:
Cheers
Andrew

AndrewJ
Normal user
Posts: 226
Joined: 14 Feb 2017, 12:38

Re: uPyEasy v0.3.0 released

#20 Post by AndrewJ » 28 May 2018, 21:58

Hi Lisa,
I see on Github that you've been hard at work on a new update (9ebffbd) of uPyEasy!! Thank you for all your effort on this project!

I'm still keen to get uPyEasy working on my STM32F405 AliExpress clones, or at least the one which still seems to work reliably.
So I updated my local repo and set about building the firmware.

Initially I had errors from a couple of "missing" files in the /unix directory (copy.py and types.py) which I was able to fix, also I needed to create new links for these into my micropython-stm32 file system before it would work.

uPyEasy then started up ok and ran for a short time. Some screens are working (MaIn, Config, Hardware - Hardware is much more responsive! But i did find some issues....
- uptime is a large negative number of days, and some hours and minutes, bit of a time-warp
- Controller page: I tried 'Add' but got a blank browser screen, and in the log a Critical exception OSError(2)
- Devices: I got the first bit, to select a plugin, but clicking Submit gave an error "connection reset" and in the log NameError ('local variable rererenced before assignment')
- Advanced: tried to change NTP, Submit gave a MemoryError. It seems to be gradually using up the memory while in use.

Please keep up the good work!! I'm really keen to have a working Ethernet device, as potentially it should be faster and more reliable than wifi. Is there anything I can do to help?

Cheers
Andrew

LisaM
Normal user
Posts: 494
Joined: 11 Apr 2017, 18:29

Re: uPyEasy v0.3.0 released

#21 Post by LisaM » 01 Jun 2018, 18:31

AndrewJ wrote:
28 May 2018, 21:58
Hi Lisa,
I see on Github that you've been hard at work on a new update (9ebffbd) of uPyEasy!! Thank you for all your effort on this project!

I'm still keen to get uPyEasy working on my STM32F405 AliExpress clones, or at least the one which still seems to work reliably.
So I updated my local repo and set about building the firmware.

Initially I had errors from a couple of "missing" files in the /unix directory (copy.py and types.py) which I was able to fix, also I needed to create new links for these into my micropython-stm32 file system before it would work.

uPyEasy then started up ok and ran for a short time. Some screens are working (MaIn, Config, Hardware - Hardware is much more responsive! But i did find some issues....
- uptime is a large negative number of days, and some hours and minutes, bit of a time-warp
- Controller page: I tried 'Add' but got a blank browser screen, and in the log a Critical exception OSError(2)
- Devices: I got the first bit, to select a plugin, but clicking Submit gave an error "connection reset" and in the log NameError ('local variable rererenced before assignment')
- Advanced: tried to change NTP, Submit gave a MemoryError. It seems to be gradually using up the memory while in use.

Please keep up the good work!! I'm really keen to have a working Ethernet device, as potentially it should be faster and more reliable than wifi. Is there anything I can do to help?

Cheers
Andrew
Several bug fixes later...
I have everything working on my side, the source has been updated to 000df1a. Please update your side and try again.

But.. i do have some of the same memory problems as you have. If running on a stm32, please run it using: upyeasy.main(loglevel=0) and keep an eye on the memory!
If the memory level drops to about 7-8K, then you might start getting memory errors due to memory fragmentation. Workaround is to do a single action, like adding a controller, and then reboot.
This is happening due to the new deepcopy's (although now replaced in some parts by ordereddict init's) which make things more reliable but also consume more memory. I need to do a second round of memory optimization to free up memory.
A memory map can be seen when clicking on tools/info menu in the browser, then on your usb console a complete memory map is appearing when running in debug mode!

I'm not going to able to fix the memory problems shortly, due to the fact that i'm back home to the good old USA for the next few weeks.

AndrewJ
Normal user
Posts: 226
Joined: 14 Feb 2017, 12:38

Re: uPyEasy v0.3.0 released

#22 Post by AndrewJ » 02 Jun 2018, 12:32

LisaM wrote:
01 Jun 2018, 18:31
AndrewJ wrote:
28 May 2018, 21:58
Hi Lisa,
I see on Github that you've been hard at work on a new update (9ebffbd) of uPyEasy!! Thank you for all your effort on this project!

I'm still keen to get uPyEasy working on my STM32F405 AliExpress clones, or at least the one which still seems to work reliably.
So I updated my local repo and set about building the firmware.

Initially I had errors from a couple of "missing" files in the /unix directory (copy.py and types.py) which I was able to fix, also I needed to create new links for these into my micropython-stm32 file system before it would work.

uPyEasy then started up ok and ran for a short time. Some screens are working (MaIn, Config, Hardware - Hardware is much more responsive! But i did find some issues....
- uptime is a large negative number of days, and some hours and minutes, bit of a time-warp
- Controller page: I tried 'Add' but got a blank browser screen, and in the log a Critical exception OSError(2)
- Devices: I got the first bit, to select a plugin, but clicking Submit gave an error "connection reset" and in the log NameError ('local variable rererenced before assignment')
- Advanced: tried to change NTP, Submit gave a MemoryError. It seems to be gradually using up the memory while in use.

Please keep up the good work!! I'm really keen to have a working Ethernet device, as potentially it should be faster and more reliable than wifi. Is there anything I can do to help?

Cheers
Andrew
Several bug fixes later...
I have everything working on my side, the source has been updated to 000df1a. Please update your side and try again.

But.. i do have some of the same memory problems as you have. If running on a stm32, please run it using: upyeasy.main(loglevel=0) and keep an eye on the memory!
If the memory level drops to about 7-8K, then you might start getting memory errors due to memory fragmentation. Workaround is to do a single action, like adding a controller, and then reboot.
This is happening due to the new deepcopy's (although now replaced in some parts by ordereddict init's) which make things more reliable but also consume more memory. I need to do a second round of memory optimization to free up memory.
A memory map can be seen when clicking on tools/info menu in the browser, then on your usb console a complete memory map is appearing when running in debug mode!

I'm not going to able to fix the memory problems shortly, due to the fact that i'm back home to the good old USA for the next few weeks.
Hi Lisa,
Thanks for the update! :D
Yes, I'll try the latest update and monitor the memory. I'll try to look for things which decrease the memory a lot. (I do have the impression - it is only an impression - that memory is sometimes used while "nothing" is happening, no actions from the browser!)
As you're going to be away, can you suggest any strategy to help me narrow down where memory is getting used up? If I can do that, it may make it easier for you when you return.
Cheers
Andrew

LisaM
Normal user
Posts: 494
Joined: 11 Apr 2017, 18:29

Re: uPyEasy v0.3.0 released

#23 Post by LisaM » 02 Jun 2018, 18:31

Hi Andrew,

My biggest concern is the memory fragmentation due to constant creation/destruction of objects!
This is explained more in details here: https://docs.micropython.org/en/latest/ ... ained.html
The memory map mentioned in the post above is a great help to see how the memory is consumed over time, if you would take a look at these i would be very greatfull!

One of the things i’ve done so far is the DB cache, so it doesn’t create/destroy DB records as before for the most used DB tables anymore. Stuff like that can do miracles for ram limited systems like the STM32. The ESP32 has a bigger ram supply, so it doesnt happen there as quickly as with the STM32. But the STM32 has way faster response times for both I2C/SPI/UART and web calls, so for more professional systems the STM32 is prefered...

Cheers,

Lisa

AndrewJ
Normal user
Posts: 226
Joined: 14 Feb 2017, 12:38

Re: uPyEasy v0.3.0 released

#24 Post by AndrewJ » 02 Jun 2018, 19:45

LisaM wrote:
02 Jun 2018, 18:31
Hi Andrew,

My biggest concern is the memory fragmentation due to constant creation/destruction of objects!
This is explained more in details here: https://docs.micropython.org/en/latest/ ... ained.html
The memory map mentioned in the post above is a great help to see how the memory is consumed over time, if you would take a look at these i would be very greatfull!

One of the things i’ve done so far is the DB cache, so it doesn’t create/destroy DB records as before for the most used DB tables anymore. Stuff like that can do miracles for ram limited systems like the STM32. The ESP32 has a bigger ram supply, so it doesnt happen there as quickly as with the STM32. But the STM32 has way faster response times for both I2C/SPI/UART and web calls, so for more professional systems the STM32 is prefered...

Cheers,

Lisa
Hi Lisa,
Thanks for that, it helps me to understand the problem better. The information you linked contains another link to a section about "the heap", which uses the phrase "when the object goes out of scope". Can you elaborate what this means in practical terms, with an example or two from uPyEasy if possible? It might give me a better understanding what to look for.
Cheers
Andrew

AndrewJ
Normal user
Posts: 226
Joined: 14 Feb 2017, 12:38

Re: uPyEasy v0.3.0 released

#25 Post by AndrewJ » 12 Jun 2018, 19:18

LisaM wrote:
02 Jun 2018, 18:31
Hi Andrew,

My biggest concern is the memory fragmentation due to constant creation/destruction of objects!
This is explained more in details here: https://docs.micropython.org/en/latest/ ... ained.html
The memory map mentioned in the post above is a great help to see how the memory is consumed over time, if you would take a look at these i would be very greatfull!

One of the things i’ve done so far is the DB cache, so it doesn’t create/destroy DB records as before for the most used DB tables anymore. Stuff like that can do miracles for ram limited systems like the STM32. The ESP32 has a bigger ram supply, so it doesnt happen there as quickly as with the STM32. But the STM32 has way faster response times for both I2C/SPI/UART and web calls, so for more professional systems the STM32 is prefered...

Cheers,

Lisa
Hi Lisa,
I updated with the new version.
Running ok on start-up.
Made and saved some changes in Config. Free men dropped to about 17000 but recovered a bit. (Sorry I'm away from my computer so can't give you exact numbers or full log.)
Tried to go into Controller page. Free men plummeted! Down below 4000! Without even adding a controller. Upyeasy froze.

Looks like Controllers code is prime candidate for some GC memory collect statements?

I'm going to be busy for next couple of weeks so unlikely to be able to get much further till then.

Cheers Andrew.

fluppie
Normal user
Posts: 66
Joined: 09 Oct 2015, 13:23

Re: uPyEasy v0.3.0 released

#26 Post by fluppie » 17 Jun 2018, 23:38

After some fiddling got it working :-). I have a rev0 module:

Code: Select all

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:4464
ho 0 tail 12 room 4
load:0x40078000,len:0
load:0x40078000,len:11816
entry 0x4007a9fc
I (278) cpu_start: Pro cpu up.
I (278) cpu_start: Single core mode
I (278) heap_init: Initializing. RAM available for dynamic allocation:
I (282) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (288) heap_init: At 3FFC5120 len 0001AEE0 (107 KiB): DRAM
I (294) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (300) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (307) heap_init: At 4008E0E8 len 00011F18 (71 KiB): IRAM
I (313) cpu_start: Pro cpu start user code
I (33) cpu_start: Starting scheduler on PRO CPU.
I (101) modsocket: Initializing
I (3051) wifi: wifi firmware version: c202b34
I (3051) wifi: config NVS flash: enabled
I (3051) wifi: config nano formating: disabled
I (3061) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (3071) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (3081) wifi: Init dynamic tx buffer num: 32
I (3081) wifi: Init data frame dynamic rx buffer num: 64
I (3081) wifi: Init management frame dynamic rx buffer num: 64
I (3091) wifi: wifi driver task: 3ffd1194, prio:23, stack:4096
I (3101) wifi: Init static rx buffer num: 10
I (3101) wifi: Init dynamic rx buffer num: 0
I (3101) wifi: wifi power manager task: 0x3ffd5de4 prio: 21 stack: 2560
I (3171) phy: phy_version: 383.0, 79a622c, Jan 30 2018, 15:38:06, 0, 0
I (3171) wifi: mode : null
I (3171) wifi: mode : sta (24:0a:c4:83:1e:b8)
I (3171) wifi: STA_START
I (3901) wifi: n:6 0, o:1 0, ap:255 255, sta:6 0, prof:1
I (4461) wifi: state: init -> auth (b0)
I (5461) wifi: state: auth -> init (2)
I (5461) wifi: n:6 0, o:6 0, ap:255 255, sta:6 0, prof:1
I (5461) wifi: STA_DISCONNECTED, reason:2
I (5591) wifi: n:6 0, o:6 0, ap:255 255, sta:6 0, prof:1
I (5591) wifi: state: init -> auth (b0)
I (6591) wifi: state: auth -> init (2)
I (6591) wifi: n:6 0, o:6 0, ap:255 255, sta:6 0, prof:1
I (6591) wifi: STA_DISCONNECTED, reason:2
I (6711) wifi: n:6 0, o:6 0, ap:255 255, sta:6 0, prof:1
I (6711) wifi: state: init -> auth (b0)
I (6711) wifi: state: auth -> assoc (0)
I (6721) wifi: state: assoc -> run (10)
I (6761) wifi: connected with WiFi-2.4-24E7, channel 6
I (6761) network: event 4
I (8041) event: sta ip: 192.168.1.25, mask: 255.255.255.0, gw: 192.168.1.1
I (8041) network: GOT_IP
I (9721) wifi: pm start, type:0

2018-06-17 23:36:29 [info] uPyEasy-uPyEasy: Main: Async loop, log level: 2
2018-06-17 23:36:29 [info] uPyEasy-uPyEasy: Main: uPyEasy running in Station mode
2018-06-17 23:36:29 [info] uPyEasy-uPyEasy: Main: uPyEasy Main Async Loop on IP adress: 192.168.1.25:80

Looks like I cannot read the analog inputs, is that correct?

LisaM
Normal user
Posts: 494
Joined: 11 Apr 2017, 18:29

Re: uPyEasy v0.3.0 released

#27 Post by LisaM » 29 Jun 2018, 18:33

AndrewJ wrote:
02 Jun 2018, 19:45
the phrase "when the object goes out of scope".
Hi Andrew,

It means that the object is no longer used by the function, because the function ended. Objects are allocated inside the function and when the functions end, the objects memory should be released.

Cheers,

Lisa

LisaM
Normal user
Posts: 494
Joined: 11 Apr 2017, 18:29

Re: uPyEasy v0.3.0 released

#28 Post by LisaM » 29 Jun 2018, 18:34

fluppie wrote:
17 Jun 2018, 23:38
Looks like I cannot read the analog inputs, is that correct?
why not? Are you getting an input error or so?

cheers,

Lisa

AndrewJ
Normal user
Posts: 226
Joined: 14 Feb 2017, 12:38

Re: uPyEasy v0.3.0 released

#29 Post by AndrewJ » 30 Jun 2018, 08:59

LisaM wrote:
29 Jun 2018, 18:33
AndrewJ wrote:
02 Jun 2018, 19:45
the phrase "when the object goes out of scope".
Hi Andrew,

It means that the object is no longer used by the function, because the function ended. Objects are allocated inside the function and when the functions end, the objects memory should be released.

Cheers,

Lisa
Hi Lisa,
Welcome back on the forum!
Thanks for your reply, it helps, although I'm still getting my head around the basics of micropython/python - could you possibly elaborate on the difference between an "object" and a "function", or perhaps give an example of each within uPyEasy please?
BTW, I saw a thread on the Micropython forum recently about memory problems, don't know if you have seen it already. https://forum.micropython.org/viewtopic.php?f=2&t=4912

Cheers
Andrew

LisaM
Normal user
Posts: 494
Joined: 11 Apr 2017, 18:29

Re: uPyEasy v0.3.0 released

#30 Post by LisaM » 08 Jul 2018, 16:45

AndrewJ wrote:
30 Jun 2018, 08:59
Thanks for your reply, it helps, although I'm still getting my head around the basics of micropython/python - could you possibly elaborate on the difference between an "object" and a "function", or perhaps give an example of each within uPyEasy please?
BTW, I saw a thread on the Micropython forum recently about memory problems, don't know if you have seen it already. https://forum.micropython.org/viewtopic.php?f=2&t=4912

Cheers
Andrew
Hi Andrew,

This tutorial explains about Python objects and garbage collection: http://www.tutorialspoint.com/python/py ... bjects.htm
I saw the memory thread, haven't got to implementing it. I'm busy with something big.

Cheers,

Lisa

AndrewJ
Normal user
Posts: 226
Joined: 14 Feb 2017, 12:38

Re: uPyEasy v0.3.0 released

#31 Post by AndrewJ » 08 Jul 2018, 21:08

LisaM wrote:
08 Jul 2018, 16:45
AndrewJ wrote:
30 Jun 2018, 08:59
Thanks for your reply, it helps, although I'm still getting my head around the basics of micropython/python - could you possibly elaborate on the difference between an "object" and a "function", or perhaps give an example of each within uPyEasy please?
BTW, I saw a thread on the Micropython forum recently about memory problems, don't know if you have seen it already. https://forum.micropython.org/viewtopic.php?f=2&t=4912

Cheers
Andrew
Hi Andrew,

This tutorial explains about Python objects and garbage collection: http://www.tutorialspoint.com/python/py ... bjects.htm
I saw the memory thread, haven't got to implementing it. I'm busy with something big.

Cheers,

Lisa
Hi Lisa,
Thanks for that link, I'll study it and compare some of the code in uPyEasy.
Good luck with the something big!
Andrew

LisaM
Normal user
Posts: 494
Joined: 11 Apr 2017, 18:29

Re: uPyEasy v0.3.0 released

#32 Post by LisaM » 09 Jul 2018, 13:33

AndrewJ wrote:
08 Jul 2018, 21:08
Hi Lisa,
Thanks for that link, I'll study it and compare some of the code in uPyEasy.
Good luck with the something big!
Andrew
If it all works, things will start to fly... ;)

AndrewJ
Normal user
Posts: 226
Joined: 14 Feb 2017, 12:38

Re: uPyEasy v0.3.0 released

#33 Post by AndrewJ » 09 Jul 2018, 14:16

LisaM wrote:
09 Jul 2018, 13:33
AndrewJ wrote:
08 Jul 2018, 21:08
Hi Lisa,
Thanks for that link, I'll study it and compare some of the code in uPyEasy.
Good luck with the something big!
Andrew
If it all works, things will start to fly... ;)
That sounds exciting!
Best of luck :D

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests