New directory and file structure V024

Moderators: Voyager, BertB, grovkillen, Stuntteam, LisaM

Post Reply
Message
Author
AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: New directory and file structure V024

#21 Post by AndrewJ » 27 Apr 2018, 20:16

Hi Lisa,
I still have the error mentioned in my posts above, would you be able to help, please? :)
I just found the latest uPyEasy update (f20076c) on Github and gave it a try, but I still get the "syntax error in JSON" as above.
I've pretty much run out of ideas at the moment.

Cheers
Andrew

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

Re: New directory and file structure V024

#22 Post by AndrewJ » 27 Apr 2018, 21:22

Hi Lisa
Another update (still on my STM32 pyboard clone).....
I thought a bit more and something made me look in the config files on my board (PYBFLASH/config).
In the subfolders, I found lots of files with the uPyEasy-style filenames, containing nothing but lots of characters like a 'y' with 2 dots above. I wonder if I corrupted the flash, perhaps by unplugging it without dismounting. :oops:
Anyway, I deleted all those files and rebooted. It got much further through the startup sequence...then displays the output of the print commands I put in filedb.py for debugging, then throws a similar error.

Code: Select all

(snipped)
2015-01-01 00:00:00 [debug] uPyEasy: Init: rule Table
2015-01-01 00:00:00 [debug] uPyEasy: GC MEM Free: 30,432
2015-01-01 00:00:00 [debug] uPyEasy: Init: Create Config Record
2015-01-01 00:00:00 [debug] uPyEasy: GC MEM Free: 30,288
2015-01-01 00:00:01 [debug] uPyEasy: Init: Create Network Record
2015-01-01 00:00:01 [debug] uPyEasy: GC MEM Free: 30,112
2015-01-01 00:00:02 [debug] uPyEasy: Init: Create Hardware Record
2015-01-01 00:00:02 [debug] uPyEasy: GC MEM Free: 30,080
2015-01-01 00:00:02 [debug] uPyEasy: Hal: hardwaredb init
2015-01-01 00:00:02 [debug] uPyEasy: GC MEM Free: 30,000
2015-01-01 00:00:02 [debug] uPyEasy: Hal: hardwaredb pyboard
2015-01-01 00:00:02 [debug] uPyEasy: GC MEM Free: 30,000
2015-01-01 00:00:02 [debug] uPyEasy: Hal: board info
2015-01-01 00:00:02 [debug] uPyEasy: GC MEM Free: 30,016
2015-01-01 00:00:02 [debug] uPyEasy: Hal: board pyboard
2015-01-01 00:00:02 [debug] uPyEasy: GC MEM Free: 30,000
2015-01-01 00:00:03 [debug] uPyEasy: Init: Create dxpin Record
2015-01-01 00:00:03 [debug] uPyEasy: GC MEM Free: 30,048
2015-01-01 00:00:04 [debug] uPyEasy: Hal: dxpins_init
2015-01-01 00:00:04 [debug] uPyEasy: GC MEM Free: 29,712
2015-01-01 00:00:04 [debug] uPyEasy: Hal: dxpins_init pyboard
2015-01-01 00:00:04 [debug] uPyEasy: GC MEM Free: 29,712
2015-01-01 00:00:04 [debug] uPyEasy: Hal: board info
2015-01-01 00:00:04 [debug] uPyEasy: GC MEM Free: 29,664
2015-01-01 00:00:04 [debug] uPyEasy: Hal: board pyboard
2015-01-01 00:00:04 [debug] uPyEasy: GC MEM Free: 29,648
2015-01-01 00:00:04 [debug] uPyEasy: STM32: init_pindb
2015-01-01 00:00:04 [debug] uPyEasy: GC MEM Free: 29,120
2015-01-01 00:00:05 [debug] uPyEasy: Init: Create advanced Record
2015-01-01 00:00:06 [debug] uPyEasy: GC MEM Free: 29,792
2015-01-01 00:00:06 [debug] uPyEasy: Hal: Init
2015-01-01 00:00:06 [debug] uPyEasy: GC MEM Free: 29,696
filedb.py line 93: fname =  2015-01-01_00-00-01859068510
filedb.py line 97: f= <io.TextIOWrapper 20010400>
filedb.py line 98: f.read() = {"fbkey": "", "ip": "", "gateway": "", "fbssid": "", "subnet": "", "ssid": "", "key": "", "timestamp": "2015-01-01_00-00-01859068510", "spi": 0, "dns": "", "mode": "STA", "cs": "", "rst": ""}
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "upyeasy/__init__.py", line 40, in main
  File "upyeasy/init.py", line 207, in init
  File "upyeasy/hal.py", line 46, in init_network
  File "upyeasy/hal.py", line 42, in init_network
  File "upyeasy/db.py", line 97, in getrow
  File "filedb.py", line 100, in get
  File "filedb.py", line 100, in get
ValueError: syntax error in JSON
>>> 
The print output from line 98 looks to me rather like a network config file, so I looked in PYBFLASH/config/network but no file is there. I also checked all the other config subfolders, no files there. I don't know where this info is coming from - perhaps the database?? But it appears that it is somehow not in the expected format.

I'll keep trying, but I really would value your input when you can, please ;)

TIA
Andrew

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

Re: New directory and file structure V024

#23 Post by LisaM » 28 Apr 2018, 12:41

AndrewJ wrote: 25 Apr 2018, 22:58 2015-01-01 00:00:00 [debug] uPyEasy: Init: rule Table
filedb.py line 93: fname = 2000-01-01_00-00-001062930438
filedb.py line 97: f= <io.TextIOWrapper 2000e9b0>
filedb.py line 98: f.read() = �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "upyeasy/__init__.py", line 40, in main
File "upyeasy/init.py", line 158, in init
File "upyeasy/db.py", line 43, in public
File "upyeasy/db.py", line 1, in <listcomp>
File "filedb.py", line 100, in get
File "filedb.py", line 100, in get
ValueError: syntax error in JSON
>>>
Hi Andrew,

I suspect that your rule table config file has gone corrupt, it happens to me also sometimes on the STM32F405 platform. Just use the usb share and delete the rule table.
I also have optimized uPyEasy to use far less memory, switched from pre-loading to JIT, since i was running out of it on the STM32. The GC mem free debug was added to see which parts of uPyEasy are using memory, i'll make it a main() parameter so you can switch it on and off. It also provides the possibility to monitor memory leaks.

Ps. the STM is suffering from memory fragmentation, something i'm currently fixing also.

Cheers,

Lisa

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

Re: New directory and file structure V024

#24 Post by AndrewJ » 28 Apr 2018, 21:26

LisaM wrote: 28 Apr 2018, 12:41
Hi Andrew,

I suspect that your rule table config file has gone corrupt, it happens to me also sometimes on the STM32F405 platform. Just use the usb share and delete the rule table.
I also have optimized uPyEasy to use far less memory, switched from pre-loading to JIT, since i was running out of it on the STM32. The GC mem free debug was added to see which parts of uPyEasy are using memory, i'll make it a main() parameter so you can switch it on and off. It also provides the possibility to monitor memory leaks.

Ps. the STM is suffering from memory fragmentation, something i'm currently fixing also.

Cheers,

Lisa
Hi Lisa,
Thanks for your reply. It helps to know I'm not alone with this! I'll try deleting the rule table and report back.

Cheers
Andrew

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests