Questions about components of uPyEasy

Moderators: Voyager, BertB, grovkillen, Stuntteam, LisaM

Post Reply
Message
Author
Edu.Uy
New user
Posts: 8
Joined: 04 Feb 2018, 20:42

Re: Questions about components of uPyEasy

#21 Post by Edu.Uy » 08 Feb 2018, 20:24

micropet wrote: 08 Feb 2018, 18:53 That's mine now:
I copied _onewire.py to micropython/lib and compiled everything again.
But it is not found.
Try to copy it in ".micropython/lib directory" instead. It should work.

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

Re: Questions about components of uPyEasy

#22 Post by AndrewJ » 08 Feb 2018, 20:29

Hmm,
For the error 17's I;ve found if I delete the folders mentioned in each line (or rename to folder.bkp if you prefer) the first set of errors is removed. You'll probably have to do this again if you have to restart more than once.

For the _onewire error, double check that _onewire (as distinct from onewire) is in the .micropython/lib folder. If it is, I'm out of ideas - hopefuly @LisaM will be able to advise. I have found anyway that the _onewire module doesn't seem to work fully - if I try to add a DS18 device plugin in the unix port, it doesn't work for me.

Having said all that, it is early days for the uPyEasy system and we will surely get through these problems. :)
Andrew.

User avatar
micropet
Normal user
Posts: 34
Joined: 23 Jan 2018, 11:39
Location: Essen, Germany
Contact:

Re: Questions about components of uPyEasy

#23 Post by micropet » 08 Feb 2018, 21:12

[/quote]

Try to copy it in ".micropython/lib directory" instead. It should work.
[/quote]

Sorry, mistake from me.
It is ib ".micropython/lib directory", but the error remains.

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

Re: Questions about components of uPyEasy

#24 Post by AndrewJ » 09 Feb 2018, 16:52

Edu.Uy wrote: 06 Feb 2018, 20:15 Good you have it working.

Just to clarify my comment, the config file is the upyeasy file... this config files are generated automatically by upyeasy the first tie you run it.
Is not Linux version dependent. Just internal uPyEasy config. The default one is in port 80.

Regards.
Edu
Hi Edu,
Just getting back to you on this. I found your suggestion most useful today, when I ended up reinstalling micropython and upyeasy on my Linux PC. :D

I found the config file (although it took me a while at first!). The full path, on my PC at least, is

Code: Select all

  ~/micropython/ports/unix/config/config/2018-02-09_15-30-181062930438 
The first part fits with cloning micropython to my home directory, during which it creates ~/micropython and subfolders.
The actual filename will vary based on date and time of first running upyeasy.

So I changed the port= 80 to 9000, saved the file, restarted upyeasy.... and it went right onto port 9000. Brilliant. Thank you! :D
Best wishes
Andrew

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

Re: Questions about components of uPyEasy

#25 Post by LisaM » 10 Feb 2018, 19:29

AndrewJ wrote: 06 Feb 2018, 20:44 1517945318.103 <HTTPRequest object at 7fa4ea795500> <StreamWriter <_socket 27>> OSError(13,)
Traceback (most recent call last):
File "/home/andrew/.micropython/lib/picoweb/__init__.py", line 186, in _handle
File "upyeasy/pages.py", line 1247, in devicesettingpage
File "upyeasy/plugin.py", line 118, in initdevice
File "upyeasy/plugins/ds18.py", line 79, in init
File "upyeasy/hal.py", line 741, in pin
File "/home/andrew/.micropython/lib/machine/pin.py", line 14, in __init__
OSError: [Errno 13] EACCES
Hi Andrew, the contractor for the house remodeling (repairing cracks in the walls) is finally done and i'm having more time now.

The EACCES error (Error ACCESS) is often due to the Unix security layer, unless you give yourself more rights you can't access the unix hardware directly.
For the http port 80 you get the same problem, on unix everything under port 1024 is restricted and normal users can't access it (that's why 8000 or 9000 does work for you).

So you either use sudo:
sudo micropython -m upyeasy
OR give your user more rights.

Cheers,

Lisa

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

Re: Questions about components of uPyEasy

#26 Post by LisaM » 10 Feb 2018, 19:35

The FileDB database where all uPyEasy data is stored is indeed located on
~/.micropython/lib/upyeasy/config
.
Each table (entity) is in FileDB a directory under the config dir, for example hardware or config.
Each table record is a separate file in this (hardware,config, etc) directory with an unique datetimestamp as filename. The datetimestamp is the primary key for the record and is referenced when updating the record. See also the code for pages, like line 260:

Code: Select all

# Update config
        cid = db.configTable.update({"timestamp":config['timestamp']},name=config['name'],unit=config['unit'],password=config['password'],sleepenable=config['sleepenable'],sleeptime=config['sleeptime'],sleepfailure=config['sleepfailure'],port=config['port'])
Since every record is text based, it's save to change the contents of the record using a file editor.

Cheers,

Lisa

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

Re: Questions about components of uPyEasy

#27 Post by AndrewJ » 10 Feb 2018, 21:00

Hi Lisa,
Thanks for both your replies, that's good information!
I'll do some more tomorrow. I have a feeling that I might have a few more questions. ;)
Glad to hear the work on your house is done, that can be very disruptive.
Cheers,
Andrew.

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests