New directory and file structure V024
Moderators: Voyager, BertB, grovkillen, Stuntteam, LisaM
New directory and file structure V024
Hi Lisa,
Help!!
I think I may be missing something obvious here, but I'm having difficulty with the file/directory structure for the new release, version V024.
I found the new README.md online in Github letscontrollit/uPyEasy/modules and I've been trying to follow it.
It's not clear to me where the "Root directory (for micropython, upyeasy, etc)" should be, or if indeed it matters. I've tried a couple of alternatives but with both, I see "link (broken)" against a number of files/folders in upyeasy/modules in my local folders after doing the full set of "git clone"s. These must be the ones with symlinks.
First try: I have a folder /home/andrew/Git in which my other local git repos live. So I created a new file in there, which I named "uPyEasy-root". In terminal I changed to the new directory, and issued the series of "git clone" commands. This created all the sub-folders, (micropython, micropython-lib, upyeasy etc) within uPyEasy-root. But when I look in uPyEasy-root/upyeasy/modules/stm32 I see a number of files/folders which say "link (broken)". And the same in /esp32 and /unix.
Second try: I deleted the new file and all its contents from Git folder and started again.
This time I had my terminal in /home/andrew/Git, and did the series of "git clone" commands. But the result is the same in the 'modules' subfolders.
I'm using Linux Mint.
Can you advise me, please - Where am I going wrong?
TIA
Andrew
Help!!
I think I may be missing something obvious here, but I'm having difficulty with the file/directory structure for the new release, version V024.
I found the new README.md online in Github letscontrollit/uPyEasy/modules and I've been trying to follow it.
It's not clear to me where the "Root directory (for micropython, upyeasy, etc)" should be, or if indeed it matters. I've tried a couple of alternatives but with both, I see "link (broken)" against a number of files/folders in upyeasy/modules in my local folders after doing the full set of "git clone"s. These must be the ones with symlinks.
First try: I have a folder /home/andrew/Git in which my other local git repos live. So I created a new file in there, which I named "uPyEasy-root". In terminal I changed to the new directory, and issued the series of "git clone" commands. This created all the sub-folders, (micropython, micropython-lib, upyeasy etc) within uPyEasy-root. But when I look in uPyEasy-root/upyeasy/modules/stm32 I see a number of files/folders which say "link (broken)". And the same in /esp32 and /unix.
Second try: I deleted the new file and all its contents from Git folder and started again.
This time I had my terminal in /home/andrew/Git, and did the series of "git clone" commands. But the result is the same in the 'modules' subfolders.
I'm using Linux Mint.
Can you advise me, please - Where am I going wrong?
TIA
Andrew
Re: New directory and file structure V024
Hi again, Lisa,
Looking in more depth, the problem seems to be that the symlinks in ....modules/stm32 etc don't actually point to the files/folders concerned. There are a total of 31 items by my reckoning. In some cases, the link contains "micropython/micropython" , or "micropython/micropython-lib" which differs from the structure described in README if I'm reading things right.
To give an example, 'picoweb' link is "../../../micropython/picoweb/picoweb" whereas the actual location is "../../../picoweb/picoweb" .
It looks like some kind of systematic problem, so (hopefully) the solution may be a common one which fixes most or all of them (says I optimistically!)
Hope this helps a bit in tracking down the problem.
Andrew
Looking in more depth, the problem seems to be that the symlinks in ....modules/stm32 etc don't actually point to the files/folders concerned. There are a total of 31 items by my reckoning. In some cases, the link contains "micropython/micropython" , or "micropython/micropython-lib" which differs from the structure described in README if I'm reading things right.
To give an example, 'picoweb' link is "../../../micropython/picoweb/picoweb" whereas the actual location is "../../../picoweb/picoweb" .
It looks like some kind of systematic problem, so (hopefully) the solution may be a common one which fixes most or all of them (says I optimistically!)

Hope this helps a bit in tracking down the problem.
Andrew
Re: New directory and file structure V024
Pffff, i wish git would follow the symbolic link and copy the file over...AndrewJ wrote: ↑15 Apr 2018, 23:07 Hi again, Lisa,
Looking in more depth, the problem seems to be that the symlinks in ....modules/stm32 etc don't actually point to the files/folders concerned. There are a total of 31 items by my reckoning. In some cases, the link contains "micropython/micropython" , or "micropython/micropython-lib" which differs from the structure described in README if I'm reading things right.
To give an example, 'picoweb' link is "../../../micropython/picoweb/picoweb" whereas the actual location is "../../../picoweb/picoweb" .
It looks like some kind of systematic problem, so (hopefully) the solution may be a common one which fixes most or all of them (says I optimistically!)![]()
Hope this helps a bit in tracking down the problem.
Andrew

I'll take a look!
Re: New directory and file structure V024
Thanks, Lisa - sorry to be the bearer of bad tidings!
Andrew.

Andrew.
Re: New directory and file structure V024
Hi Lisa,
Well, I had some time to spare so I set into the stm32 subfolder and edited the broken symlinks in my local copy of upyeasy. Now they show as "Link to text" rather than "link (broken)". There were a few more in subfolders as well. Most of them seemed to have an extra "micropython" at the front (after ../../../) - might have been a change in file structure at some point which didn't update the symlinks??
If the updated symlinks are of any use to you, let me know and I'll post a zip file.
I'd like to try building uPyEasy for STM32, and have a few questions:
1. Are the workaround steps for micropython still needed? (as per your post #46 in STM boards.)
2. With the changed filesystem, do I still copy the uPyEasy modules and src contents into micropython/ports/stm32/modules and /modules/upyeasy as before ?
3. How (and where) to build uPyEasy? (Still give make command in micropython/ports/stm32 ?)
Cheers
Andrew
Well, I had some time to spare so I set into the stm32 subfolder and edited the broken symlinks in my local copy of upyeasy. Now they show as "Link to text" rather than "link (broken)". There were a few more in subfolders as well. Most of them seemed to have an extra "micropython" at the front (after ../../../) - might have been a change in file structure at some point which didn't update the symlinks??
If the updated symlinks are of any use to you, let me know and I'll post a zip file.
I'd like to try building uPyEasy for STM32, and have a few questions:
1. Are the workaround steps for micropython still needed? (as per your post #46 in STM boards.)
2. With the changed filesystem, do I still copy the uPyEasy modules and src contents into micropython/ports/stm32/modules and /modules/upyeasy as before ?
3. How (and where) to build uPyEasy? (Still give make command in micropython/ports/stm32 ?)
Cheers
Andrew
Re: New directory and file structure V024
Hi Andrew,AndrewJ wrote: ↑16 Apr 2018, 19:28 Hi Lisa,
Well, I had some time to spare so I set into the stm32 subfolder and edited the broken symlinks in my local copy of upyeasy. Now they show as "Link to text" rather than "link (broken)". There were a few more in subfolders as well. Most of them seemed to have an extra "micropython" at the front (after ../../../) - might have been a change in file structure at some point which didn't update the symlinks??
If the updated symlinks are of any use to you, let me know and I'll post a zip file.
I'd like to try building uPyEasy for STM32, and have a few questions:
1. Are the workaround steps for micropython still needed? (as per your post #46 in STM boards.)
2. With the changed filesystem, do I still copy the uPyEasy modules and src contents into micropython/ports/stm32/modules and /modules/upyeasy as before ?
3. How (and where) to build uPyEasy? (Still give make command in micropython/ports/stm32 ?)
Cheers
Andrew
1. Yes, this is a problem in the STM32 micropython firmware, not in uPyEasy.
2. Yes and no (no copy needed!):
- make a modules directory (in ports esp32 or stm32)
- goto modules dir
- make a symlink to stm32 modules : ln -s upyeasy/modules/stm32/* .
- make a symlink to src: ln -s upyeasy/src upyeasy
3. Yes, upyeasy modules will be added to the firmware because the entire stm32/modules dir will be added (symlinks followed and files included).
Cheers,
Lisa
Re: New directory and file structure V024
Hi Lisa,LisaM wrote: ↑16 Apr 2018, 20:42Hi Andrew,AndrewJ wrote: ↑16 Apr 2018, 19:28 Hi Lisa,
Well, I had some time to spare so I set into the stm32 subfolder and edited the broken symlinks in my local copy of upyeasy. Now they show as "Link to text" rather than "link (broken)". There were a few more in subfolders as well. Most of them seemed to have an extra "micropython" at the front (after ../../../) - might have been a change in file structure at some point which didn't update the symlinks??
If the updated symlinks are of any use to you, let me know and I'll post a zip file.
I'd like to try building uPyEasy for STM32, and have a few questions:
1. Are the workaround steps for micropython still needed? (as per your post #46 in STM boards.)
2. With the changed filesystem, do I still copy the uPyEasy modules and src contents into micropython/ports/stm32/modules and /modules/upyeasy as before ?
3. How (and where) to build uPyEasy? (Still give make command in micropython/ports/stm32 ?)
Cheers
Andrew
1. Yes, this is a problem in the STM32 micropython firmware, not in uPyEasy.
2. Yes and no (no copy needed!):
- make a modules directory (in ports esp32 or stm32)
- goto modules dir
- make a symlink to stm32 modules : ln -s upyeasy/modules/stm32/* .
- make a symlink to src: ln -s upyeasy/src upyeasy
3. Yes, upyeasy modules will be added to the firmware because the entire stm32/modules dir will be added (symlinks followed and files included).
Cheers,
Lisa
Thanks for that! I'll give it a go.

I'm still getting my head round the changed filestructure, but once I've been right the way through it should come easier.
I guess the benefit of the new structure is that all the separate parts, (upyeasy, micropython, micropython-lib etc etc) are together and can be kept updated individually?
I'll let you know how it goes!
Andrew
Re: New directory and file structure V024
Hi Andrew,
Just also fixed a modules bug, asyn.py file was empty and re.py was missing. Both are fixed and now uploaded.
Cheers,
Lisa
Just also fixed a modules bug, asyn.py file was empty and re.py was missing. Both are fixed and now uploaded.
Exactly! The platforms needs are sometimes differently, like with the STM32 work around. That made me thinking that we need to separate them, but not to much. Unix for example doesn't have a onewire library, so a dummy is made for that platform.I guess the benefit of the new structure is that all the separate parts, (upyeasy, micropython, micropython-lib etc etc) are together and can be kept updated individually?
Cheers,
Lisa
Re: New directory and file structure V024
Hi again Lisa,AndrewJ wrote: ↑16 Apr 2018, 20:57Hi Lisa,LisaM wrote: ↑16 Apr 2018, 20:42Hi Andrew,AndrewJ wrote: ↑16 Apr 2018, 19:28 Hi Lisa,
Well, I had some time to spare so I set into the stm32 subfolder and edited the broken symlinks in my local copy of upyeasy. Now they show as "Link to text" rather than "link (broken)". There were a few more in subfolders as well. Most of them seemed to have an extra "micropython" at the front (after ../../../) - might have been a change in file structure at some point which didn't update the symlinks??
If the updated symlinks are of any use to you, let me know and I'll post a zip file.
I'd like to try building uPyEasy for STM32, and have a few questions:
1. Are the workaround steps for micropython still needed? (as per your post #46 in STM boards.)
2. With the changed filesystem, do I still copy the uPyEasy modules and src contents into micropython/ports/stm32/modules and /modules/upyeasy as before ?
3. How (and where) to build uPyEasy? (Still give make command in micropython/ports/stm32 ?)
Cheers
Andrew
1. Yes, this is a problem in the STM32 micropython firmware, not in uPyEasy.
2. Yes and no (no copy needed!):
- make a modules directory (in ports esp32 or stm32)
- goto modules dir
- make a symlink to stm32 modules : ln -s upyeasy/modules/stm32/* .
- make a symlink to src: ln -s upyeasy/src upyeasy
3. Yes, upyeasy modules will be added to the firmware because the entire stm32/modules dir will be added (symlinks followed and files included).
Cheers,
Lisa
Thanks for that! I'll give it a go.![]()
I'm still getting my head round the changed filestructure, but once I've been right the way through it should come easier.
I guess the benefit of the new structure is that all the separate parts, (upyeasy, micropython, micropython-lib etc etc) are together and can be kept updated individually?
I'll let you know how it goes!
Andrew
I just noticed that there is a new update on Github for uPyEasy, with the changes to the links in modules, so they refer to /unix. So I did "git pull" to update my local repo (to commit fb7e90d)
Unfortunately there seem to be five folder links in stm32 which are broken, these are
- json
- picoweb
- umodbus
- urllib
- utemplate
In the /unix folder, these folders are not present.
HTH.
Andrew
Re: New directory and file structure V024
Hi Lisa
Sorry to hit you with yet another question....
As you said earlier, I still need to do the work around steps for micropython for STM32. Fine.
But in the overall new file structure, I have "two micropythons" (micropython, micropython-stm32). The second is where I did the work around.
So.... presumably it is also the second one (micropython-stm32) which I should use when doing the following steps - yes?
And, another question, presumably it is also in micropython-stm32 (not micropython) that I should do the build of uPyEasy firmware for STM32 - yes?
Sorry if I'm being slow here!! I just want to be sure I'm not going off the straight-and-narrow.
Cheers
Andrew
Sorry to hit you with yet another question....

As you said earlier, I still need to do the work around steps for micropython for STM32. Fine.
But in the overall new file structure, I have "two micropythons" (micropython, micropython-stm32). The second is where I did the work around.
So.... presumably it is also the second one (micropython-stm32) which I should use when doing the following steps - yes?
Code: Select all
- make a modules directory (in ports esp32 or stm32)
- goto modules dir
- make a symlink to stm32 modules : ln -s upyeasy/modules/stm32/* .
- make a symlink to src: ln -s upyeasy/src upyeasy
Sorry if I'm being slow here!! I just want to be sure I'm not going off the straight-and-narrow.
Cheers
Andrew
Re: New directory and file structure V024
BumpAndrewJ wrote: ↑16 Apr 2018, 22:12Hi again Lisa,AndrewJ wrote: ↑16 Apr 2018, 20:57Hi Lisa,LisaM wrote: ↑16 Apr 2018, 20:42
Hi Andrew,
1. Yes, this is a problem in the STM32 micropython firmware, not in uPyEasy.
2. Yes and no (no copy needed!):
- make a modules directory (in ports esp32 or stm32)
- goto modules dir
- make a symlink to stm32 modules : ln -s upyeasy/modules/stm32/* .
- make a symlink to src: ln -s upyeasy/src upyeasy
3. Yes, upyeasy modules will be added to the firmware because the entire stm32/modules dir will be added (symlinks followed and files included).
Cheers,
Lisa
Thanks for that! I'll give it a go.![]()
I'm still getting my head round the changed filestructure, but once I've been right the way through it should come easier.
I guess the benefit of the new structure is that all the separate parts, (upyeasy, micropython, micropython-lib etc etc) are together and can be kept updated individually?
I'll let you know how it goes!
Andrew
I just noticed that there is a new update on Github for uPyEasy, with the changes to the links in modules, so they refer to /unix. So I did "git pull" to update my local repo (to commit fb7e90d)
Unfortunately there seem to be five folder links in stm32 which are broken, these are
- json
- picoweb
- umodbus
- urllib
- utemplate
In the /unix folder, these folders are not present.
HTH.
Andrew

Re: New directory and file structure V024
BumpAndrewJ wrote: ↑16 Apr 2018, 22:55 Hi Lisa
Sorry to hit you with yet another question....![]()
As you said earlier, I still need to do the work around steps for micropython for STM32. Fine.
But in the overall new file structure, I have "two micropythons" (micropython, micropython-stm32). The second is where I did the work around.
So.... presumably it is also the second one (micropython-stm32) which I should use when doing the following steps - yes?And, another question, presumably it is also in micropython-stm32 (not micropython) that I should do the build of uPyEasy firmware for STM32 - yes?Code: Select all
- make a modules directory (in ports esp32 or stm32) - goto modules dir - make a symlink to stm32 modules : ln -s upyeasy/modules/stm32/* . - make a symlink to src: ln -s upyeasy/src upyeasy
Sorry if I'm being slow here!! I just want to be sure I'm not going off the straight-and-narrow.
Cheers
Andrew

Re: New directory and file structure V024
Sorry, excellent weather over here..AndrewJ wrote: ↑16 Apr 2018, 22:55 Hi Lisa
Sorry to hit you with yet another question....![]()
As you said earlier, I still need to do the work around steps for micropython for STM32. Fine.
But in the overall new file structure, I have "two micropythons" (micropython, micropython-stm32). The second is where I did the work around.
So.... presumably it is also the second one (micropython-stm32) which I should use when doing the following steps - yes?And, another question, presumably it is also in micropython-stm32 (not micropython) that I should do the build of uPyEasy firmware for STM32 - yes?Code: Select all
- make a modules directory (in ports esp32 or stm32) - goto modules dir - make a symlink to stm32 modules : ln -s upyeasy/modules/stm32/* . - make a symlink to src: ln -s upyeasy/src upyeasy
Sorry if I'm being slow here!! I just want to be sure I'm not going off the straight-and-narrow.
Cheers
Andrew

In micropython-stm32 you make uPyEasy for the STM32, these steps you do over there are:
- make a modules directory : mkdir micropython-stm32/ports/stm32/modules
- goto micropython-stm32/ports/stm32/modules dir
- make a symlink to stm32 modules : ln -s upyeasy/modules/stm32/* . (upyeasy is where your source root tree is)
- make a symlink to src: ln -s upyeasy/src upyeasy
cd ..
make MICROPY_PY_WIZNET5K=5500 BOARD=PYBV3 USE_PYDFU=0 deploy
Re: New directory and file structure V024
Hi Lisa,LisaM wrote: ↑20 Apr 2018, 18:54Sorry, excellent weather over here..AndrewJ wrote: ↑16 Apr 2018, 22:55 Hi Lisa
Sorry to hit you with yet another question....![]()
As you said earlier, I still need to do the work around steps for micropython for STM32. Fine.
But in the overall new file structure, I have "two micropythons" (micropython, micropython-stm32). The second is where I did the work around.
So.... presumably it is also the second one (micropython-stm32) which I should use when doing the following steps - yes?And, another question, presumably it is also in micropython-stm32 (not micropython) that I should do the build of uPyEasy firmware for STM32 - yes?Code: Select all
- make a modules directory (in ports esp32 or stm32) - goto modules dir - make a symlink to stm32 modules : ln -s upyeasy/modules/stm32/* . - make a symlink to src: ln -s upyeasy/src upyeasy
Sorry if I'm being slow here!! I just want to be sure I'm not going off the straight-and-narrow.
Cheers
Andrew![]()
In micropython-stm32 you make uPyEasy for the STM32, these steps you do over there are:
- make a modules directory : mkdir micropython-stm32/ports/stm32/modules
- goto micropython-stm32/ports/stm32/modules dir
- make a symlink to stm32 modules : ln -s upyeasy/modules/stm32/* . (upyeasy is where your source root tree is)
- make a symlink to src: ln -s upyeasy/src upyeasy
cd ..
make MICROPY_PY_WIZNET5K=5500 BOARD=PYBV3 USE_PYDFU=0 deploy
Thanks for that, that makes it clear.

How about the missing folders and files in /unix (post #10) ?
Thanks in advance.Unfortunately there seem to be five folder links in stm32 which are broken, these are
- json
- picoweb
- umodbus
- urllib
- utemplate
In the /unix folder, these folders are not present.
HTH.

Andrew
Re: New directory and file structure V024
Hi andrew,
All missing Unix dir's are fixed!
I also added some new features for ESP32 uPyEasy, like auto switch to AP mode when the wifi connection is not available at startup. v0.2.5 is about to be released.
Cheers,
Lisa
All missing Unix dir's are fixed!
I also added some new features for ESP32 uPyEasy, like auto switch to AP mode when the wifi connection is not available at startup. v0.2.5 is about to be released.
Cheers,
Lisa
Re: New directory and file structure V024
Great news! Thanks, Lisa, for all your hard work on this.

Andrew
Re: New directory and file structure V024
Hi again Lisa,
Thx, that worked fine, I pulled the latest update from Github to my local repo, and all the links are good now.


Now to have a go at building the whole thing for STM32!

Cheers
Andrew
Re: New directory and file structure V024
Hi Lisa,
I updated my repo and got all the new filesystem set up and made the symlinks to refer to the upyeasy STM32 'src' and ''modules' files, and was able to build successfully.

(I did find errors complaining that two files were missing in my latest micropython-stm32. These were 'lib/axtls/ssl/version.h' and 'lib/axtls/ssl/tls1.h'
I got round this by copying these files from my previous micropython-stm32.)
To get it to build, I ended up using "make MICROPY_PY_WIZNET5K=5500 BOARD=PYBV3" (without "USE_PYDFU=0 deploy") as with the full line I got errors ("cannot find -laxtls") and then found that the full command worked ok to download to my STM32 board.
So, long story short, I've got firmware onto my STM32 with the new file system.


There is a "but" however....

When I start uPyEasy on the board, it gets to the line "Init: rule table" then throws an error:
Code: Select all
2015-01-01 10:57:44 [debug] uPyEasy: Init: config Table
2015-01-01 10:57:44 [debug] uPyEasy: Init: network Table
2015-01-01 10:57:44 [debug] uPyEasy: Init: protocol Table
2015-01-01 10:57:44 [debug] uPyEasy: Init: controller Table
2015-01-01 10:57:44 [debug] uPyEasy: Init: hardware Table
2015-01-01 10:57:44 [debug] uPyEasy: Init: dxpin Table
2015-01-01 10:57:44 [debug] uPyEasy: Init: dxmap Table
2015-01-01 10:57:44 [debug] uPyEasy: Init: plugin Table
2015-01-01 10:57:44 [debug] uPyEasy: Init: pluginstore Table
2015-01-01 10:57:44 [debug] uPyEasy: Init: device Table
2015-01-01 10:57:44 [debug] uPyEasy: Init: service Table
2015-01-01 10:57:44 [debug] uPyEasy: Init: notification Table
2015-01-01 10:57:44 [debug] uPyEasy: Init: advanced Table
2015-01-01 10:57:44 [debug] uPyEasy: Init: script Table
2015-01-01 10:57:44 [debug] uPyEasy: Init: rule Table
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 96, in get
File "filedb.py", line 96, in get
ValueError: syntax error in JSON
>>>
Any ideas where I'm going wrong, please?

Cheers
Andrew
Re: New directory and file structure V024
Hi again Lisa,
Following on from post #19 above.
I had a go at debugging the error by adding some print lines ib filedb.py, in 'get' as follows:
The output I get is like this....
I'm not sure what the output from f.reat should look like, but I think the "yield ujson.loads... " line 100 is expecting something that looks like json format, which the print output doesn't look like to me (?).
Can you help me with next steps to debug this, please?
tia
Andrew
Following on from post #19 above.
I had a go at debugging the error by adding some print lines ib filedb.py, in 'get' as follows:
Code: Select all
88 @classmethod
89 def get(cls):
90 # Return dict!
91 for dirent in uos.ilistdir("%s/%s" % (cls.__db__.name, cls.__table__)):
92 fname = dirent[0]
93 print("filedb.py line 93: fname = ", fname )
94 if fname[0] == "." or dirent[1] == 16384:
95 continue
96 with open(cls.fname(fname)) as f:
97 #print("filedb.py line 96: fname(fname) =", fname(fname) )
98 print("filedb.py line 97: f=", f)
99 print("filedb.py line 98: f.read() =", f.read() )
100 yield ujson.loads(f.read())
Code: Select all
2015-01-01 00:00:00 [debug] uPyEasy: Init: service Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: notification Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: advanced Table
2015-01-01 00:00:00 [debug] uPyEasy: Init: script Table
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
>>>
Can you help me with next steps to debug this, please?
tia
Andrew
Re: New directory and file structure V024
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
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
Re: New directory and file structure V024
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.
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.
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
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.

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
>>>
I'll keep trying, but I really would value your input when you can, please

TIA
Andrew
Re: New directory and file structure V024
Hi Andrew,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
>>>
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
Re: New directory and file structure V024
Hi Lisa,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
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
Who is online
Users browsing this forum: No registered users and 18 guests